Hi there,
Currently when using an image background (in this case generated with PMREMGenerator) it seems that producing a PMREM using PREMGenerator's fromScene
will result in a mirroring of the scene's background in the resulting Envmap.
It's easier to show than explain, so here's an example:
https://jsfiddle.net/BruOps/e9obh3np/9/
Click the "Update PMREM" button so see what I mean. You'll see the sky flip on the models.
N/A
I can confirm the issue.
@elalish Maybe a problem in _sceneToCubeUV()
?
I think this has to do with the fact that scene.scale.z *= - 1
doesn't affect the way the background is rendered, so the expected behavior fails. The objects in the scene are rendered correctly, but not the scene background.
Any reason why we're using a left-handed coordinate system @elalish ? Wouldn't it be easier if we kept things consistent with three.js coordinate system?
@sciecode Well, I wouldn't say it's intentionally left-handed, though I'll say I was a tad confused as to whether we were thinking in terms of PNG pixel ordering or OpenGL (flipY). That scale.z *= -1
was definitely a dirty hack to get it work. I imagine this is also related to @WestLangley 's comment.
All this to say, I'd be all for making it work better and more consistently. I don't have the bandwidth for it right now, but I'd be happy to review a PR. I consider the format of cubeUV to be an implementation detail, so I think it's fine to change as long as the output works.
I see what you mean, I'll try to give it a closer look and see if we can do something about that. But I imagine it might be necessary to make changes to the cubeUV format implementation.
I believe @WestLangley had a few ideas regarding the orientation and indexing of each face, perhaps he might give us some ideas as to how we may approach this.
Just to confirm: https://jsfiddle.net/rvbwna14/ 馃槃
Most helpful comment
Just to confirm: https://jsfiddle.net/rvbwna14/ 馃槃