Search Unity

Resolved Control over normal from height precision

Discussion in 'Shader Graph' started by FOXAcemond, Dec 2, 2020.

  1. FOXAcemond

    FOXAcemond

    Joined:
    Jan 23, 2015
    Posts:
    99
    Hello,

    In my game I have a simple normal map calculation for a pretty small object seen from far away.
    I'm using the normal from height node but I'm getting very pixelated results. I'm guessing it stems from the cost of the operation. But I'd like to have control about the budget I'm spending on the effect.

    It would be nice to have an input for the precision of the node.

    normal.png
     
  2. FOXAcemond

    FOXAcemond

    Joined:
    Jan 23, 2015
    Posts:
    99
    Okay I learned about ddx/ddy. Looks like there is no way around this loss of precision.

    So what I did, since I was generating this texture proceduraly, is to calculate the derivative myself mathematically and then add the noise above as a transformation on the normal vectors. The normals are not perfectly representing the noise but it's not humanly perceptible.
     
    Last edited: Dec 4, 2020