Greeting everyone.
I am trying to follow the Cg Tutorial from nvidia's developer site to get familiar with shaders, and I am also consulting the porting tips from the wiki here:
[http://wiki.unity3d.com/index.php/Cg_Tutorial_to_Unity][1]
Now I am trying to re-create the shader from example "C3E5_DoubleVision".
At first I tried following only the cg tutorial from nvidia's site and correcting my errors alone. When it was all ready, with no compile errors i got this one:
"***Shader error in 'Custom/doubleTexture': Parse error: syntax error at line 1049***"
This Error appears in the compiled shader file it seems and said line reads:
`SetTexture 0 [$_mainTex] 2D 0`
I could not find what's wrong so I tried making a new shader file named test and copying the example as it was from the wiki.
Same Error happens (although the compiled shader has less lines because that code doesn't #include "UnityCG.cginc" like mine does, so the error occures in line 799 of the compiled shader).
Also, if I select any of the shader file, in the inspector this message appears:
> ***Shader has Errors or is not supported by your graphics cards***.
Any Ideas why that is? My graphics card is quite new so I doubt it doesn't support some shader model...
Could it have something to do with vertex/fragment profiles mentioned in the cg tutorial? and If so what can i do in unity to set a profile?
Or could it be sometihng else entirely?
Thank you very much in advanced.
[EDIT:]
I also tried to implement the fix for older GPUs, using two texture units instead of one (in case my gpu did not indeed support the shader), from Cg tutorial as seen in:
> ***Example 3-7. The C3E7f_twoTextures Fragment Program***
([http://http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter03.html][2])
but I get the same problem.
[1]: http://wiki.unity3d.com/index.php/Cg_Tutorial_to_Unity
[2]: http://http.developer.nvidia.com/CgTutorial/cg_tutorial_chapter03.html
↧