Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Planar mapping, how to do this correctly.

Discussion in 'Shaders' started by snacktime, Jul 2, 2019.

  1. snacktime

    snacktime

    Joined:
    Apr 15, 2013
    Posts:
    2,919
    I'm using a very simple planar mapped surface shader. It's providing the look I want, which is a softer low poly style. I emphatically do not want the more typical triplanar shading, the soft blending of colors over edges with less distinct edges is what we are going for.

    The important part of the shader is this:
    Code (csharp):
    1.  
    2. float2 uv = IN.worldPos.xz;
    3. fixed4 c = tex2D(_MainTex, uv * (1.0f / _Scale)) * _Color;
    4.  
    This does produce a few artifacts, but the thing is they mostly work in our favor. But sometimes not, like at certain distances you can see noticable banding and blotching at times, how noticeable is dependent on the texture and color distribution.

    So what would be the best approach here?


    upload_2019-7-2_14-19-17.png
     
  2. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,445
    So, where do we see the actual problem?
     
  3. Mutimir

    Mutimir

    Joined:
    Dec 6, 2018
    Posts:
    23
    As jvo3dc sad its hard to tell when we dont see the problem on the image. The color banding can probably be solved applying some dither screen overlay effect. As for blotching there is no way to tell.
     
unityunity