What does PBRMaterial.forceNormalForward do?

Hey folks,

I am trying to understand what does this function do. And when to use it.

When toggle this func on and off, looks it’s working on face normals?

packages/dev/core/src/Shaders/ShadersInclude/pbrBlockNormalFinal.fx

Not sure if this is the right code for this func.

Please let me know,
Many thanks,
Tawibox

Yes, it is the right code.

It makes sure the normal always points towards the viewer.

I don’t think it’s much different from twoSidedLighting, except that twoSidedLighting has some other impacts than only changing the shading normal.

Also, from the doc on transparency:

@Evgeni_Popov Gotcha.

In my practice i found I need to enable both twoSidedLighting and forceNormalForward to make back face lighting look right. (hdr environment textures) Feel like forceNormalForward can’t completely replace twoSidedLighting at some cases.