Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SAOPass: Fix use of multiple instances #13399

Merged
merged 2 commits into from
Feb 24, 2018
Merged

SAOPass: Fix use of multiple instances #13399

merged 2 commits into from
Feb 24, 2018

Conversation

cnspaha
Copy link
Contributor

@cnspaha cnspaha commented Feb 22, 2018

see #13370

@cnspaha
Copy link
Contributor Author

cnspaha commented Feb 22, 2018

/ping @Mugen87 @mrdoob

@@ -74,7 +74,12 @@ THREE.SAOPass = function ( scene, camera, depthTexture, useNormals, resolution )

}

this.saoMaterial = new THREE.ShaderMaterial( THREE.SAOShader );
this.saoMaterial = new THREE.ShaderMaterial( {
defines: THREE.SAOShader.defines,
Copy link
Collaborator

@Mugen87 Mugen87 Feb 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As i said in #13370 (comment), it is also necessary to clone the defines object because the respective values can differ from pass to pass. If you would use different camera types (perspective vs. orthographic) in your two scenes, it would be a problem. The following code should fix it:

defines: Object.assign( {}, THREE.SAOShader.defines ),

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, thought your code was already the complete one^^

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inserted the line of code ;)

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 22, 2018

Looks good now!

@mrdoob mrdoob added this to the r91 milestone Feb 24, 2018
@mrdoob mrdoob merged commit cee6a73 into mrdoob:dev Feb 24, 2018
@mrdoob
Copy link
Owner

mrdoob commented Feb 24, 2018

Thanks!

@cnspaha cnspaha deleted the patch-4 branch February 26, 2018 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants