Search Unity

Insufficient Resources

Discussion in 'Shaders' started by poolts, Aug 1, 2013.

  1. poolts

    poolts

    Joined:
    Aug 9, 2012
    Posts:
    113
    Can't work out how to solve the following error. I get that the TEXCOORD problem is coming around from exceeding the maximum of 8 texcoords. However, without the following lines (see below) the Input struct works fine, so I'm guessing the compiled code is creating an extra texcoord or resource in the code below. If I uncomment these lines the shader has enough resources to compile and display. Any ideas how to fix this?

    The shader I'm using is a modified version of the BumpSpecProbe shader by Zomby138 (which can be found here). Basically the same shader with an added decal texture.

    Any help would be great :)

    Cheers. Alex.

    P.S. Using shader model 3, Unity 4.2

    Errors:

    Program 'frag_surf', input semantic attribute "TEXCOORD" has too big of a numeric index ( 8 ) at line 193
    Program 'vert_surf', cannot locate suitable resource to bind parameter "_ShadowCoord" at line 193


    Code Snippet:

    This is the code breaking the shader, everything else works fine.

    Code (csharp):
    1.                 o.Normal = normalize(o.Normal);
    2.                 fixed3 worldN = WorldNormalVector(IN, o.Normal);
    3.                 fixed3 worldR = normalize(WorldReflectionVector(IN, o.Normal));
    4.                 float3 fProbeSpecCol = ShadeSH9(float4(worldR,1.0));
    5.                 float fProbeSpecMask = pow(max(_ProbeSpecStr*(length(fProbeSpecCol)-_ProbeSpecSub Fresnel0*2),0),_ProbeShininess+Fresnel0);
    6.                 o.Emission = o.Albedo*ShadeSH9(float4(worldN,1.0)) + o.Gloss*fProbeSpecCol*fProbeSpecMask;
     
  2. Pixeldamage

    Pixeldamage

    Joined:
    Sep 6, 2010
    Posts:
    52
    Last edited: Aug 1, 2013