Skip to content

Conversation

@jsantell
Copy link
Contributor

@jsantell jsantell commented Nov 22, 2018

Fixes #15301.

This is a straight forward solution but when checking different roughness values, it appears that the flipping is reversed in some mipmaps, but not sure where that's occurring in the code.

(the red circle should be on the left, yellow on the right, it's correct at roughness: 0 and several other times it appears)

flipped

As a quick test, flipping the X in the PMREMCubeUVPacker's frag color worked across all roughness values, but this seems that the fix is better off in the PMREMGenerator.

Thoughts?

@mrdoob
Copy link
Owner

mrdoob commented Nov 25, 2018

/ping @spidersharma03 @bhouston @WestLangley

@mrdoob mrdoob added this to the r99 milestone Nov 25, 2018
@bhouston
Copy link
Contributor

bhouston commented Nov 26, 2018 via email

@jsantell
Copy link
Contributor Author

jsantell commented Nov 26, 2018

@bhouston my understanding is CubeTextures require a flip and WebGLRenderTargetCubes do not -- the PMREMGenerator assumes CubeTextures, so the flip is built in somewhere, and the places I've tried to handle this flip in this PR resulted in inconsistent flipping through the convolution layers (gif in OP) or only handled in the UV packer (which will work most of the time, but it should also have correct flip in the generator)

@jsantell
Copy link
Contributor Author

jsantell commented Nov 27, 2018

Found the issue! The flip should only occur on the first LOD pass (which is currently handled, but only for CubeTexture). Changed queryScale to tFlip to be in line with other instances in three where a tFlip occurs, and now appropriately handle when receiving a texture from a WebGLRenderTargetCube. Updated PR -- this can be tested on the webgl_materials_envmap_exr.html (easier if changed to a SphereBufferGeometry) example just landed in #15299 (and webgl_materials_envmap_hdr.html to confirm CubeTexture PMREMs still work)

@mrdoob mrdoob merged commit a229ffd into mrdoob:dev Nov 27, 2018
@mrdoob
Copy link
Owner

mrdoob commented Nov 27, 2018

Thanks!

@jsantell jsantell deleted the 15301 branch November 27, 2018 23:53
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.

PMREMGenerator flips the X axis when receiving a non CubeTexture

3 participants