Getting started with Unity shaders....

I’ve been reading through the Shader tutorials, but a couple of questions come to mind…
I’ve previously used Nvidia FX composer for writing shaders…
What should we use for Shaderlab language ? I didn’t see any reference to an editor or compiler tool ?

  1. Do we just edit with any convenient text editor, and compile with unity ?

  2. and I tried copying one of the existing unity shaders (Normal-BumpSpec.shader), as a starting place. just changed the file name, and the shader name in the file… but this throws an error (near the end of the file on a blank line) ?
    Tried copying several different default shaders, (from builtin_shaders.zip) all with the same result… what am I missing please ?

Error:-
CGPROGRAM block does not contain #pragma vertex nor #pragma fragment directive, skipping
Unrecognized #pragma directive: surface
Syntax error in Normal-BumpSpec2: } at line 48

note:-line 48 is blank… is the last line before }

I’m using unity 2.6 and downloaded the builtin_shaders.zip on launch day of unity 3.0… could this be the problem ?

thx for any help.

Is there a place where the built in Unity 3 shaders can be downloaded now that it’s released?

Those are the 3.0 shaders. They will not work in earlier versions of Unity. I recommend upgrading to Unity 3 rather than finding the 2.6 shaders. It is far easier to write surface shaders than the explicit shaders you have to write for 2.6.