Preview of URP Ground Truth Ambient Occlusion (GTAO)

I’m afraid I don’t have a complete shader with all features of the Lit shader and flipped/mirrored normals to share, but I recently posted this branchless solution for mirroring normals in shader graph: Grass normals shader graph - #5 by Sam3million

A minor issue I don’t know how to solve in the shader is that shadow artifacts can appear on backfaces if the shadow normal bias in the URP settings or the light source is too high. I have only tested this in 2022.3, not 6.x, so I don’t know if there is any difference. Also this solution will not work in older versions than 2022.x, because you could not use the “Is Front Face” node as a number before that, only as a boolean, so you had to use branching.

Edit: Here are two solutions with Branching, the first one is the same as mine above (I think I originally based it on this one), but with branching, and the second one allegedly replicates the “Flip” setting in the HDRP Lit shader, but I haven’t checked it myself: Shader graph + LWRP, can't use flipped normals?

Of course, in 2022.x and later it can easily be changed into a branchless version.

However, in many cases it can make more sense to use duplicated (and flipped) geometry instead of using a custom double-sided shader.

1 Like