Page 1 of 1

Backface shading question

PostPosted: Sun Jan 07, 2018 6:03 pm
by dg06113
Hi!

Im doing a shader for plants etc.

Now i have a single sided mesh with culling turned off. But then the backside shades the same as the frontside, Being lit although its facing away from the light.

Is there anyway for the backside of the face to shade correctly or do i need to double the geometry and invert the normals? I really hope i dont need to:-(

Thanks!

Re: Backface shading question

PostPosted: Mon Jan 08, 2018 10:24 am
by Amplify_Borba
Hello dg06113, thank you for getting in touch!

Cull set to off disables culling, producing a double-sided material, however light is still calculated according to the normal of the mesh's face and, as result, it will not render correctly for the back face, which is the expected behavior.

There are a few ways to work out this situation, the simplest one by using our Switch by Face node to provide different inputs for when each face is facing the camera, or the Face node which outputs a positive or negative value if the rendered surface is facing the camera.

These nodes indicate whether you are rendering front or back faces, however, the best way for dealing with this is by using two separate passes, one for rendering front faces and another one for back faces. Unfortunately, we are still unable to create multi-passes with ASE as it is a feature that is still under development and should be added in the near future.

Please let us know if this information was helpful and if you have any further questions, thanks!