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!
Backface shading question
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Backface shading question
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!
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!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!