I have a PBRMaterial with disableLighting=true, I expect this surface to be unlit but it is still receiving illumination from the scene environment texture.
How do I achieve a true unlit material? (I prefer to stick with PBRMaterial for this usecase as later I may need to turn lighting back on and dont want to switch out materials)
Something like this should work:
sphere.material.environmentIntensity = 0;
Using the new scene.iblIntensity
may be better, as it only deals with IBL intensity (whereas environmentIntensity
is more a debug option which impacts other sources of lighting), even if in this case the result is the same.
Note that we also have a PBRMaterial.unlit
property, which uses the albedo color as the material color: disableLighting=true
+ scene.iblIntensity = 0
will simply render a black object, as there’s no lighting anymore.
To reinforce what stated above, disableLighting disables analytical lights like point, directional spot and hemispheric whereas if you want no lighting at all, you want to use pbr.unlit = true.