Search Unity

  1. The 2022.1 beta is now available for testing. To find out what's new, have a look at our 2022.1 beta blog post.
    Dismiss Notice

How to render front and back the same? (Render Face = both)

Discussion in 'Universal Render Pipeline' started by DennisWardAltair, Apr 6, 2020.

  1. DennisWardAltair

    DennisWardAltair

    Joined:
    Apr 4, 2019
    Posts:
    27
    I have a generated mesh from a CAE analysis result I'm rendering that is made up of sheet metal that I'd like to render both back and front faces the same (as I have done with OpenGL in the past by enabling two-sided lighting and disabling backface culling).

    I was hopeful that specifying "Render Face = both" would do the trick, but the appearance of the back face is darker and not what I expected. My goal is to have both the front and back faces render the same.

    I'm using URP/Lit mesh material, and the images below show the model with Render Face set to both, front, then back. I am hoping that I can somehow find the setting that will allow me to show all polygons as seen in the front image, regardless of their facing direction.

    Thanks, Dennis

    Here's the screenshots:

    Both:


    Front:


    Back:
     
  2. alexxUID

    alexxUID

    Joined:
    Jan 14, 2020
    Posts:
    23
    Have you found a solution for this in URP?
    It seems to me HDRP does is correctly but not URP.
     
  3. DennisWardAltair

    DennisWardAltair

    Joined:
    Apr 4, 2019
    Posts:
    27
    I ended up writing a shader to flip back-facing normals in URP. I made a FFNormal subgraph:

    ffnormal.png

    I used it in my shader as follows:

    surface.png

    If you find a better way, please let me know!

    Thanks, Dennis
     
    alexxUID likes this.
  4. alexxUID

    alexxUID

    Joined:
    Jan 14, 2020
    Posts:
    23
    Sorry for the late reply - had no notification on.
    Thanks for that, that is at least some help although does not solve all my problems, since I need a transparent object as well and not just a hard surface.
    I am really confused how this is a problem at all. Is it so uncommon to use double sided stuff? Or are we doing something completely wrong?

    Thanks again,

    Alex
     
  5. DennisWardAltair

    DennisWardAltair

    Joined:
    Apr 4, 2019
    Posts:
    27
    No problem. I was able to also do alpha, but used a variation of this shader (Surface="transparent") and set the alpha value. Other than that, the graph was pretty much the same.
     
unityunity