Skip to content

Commit 5a3fd8a

Browse files
authored
Update InitCommon.js
1 parent 74a8544 commit 5a3fd8a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

js/InitCommon.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ let apertureChangeSpeed = 1;
3737
let focusDistance = 132.0;
3838
let increaseFocusDist = false;
3939
let decreaseFocusDist = false;
40+
let focusDistanceChangeSpeed = 1;
4041
let pixelRatio = 1.0;
4142
let windowIsBeingResized = false;
4243
let TWO_PI = Math.PI * 2;
@@ -943,14 +944,14 @@ function animate()
943944

944945
if (increaseFocusDist)
945946
{
946-
focusDistance += 1;
947+
focusDistance += (1 * focusDistanceChangeSpeed);
947948
pathTracingUniforms.uFocusDistance.value = focusDistance;
948949
cameraIsMoving = true;
949950
increaseFocusDist = false;
950951
}
951952
if (decreaseFocusDist)
952953
{
953-
focusDistance -= 1;
954+
focusDistance -= (1 * focusDistanceChangeSpeed);
954955
if (focusDistance < 1)
955956
focusDistance = 1;
956957
pathTracingUniforms.uFocusDistance.value = focusDistance;

0 commit comments

Comments
 (0)