Download

DFAO and Two Sided Foliage Shader issue

DFAO (and raytraced AO) occlusion of subsurface in two sided foliage shader seems to be incorrect (inverted) for skylight, can anyone else confirm this?

Plant with two sided foliage shader with base color set to 0 and sub surface set to 1. (normals are not modified)
Just movable skylight, no directional

Two surfaces placed above and below with distance fields enabled


Subsurface is correctly occluded on both sides

Surface above is hidden


Subsurface appears on top side of mesh instead of underside (bottom side is dark)

Surface below is hidden instead


Subsurface appears on underside of mesh instead of top side (top side is dark)

Wouldn’t it be much more likely that your model’s normals are inverted?
check that first within the editor, by opening the mesh and visualizing normals.

Should that be correct. Then maybe a bug report with the sample project is in order.

I can’t say I can reproduce the same issue though. But my project was upgraded and the foliage pre-existing, so who knows.

Normals are definitely correct, here is a sample project with just a plane with the shader if anyone is interested https://we.tl/t-XuxyXtW23t
Either hide or move the floors to compare the lighting

Are you using two-sided distance fields?

I have them on and still not seeing this issue.

Yes, they usually should be on for foliage

That would only effect self occlusion which isn’t relevent, have you tried out my sample project?

haven’t had time to honestly, but I was working on a foliage material yesterday for my project, the leaves are white on top and red below, using a two-sided material on them worked fine. The matching subsurface also worked fine.
I’ll give it a go in a few and update this post.