Page 1 of 1

Double Sided - Flip backface normals

PostPosted: Wed Apr 03, 2019 5:51 pm
by NicolasD
Hello,

I'm making a double-sided shader and I want to flip the normals of the backfaces in order to have a correct lighting.
I'm aware of the Switch by face and Face nodes but I can't feed them to the Local Vertex Normal ports (console info : doesn't work properly with Vertex ports).

I'm wondering if there's another way to flip the normals of the backfaces ?

Nicolas

Re: Double Sided - Flip backface normals

PostPosted: Fri Apr 05, 2019 10:48 am
by Amplify_Borba
Hello, you can invert the Vertex Nomals as per the example below:

Image

Re: Double Sided - Flip backface normals

PostPosted: Fri Apr 05, 2019 7:01 pm
by NicolasD
Thank you for you anwser.

However my question wasn't how I can invert the normals of a shader with Cull mode = on, but how I can invert the normals of the backfaces created by a shader with the Cull mode = off while keeping the normals of the frontfaces unchanged.

Re: Double Sided - Flip backface normals

PostPosted: Tue Apr 09, 2019 1:56 pm
by Amplify_Borba
Apologies for not understanding at first, in that situation you'll have to manually handle the trigonometry through a dot between the view dir and world normal, here's a simple example:

Image

Please note that this setup should work with the vertex offset / normal ports.