Problem:
The backface is not dark, despite it is in the shadow:
My setup:
- Create new scene
- Rotate directional light 140,-30,0
- Add 2 planes, one is rotated by 90,0,0 (so we look through it transparent backface initially)
- Create a simple shader graph to just output vertex color and set its render face to both
- Create material and assign it to a plane
- The result is like on the first picture
Question:
How can I display front- and backfaces correctly in my setuf?
What I’ve tried:
I can fix it by using 2 materials: one for only front and other for only backface. In shader graph for backface I simply take normal vector and multiply it by -1. The end result is expected:
This fix very quickly become very tedious: every gameobject require 2 new materials and 2 shader graphs and rendering 2 materials is obviously affecting performance.
I tried to use “Is Front Face” node in my shader graph rendering both faces, but then I can’t connect branch output to a vertex normal. I guess it’s due to it’s require “Fragment Shader Stage”. I am not sure what’s this, does it means I can’t use it to deal with normals?
I wonder if my screnario, to render backfaces with vertex colors is so damn rare, that I just can’t find anything in regards.