Search Unity

Texture tiling not working for some shader

Discussion in 'Shaders' started by andersonsilva, Aug 28, 2014.

  1. andersonsilva

    andersonsilva

    Joined:
    Jul 29, 2013
    Posts:
    10
    Tiling is not working in Standard Assets Water (Basic) shader "FX/Water (simple)".
    when i change the tiling value, nothing happens. but when I switch to other shader such as diffuse, tiling starts working again.

    I tried to simplify the shader to this, but tiling still doesn't work:
    Shader"FX/Water (simple)" {
    Properties {
    _MainTex ("Fallbacktexture", 2D) = "" { }
    }
    //singletexture
    Subshader {
    Tags { "RenderType"="Opaque" }
    Pass {
    Color (0.5,0.5,0.5,0)
    SetTexture [_MainTex] {
    Matrix [_WaveMatrix]
    combinetexture, primary
    }
    }
    }

    }
    }
    }


    am i missing anything?
     
  2. jvo3dc

    jvo3dc

    Joined:
    Oct 11, 2013
    Posts:
    1,520
    Well, the _MainTex texture is using the _WaveMatrix matrix for the tiling, so the tiling values of the _MainTex texture are not used. With a shader that is not fixed pipeline, it would be easy to combine both tiling matrices. It might even fit in a fixed pipeline shader.
     
  3. andersonsilva

    andersonsilva

    Joined:
    Jul 29, 2013
    Posts:
    10
    Thanks! I found that TRANSFORM_TEX solves the problem!