undeclared identifier '_MainTex_ST'

I’m getting this error in a shader that worked fine in 5.5 and 5.6. Anyone have any idea what might have changed?

Shader error in ‘Hidden/PrismEffectsSecondary’: undeclared identifier ‘_MainTex_ST’ ‘UnityStereoScreenSpaceUVAdjustInternal’: cannot implicitly convert from ‘float2’ to ‘float4’ at Assets/Plugins/PRISM/Shaders/Prism.cginc(549) (on d3d11)

Compiling Vertex program
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP

In my own custom sprite shaders this is something that TRANSFORM_TEX function needs. It’s a utility function for extracting sprite UVs I think. I just add this before the vertex shader everything seems to work:

float4 _MainTex_ST;

7 Likes

Hi,

I can’t think of anything off the top of my head, is it possible to post the shader code, or simple reproduction steps?

We have made changes to texture samplers, but only added the ability to reuse them, this shouldn’t have affected anything though. Without seeing the shader code I cannot give you much more information right now.

Cheers,
Andre