Skip to content

Commit

Permalink
Update PathTracingCommon.js
Browse files Browse the repository at this point in the history
  • Loading branch information
erichlof authored May 22, 2024
1 parent 1eb9aae commit aac7e1e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/PathTracingCommon.js
Original file line number Diff line number Diff line change
Expand Up @@ -2934,7 +2934,7 @@ float rand()
{
// ensure randNumber keeps evolving (even when called multiple times during the same animation Frame),
// by adding to itself the blueNoise texture lookup (which does not change), and FrameCounter multiplied with Golden Ratio
randNumber += (blueNoise + (uFrameCounter * 0.61803399));
randNumber += (blueNoise + (mod(uFrameCounter, 32.0) * 0.61803399));
return fract(randNumber); // we only want the fractional portion, so [0.0 to 1.0) (but not including 1.0)
}
Expand Down Expand Up @@ -3118,11 +3118,11 @@ void main( void )
seed = uvec2(uFrameCounter, uFrameCounter + 1.0) * uvec2(gl_FragCoord);
// initialize rand() variables
randNumber = 0.0; // the final randomly-generated number (range: 0.0 to 1.0)
blueNoise = texelFetch(tBlueNoiseTexture, ivec2(mod(floor(gl_FragCoord.xy), 256.0)), 0).r;
blueNoise = texelFetch(tBlueNoiseTexture, ivec2(mod(floor(gl_FragCoord.xy), 128.0)), 0).r;
vec2 pixelOffset;
if (uSampleCounter < 100.0)
if (uSampleCounter < 50.0)
{
pixelOffset = vec2( tentFilter(rand()), tentFilter(rand()) );
pixelOffset *= uCameraIsMoving ? 0.5 : 1.0;
Expand Down

0 comments on commit aac7e1e

Please sign in to comment.