Reflection Probes with Node Material PBRMetallicRoughness?

Hi. The documentation about reflection probes doesn’t mention how to use reflection probes with node material with PBRMetallicRoughness.
Is it supported yet and if it is then how? Thanks.

You can set the reflection probe texture to pbrMetallicRoughness.environmentTexture and it should work :slight_smile:

1 Like

I’m not sure what you mean with pbrMetallicRoughness.environmentTexture because I couldn’t find that from pbrMetallicRoughness block or anywhere else than scene.environmentTexture and setting to that didn’t work. No errors, it just doesn’t show the texture. Here in the playground I tested by setting ReflectionBlock.texture = probe.cubeTexture , same thing , nothing happens. From node material editor I can see that it didn’t load the texture for some reason. Works fine with BABYLON.PBRMaterial (comment out lines 203-205)
Babylon.js Playground

pinging @sebavan

Adding @Evgeni_Popov our PBR Node Hero

When using the PBRMaterial, some magic is done for you when you bind a render target texture to the reflection slot. When using a node material there’s no such magic, so you have to do it yourself :slight_smile:

Namely, you need to instruct the system that the render target of the probe should be generated by doing:

scene.customRenderTargets.push(probe.cubeTexture);

https://playground.babylonjs.com/#M2RLFD#4

1 Like

Perfect! Thank you very much :smiley: :+1:!