Shaders - 06. Unity ShaderLab
 to the material as parameters.
In simple terms, if the shader's variables are like a radio's volume control, the variables written in Properties are the volume control knobs.
![](
Like this.
![](
Next, the Tags directly below SubShader let you configure the rendering order and various features,
and from Pass onward, you can write the actual shader code.
The circled section here is the configuration part,
![](
and this Pass section is where the actual shader code goes.
Pass { shader code... }
Pass { shader code... }
If there are two passes like this, both shaders are applied once each, rendering twice.
Getting back on track — directly below Pass you'll see CGPROGRAM, which means "CG language starts here".
![](
And below you'll see ENDCG — everything written between CGPROGRAM and ENDCG is CG code.
So for HLSL, it would be HLSLPROGRAM,
and for GLSL, GLSLPROGRAM.
![](
Below you'll see syntax very similar to C/C++.
#pragma is a configuration directive.
For example, #pragma vertex vert means the function that processes vertices is named vert.
You can look up and apply pragma directives as needed.
Next, #include "UnityCG.cginc" means we're using the various functions and variable names from Unity's CG library.
Think of it like using a using statement in C#. GLSL and HLSL have different file names, so search and use them as needed.
So far we've taken a broad look at the structure. Next time, we'll analyze the CG syntax.