-
Notifications
You must be signed in to change notification settings - Fork 182
/
Bi-Directional_PathTracing.js
48 lines (30 loc) · 1.31 KB
/
Bi-Directional_PathTracing.js
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
// scene/demo-specific variables go here
// called automatically from within initTHREEjs() function (located in InitCommon.js file)
function initSceneData()
{
demoFragmentShaderFileName = 'Bi-Directional_PathTracing_Fragment.glsl';
// scene/demo-specific three.js objects setup goes here
sceneIsDynamic = false;
edgeSharpenSpeed = 0.001;
cameraFlightSpeed = 300;
// pixelRatio is resolution - range: 0.5(half resolution) to 1.0(full resolution)
pixelRatio = mouseControl ? 1.0 : 0.75;
EPS_intersect = 0.01;
// set camera's field of view
worldCamera.fov = 55;
focusDistance = 622.0;
apertureChangeSpeed = 100;
// position and orient camera
cameraControlsObject.position.set(380, 350, 180);
// look slightly to the left
cameraControlsYawObject.rotation.y = 0.2;
// look slightly upward
cameraControlsPitchObject.rotation.x = -0.25;
} // end function initSceneData()
// called automatically from within the animate() function (located in InitCommon.js file)
function updateVariablesAndUniforms()
{
// INFO
cameraInfoElement.innerHTML = "FOV: " + worldCamera.fov + " / Aperture: " + apertureSize.toFixed(2) + " / FocusDistance: " + focusDistance + "<br>" + "Samples: " + sampleCounter;
} // end function updateUniforms()
init(); // init app and start animating