-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
PMREMGenerator: Add flipEnvMap. #23158
Conversation
BTW: This issue was earlier reported at the forum. It's good to have the |
Merging for further testing. |
Updated builds: 3843183 |
envMap: cubeRenderTarget2.texture, | ||
combine: THREE.MultiplyOperation, | ||
reflectivity: 1 | ||
roughness: 0, |
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.
I would also recommend using a roughness value > 0 (or several values, or adjustable values). The example only worked before for mirrored reflections; now that it uses actual PMREM, it will also work for other roughness values, so we should demonstrate that to help ensure it does not regress.
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.
varying vec3 vOutputDirection; | ||
|
||
uniform samplerCube envMap; | ||
|
||
void main() { | ||
|
||
gl_FragColor = textureCube( envMap, vec3( - vOutputDirection.x, vOutputDirection.yz ) ); | ||
gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) ); |
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.
❤️
Related issue: #23152
Description
#23152 revealed a small issue in
PMREMGenerator
. When working with cube render targets, the same flip logic for px/nx is required like in the material shaders.