Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Shader compile Texture coordonates issue

Discussion in 'Unity 5 Pre-order Beta' started by Smartwater3D, Nov 2, 2014.

  1. Smartwater3D


    May 16, 2014
    When I compile one of my shader, I get this error:

    // Too many texture interpolators would be used for ForwardBase pass:
    // no lightmaps:
    #ifdef LIGHTMAP_OFF
    struct v2f_surf {
    float4 pos : SV_POSITION;
    fixed3 worldNormal : TEXCOORD0;
    float3 worldPos : TEXCOORD1;
    float4 custompack0 : TEXCOORD2; // bumpTexCoord
    half3 custompack1 : TEXCOORD3; // objSpaceNormal
    half3 custompack2 : TEXCOORD4; // viewVector
    float4 custompack3 : TEXCOORD5; // grabPassPos
    float4 custompack4 : TEXCOORD6; // offset
    float4 lmap : TEXCOORD7;
    fixed3 vlight : TEXCOORD8; // ambient/SH/vertexlights
    Because it is a transparent shader, I don't see why Unity adds:
    Also what is float4 lmap : TEXCOORD7; actually?

    Is there a way to control these texcoords in order to optimize a shader?
    For example with U5, in target 3.0, I have only 3 Textcord left, 7 are used by Unity.
    With Unity 4, the same shader was working fine.