Parallax correction from environment Maps

Hello guys,

I’m using the CubeCamera method of three in order to recreate the reflections projected on the objects in my the 3d scene. Once I have the texture from the CubeCamera, I take the texture and then it is applied to the object’s environment map in order to reach a reflection. The thing is that the reflections are not pretty accurate, since that a parallax correction is needed.

Parallax correction info: Image-based Lighting approaches and parallax-corrected cubemap | Sébastien Lagarde

So, I did some research about if this issue was solved in three previously and I found one example from the r107, but this example it is only working if I use this version of three. The example is the following one: js webgl - box projected cubemap environment mapping

My question is, what should I do in order to use something similar to my project in r135?

Thank you so much!

2 Likes

If you or anybody found something, can you please share it here? I’m looking for it too. Thanks in advance

The mentioned example was removed with r132 because the implementation was hard to maintain and more or less a hack. Below is the last working version with r131:

If you need this feature in newer versions, consider to file a feature request at GitHub.

1 Like

BTW: I’ve updated the example here so it works with r137. However, it’s not possible to use the code with a PBR material since they only support the CubeUV format (PMREMGenerator).

I’ve switched over to MeshPhongMaterial: Edit fiddle - JSFiddle - Code Playground

2 Likes

First, let me say that it is an honor for us to be helped by you. Your contribution to this community is unprecedented. There are hundreds of people who work and pay their bills, based on projects that are made in threejs and, in most of them, they are only possible by your answers in this forum.

Thank you again. I tested it out, and it seems to be working. I can’t see the reflections because my cubeCamera is rendering black right now. But I am sure that I will find the issue and let you know if the parallax correction is working properly.

Have a great day!

3 Likes