This isn’t how most other renderers do transmission, and it looks very different from three.js when the scene is lit with only a punctual light.
Is this the correct behavior or a bug?
The photos are from 3d sandboxes that my team has built in three.js and babylon.js.
I realize Babylon isn’t doing shadows on transparent meshes (please ignore, I forgot to enable the flag to do it)
Link to the sandboxes:
As reported: Load any GLTF with transmission, add light, add envmap, then set intensity to 0 and the bug appears. @sebavan
We use transmission a lot so any time there’s a transmission bug we’re going to run into it . I think this is #3. Took me a while to figure out why certain scenes looked wrong though.
In babylon, environmentIntensity is used to control ALL environment lights e.g. reflection/refraction. So by dimming it to 0 both reflection and refraction are dropping accordingly which works as intended.
It seems confusing as we do not see the point light through the material but in case of transmission, a render target is used to create a refraction texture, and the refraction is then dimmed to 0.
in case you ONLY want to drop the reflection part, you could play with this knob instead:
@sebavan I don’t know if I should make another thread for this now. But setting level still doesn’t seem to look the same as three.js with the envmapIntensity turned to 0.
Is there a way to do this same thing in babylon that just removes the envmap from the lighting without affecting other things?
That’s exactly what we wanted to do. Though I wish there was a way to do it only for the influence of the environmental map, because while we don’t use other types of reflection in this example, it seems like the solution would also change other reflection intensity such as mirrors or reflection probes.
If we ever implement other types of reflection, it seems like I’ll have to come up with another way to do this. (maybe by altering the texture itself)
This has been a lesson for me in the design of Babylon renderer. I owe you a pizza @sebavan; thank you sincerely.
No problem, glad it help. To do it only from the texture influence, I guess it would need to both scale the texture level as well as the associated harmonics values