Search Unity

[Unity 5] Light lose resolution

Discussion in 'General Graphics' started by KaOzz, May 4, 2016.

  1. KaOzz

    KaOzz

    Joined:
    Oct 15, 2012
    Posts:
    82
    Hi there, Im having a problem with a spotlight that lose gradually his resolution when are moved far from his starting point.

    Look at the image. In the first, im near the starting scene point. In the second, I travel 1000 Unity units far from the starting point, and now the spotlight shows like low res.
    If I travel back to the starting point, the light return to look good.

    This captures are from android build, running on Samsung Nexus 10 tablet. On Unity editor the graphics looks good.

    lightissue.jpg

    For the scenary (streets), I'm using this custom shader modified by me. I think the problem may be here.

    Code (CSharp):
    1. Shader "MobileConPixelLight" {
    2.     Properties{
    3.         _MainTex("Base (RGB)", 2D) = "white" {}
    4.     }
    5.         SubShader{
    6.         Tags{ "RenderType" = "Opaque" }
    7.         LOD 200
    8.  
    9.         CGPROGRAM
    10. #pragma surface surf Lambert
    11.  
    12.         sampler2D _MainTex;
    13.  
    14.     struct Input {
    15.         float2 uv_MainTex;
    16.     };
    17.  
    18.     void surf(Input IN, inout SurfaceOutput o) {
    19.         fixed4 c = tex2D(_MainTex, IN.uv_MainTex);
    20.         o.Albedo = c.rgb;
    21.         o.Alpha = c.a;
    22.     }
    23.     ENDCG
    24.     }
    25.  
    26.         Fallback "Diffuse"
    27. }
    28.  
    Any clue? Thanks.
     
    Last edited: May 4, 2016
  2. KhaledM

    KhaledM

    Joined:
    Sep 29, 2013
    Posts:
    41
    I am having the same issue, did you manage to fix it?
     
  3. mbowen89

    mbowen89

    Joined:
    Jan 21, 2013
    Posts:
    639
    Looks like the first one is doing pixel lighting and the second is possibly vertex lighting?