I am having difficulty on using reflection probes in the scene with a 3D model. As you see in the scene, a sphere and a car is added. They both have PBR materials and the reflective texture is of reflection probe. The problem is shown in images below:
Here the sphere looks all over the car.
Here, the sphere is exactly opposite to the car but still gets reflected infront of the car which should not happen.
How do I fix these errors? It is obvious that I am not placing the probe in right position and I cannot even see the probe node in the inspector window. So how can I manually place it?
This is really strange, I am having a look ASAP.
Here it is : https://playground.babylonjs.com/#X9NWXA#1 the position is a bit different due to the right handed system used by gltf.
Hey @sebavan, thanks a lot! How did you come to that conclusion and how were you able to position the reflection probe? Since reflection probe does not show up as a node in the inspector window.
Also another question regarding render list for reflection probe:
Why am I not able to get the car in the scene on reflection probe? Even though it has PBR Shader on the exterior of the car. And I am also trying to add node into the render list.
I have checked all 6 axis of the image yet there is no car visible.
You must wait for the objects to be loaded before adding them to the probe list, else you will get null pointers.
Also, you can’t use a texture in read mode while you are writing to it. That’s what happens if you put the car in the probe render list, as the car is using the probe texture as its reflection texture and the probe texture is the one written to by the probe. If you do that you get:
What you can do is generating the probe texture with the car in the probe list but without setting this texture as the reflection texture, then stop generating the probe texture and assign the cube texture to the reflection texture of the car:
Note that I used
probe.cubeTexture._shouldRender = () => false; to stop the probe from generating the texture instead of simply
probe.refreshRate = 0 because this latter call will still generate one rendering and we don’t want that. Also, as the cube texture is not linked to any material anymore when rendering the probe, we need to manually add it to the list of the render targets that must be generated (