File: pathtracer_device.isph

package info (click to toggle)
embree 4.3.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 100,656 kB
  • sloc: cpp: 228,918; xml: 40,944; ansic: 2,685; python: 812; sh: 635; makefile: 228; csh: 42
file content (75 lines) | stat: -rw-r--r-- 1,974 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#include "../common/math/random_sampler.isph"
#include "../common/math/sampling.isph"
#include "../common/core/differential_geometry.isph"
#include "../common/tutorial/tutorial_device.isph"
#include "../common/tutorial/scene_device.h"
#include "../common/tutorial/optics.isph"

extern uniform ISPCScene* uniform g_ispc_scene;
extern uniform int g_instancing_mode;
extern uniform int g_spp;
extern uniform int g_max_path_length;
extern uniform bool g_accumulate;
extern uniform bool g_changed;

struct TutorialData
{
  uniform ISPCScene* uniform ispc_scene;
  uniform int instancing_mode;
  RTCRayQueryFlags iflags_coherent;
  RTCRayQueryFlags iflags_incoherent;

  RTCFilterFunctionN occlusionFilterOpaque;
  RTCFilterFunctionN occlusionFilterHair;
  
  uniform int spp;
  uniform int max_path_length;

  /* accumulation buffer */
  uniform Vec3ff* uniform accu;
  uniform unsigned int accu_width;
  uniform unsigned int accu_height;
  uniform unsigned int accu_count;
  
  uniform bool animation;
  uniform bool use_smooth_normals;
  
  /* scene data */
  RTCScene scene;
};

void TutorialData_Constructor(uniform TutorialData* uniform This)
{
  This->ispc_scene = g_ispc_scene;
  This->instancing_mode = g_instancing_mode;
  This->iflags_coherent = g_iflags_coherent;
  This->iflags_incoherent = g_iflags_incoherent;

  This->occlusionFilterOpaque = NULL;
  This->occlusionFilterHair = NULL; 
  
  This->spp = g_spp;
  This->max_path_length = g_max_path_length;

  This->accu = NULL;
  This->accu_width = 0;
  This->accu_height = 0;
  This->accu_count = 0;

  This->animation = true;
  This->use_smooth_normals = false;
        
  This->scene = NULL;
}

void TutorialData_Destructor(uniform TutorialData* uniform This)
{
  rtcReleaseScene (This->scene); This->scene = NULL;
  delete[] This->accu; This->accu = NULL;
  This->accu_width = 0;
  This->accu_height = 0;
  This->accu_count = 0;
}