Search Unity

Question What is the space of the terrain normal map?

Discussion in 'World Building' started by joshuacwilde, Jan 19, 2021.

  1. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731
    I am trying to use the terrain normal map in a shader to calculate the world space normal of the terrain at a position. It seems whatever I do, there is some discrepancy and I am not able to correctly calculate the world space normal. I was thinking I could just do normalTex * 2 - 1; but that does not work, although from looking at the normal map, it appears it should. Anyone know what space the terrain normal map is in? Or how I can convert it to world space? I would really appreciate some help here.
     
  2. joshuacwilde

    joshuacwilde

    Joined:
    Feb 4, 2018
    Posts:
    731
    nvm, turns out it was just some mistakes with multiplying matrices in the shader