-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
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
Conversation
@@ -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, |
There was a problem hiding this comment.
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 ),
There was a problem hiding this comment.
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^^
There was a problem hiding this comment.
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 ;)
Looks good now! |
Thanks! |
see #13370