Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/jsm/postprocessing/SSRPass.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ var SSRPass = function ( { renderer, scene, camera, width, height, selects, enco

this.ssrMaterial = new ShaderMaterial( {
defines: Object.assign( {}, SSRShader.defines, {
MAX_STEP: Math.sqrt( this.width * this.width + this.height * this.height ).toFixed(1)
MAX_STEP: Math.sqrt( this.width * this.width + this.height * this.height )
} ),
uniforms: UniformsUtils.clone( SSRShader.uniforms ),
vertexShader: SSRShader.vertexShader,
Expand Down Expand Up @@ -639,7 +639,7 @@ SSRPass.prototype = Object.assign( Object.create( Pass.prototype ), {
this.width = width;
this.height = height;

this.ssrMaterial.defines.MAX_STEP = Math.sqrt( width * width + height * height ).toFixed(1);
this.ssrMaterial.defines.MAX_STEP = Math.sqrt( width * width + height * height );
this.ssrMaterial.needsUpdate = true;
this.beautyRenderTarget.setSize( width, height );
this.prevRenderTarget.setSize( width, height );
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/shaders/SSRShader.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ var SSRShader = {
float totalStep=max(abs(xLen),abs(yLen));
float xSpan=xLen/totalStep;
float ySpan=yLen/totalStep;
for(float i=0.;i<MAX_STEP;i++){
for(float i=0.;i<float(MAX_STEP);i++){
if(i>=totalStep) break;
vec2 xy=vec2(d0.x+i*xSpan,d0.y+i*ySpan);
if(xy.x<0.||xy.x>resolution.x||xy.y<0.||xy.y>resolution.y) break;
Expand Down