hi guys i have this simple shader wherein i want to displace the vertices but i get the error “” on line 23.Cud somebody point out wat i’m doing wrong?
another side question…
do i need uniform float4 _MainTex_ST;?
wat is that for?i actually copied my code from another shader and went on removing unwanted stuff.the above variable was not getting used even in that shader but with a lot of things happening behind the curtains in shaderlab i didnt want to remove this 1
Have you read the responses in your other topic? Really, you need to read the shaderlab docs. That code’s not even Cg; there’s no way it will come close to working.
Basically, like someone replied in another thread, inside of shaders you don’t have access to .NET calls (so no Time.time or Mathf.Sin there). Cg has a built-in function to calculate sine (“sin”). Time value can either be passed manually from your script, or you can use _Time built-in variable.
If you don’t use it in the shader, then you don’t need it. Variables ending with _ST are used by built-in Unity shaders to apply texture’s tiling offset values. As your shader does not use textures, there’s no tiling&offset to apply.
hey i lost track of that post for some reason and i checked it only after reading this 1.i apologize for that
well i did search for shaderlab docs but cudnt find 1 proper 1.do have any link where i cud find 1?i know cg but using it along with shaderlab has me confused and i feel like u cud combine the features for more powerful shaders.but yeah a shaderlab doc will definitely help as i’m totally new to it.
Thx