4
2016
Shader error: cannot map expression to vertex shader instruction
Had a strange looking error today:
Shader error in 'Custom/WhatAFineShader': cannot map expression to vertex shader instruction set at line 60 (on d3d9)
Turns out it was just that the function which was called inside vertex shader, was below the vertex shader,
so just moved it above the v2f vert (appdata v) and it works..
*Actually it was more complicated:
This one gives error: (maybe because noise is reserved word)
v2f vert (appdata v)
{
v2f o;
float var = noise(float2(0,0));
o.vertex = mul(UNITY_MATRIX_MVP, v.vertex+var);
return o;
}
float noise(float2 xy)
{
return 0;
}
This one doesn’t
float noise(float2 xy)
{
return 0;
}
v2f vert (appdata v)
{
v2f o;
float var = noise(float2(0,0));
o.vertex = mul(UNITY_MATRIX_MVP, v.vertex+var);
return o;
}
Related Posts
Leave a comment
Recent posts
- Adding Real World Location to Ice Fishing Prototype
- [web tool] Image Channel Inspector : AlphaScope
- Editor Tool: Smart Recompile (don’t recompile if edit comments)
- Editor Tool: Scene Size Analyzer
- LudumDare 60: Old Tech
- uBasic Scripting Language for Unity
- GreaseMonkey+Editor Plugin: 1-Click Copy script from ChatGPT (Web) to Unity Editor (as script)
- Editor Tool: Property Watcher
- .unityignore : Hide files from Project window
- PostBuild Script to Create Single exe Standalone File
- Game Loop Designer
- Favorites in PackageManager
Recent Comments
Coin:
CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS
An article by











