Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

2 sided height map issue

Discussion in 'Shaders' started by tawdry, Sep 22, 2015.

  1. tawdry

    tawdry

    Joined:
    Sep 3, 2014
    Posts:
    1,356
    Hi
    i am using a heightmap on a 2 sided shader on the outside it looks fine(outside faces) but inside it is a mess are height maps only feasable with single sided shaders?
     
  2. Piflik

    Piflik

    Joined:
    Sep 11, 2011
    Posts:
    289
    Screenshot of the problem would be helpful...

    One Problem with 2-sided shaders: they are always going to produce wrong lighting on the backfacing sides of the mesh. The back will always have the same shading as the front (because it doesn't have its own vertex normals). If you want consistent shading, you will need to actually have a two-sided mesh.

    But witout further information I don't know if that is the issue you encountered.
     
  3. Dolkar

    Dolkar

    Joined:
    Jun 8, 2013
    Posts:
    576
    Actually, if you define the "VFACE" pixel shader input semantic, you can use that value to check to which side the pixel belongs and flip the normals accordingly. I don't know if it's possible to use that in surface shaders, though.