- Home /
Question by
Kailas · Feb 10, 2012 at 12:25 PM ·
shaderuvtypesurface shader
Simple Shader Syntax ... or so I thought
The following shader code throws an error.
void SurfaceProgram(Input IN, inout SurfaceOutput OUT)
{
//OUT.Alpha = 1;//This works fine
OUT.Alpha = IN.uv_textureName.x;
}
The error is: "Program 'frag_SurfaceProgram', assignment of incompatible types"
I believe that it is because unity treats uvs differently from normal floats (or a half in the case of SurfaceOutput.Alpha).
Is there any way of telling unity to treat them as normal variables? Some sort of cast or #pragma maybe?
Comment
Your answer
Follow this Question
Related Questions
Folded UV's results in difference in shading of normals? 0 Answers
uv array and surface shader? 0 Answers
Is there a way to merge 2D tiles into one mesh? 0 Answers
Shader that renders fragment behind 0 Answers
uv.xyz in a surface shader? 2 Answers