No announcement yet.

two-sided material with custom vertex normals?

  • Filter
  • Time
  • Show
Clear All
new posts

    two-sided material with custom vertex normals?

    Hey y'all: so I feel like I'm maybe missing a check-box somewhere...? I'm wondering how people use custom vertex normals with two-sided materials, since by default it flips the backside normal. Ergo, if you're projecting the normals from a flat plane or sphere or whatever onto your grass (a pretty common practice), the backsides will light upside-down. Is there a way to get it to not flip the normals on the backside of the material?

    One (kind of ******) work-around I was playing with, was to just use world-space normals instead of tangent space. Works ok: you can just convert your tangent space normals into world at the very end, but it seems to mess up normal combination, plus I can envision plenty of scenarios where artists might want a more nuanced base direction than just going straight up in world space.

    images attached: custom-projected vertex normals in Maya, and how they're interpreted on a two-sided material in the Unreal world space normal buffer.

    edit: someone suggested multiplying the backside faces (masked via two-sided sign) by -1, which actually does work (!), but a couple of things: for one, I'm not sure I understand why that would work...? As I understand it, that's still just generating a tangent space normal (but with -1 in blue), so I'm not sure why it would have such an effect on the vertex normals...? Or what is even happening there? Also, it seems to break world-aligned blending in a confusing way.