Two-sided shading (NOT backfacing) - for animation

Question Materials and Textures

I have a case where it would be very helpful to shade a plane (which is animated) on both sides, differently. I would like the behavior to be very similar to when "Face orientation" is enabled, but using 2 real materials in place of red and blue.

I have found dozens of tutorials, which all seem to say "use Geometry:backfacing". That does NOT seem to give the behavior I want. I want the shading to correlate to the mesh geometry, independent of relation to camera or world. Blender obviously has this information internally (since "Face orientation" works). Is the same information available, directly or indirectly, in a shader? I have tried lots of parameter processing with no luck - there are too many combinations.

Of course it is possible to replace a plane with a "really thin cube" and assign different materials on opposite faces. This is messy and inconvenient in my situation, but is available as a last resort. Maybe it's a weird case and an elegant solution just isn't worthwhile.

I'm working through the "Fundamentals of Blender Materials and Shading" course, but looking ahead, it doesn't seem to be covered (probably too advanced?).

Or maybe I have just missed something basic? Thanks in advance.

  • spikeyxxx replied

    Backfacing works (even in Eevee, I checked):

    Backfacing.png

    I don't know why you can't use it.

  • techworker1 replied

    Thanks spikeyxxx .  I guess I was having 2 problems.

    • All the experiments in the current project had corrupted my meshes. I need to re-create them cleanly from scratch, and try it all again.
    • In previous projects I seemed to see that the "facing" was always computed camera-relative and didn't work with my animation. I must have been mistaken and it really isn't so. Maybe I was trying to use Normal-Z (from Texture Coordinate) instead of Backfacing.
    1 love
  • spikeyxxx replied

    As far as I know, Geometry > Incoming is the only one that is view dependent (and Texture Coordinates > Camera).

    Also remember that the Viewport might not be fast enough. Try to actually Render the Animation.

  • techworker1 replied

    After a lot of re-do, Backfacing is working for me now.  Debatable if all the effort was worth it.


    1 love