How to get a complete list of Unity shader properties

I am new to shaders and have been looking for a complete list of Unity shader properties. I did not find such documentation. I found SL-Properties . Where can I find a complete list of properties and their functions?

UPDATE

An example is shown in SL-Properties showing a list of properties for the water shader, namely _WaveScale , _Fresnel , _BumpMap , etc. Knowing these specific properties makes it easier to get a solution. I recently tried to code something like a stroke before I learned about the following properties.

 fixed _Stroke; half4 _StrokeColor; 
+7
unity3d unity5 shader cg
source share
2 answers

Unity has its own shader syntax called ShaderLab .

All the necessary information about this can be found on this site .
For properties, check out this link.

Since nvidia does not support CG anymore, versions of the latter unity actually compile shaders using HLSL and convert the resulting bytecode to GLSL. The CG shader code continues to work mostly unchanged. Currently, you can use modern shader functions, such as computational shaders and tessellations, which were not supported by CG using the HLSL syntax.

For example, these shader properties:

 _MyColor ("Some Color", Color) = (1,1,1,1) _MyVector ("Some Vector", Vector) = (0,0,0,0) _MyRange ("My Range", Range (0, 1)) = 1 _MyFloat ("My float", Float) = 0.5 _MyInt ("My Int", int) = 1 _MyTexture2D ("Texture2D", 2D) = "white" {} _MyTexture3D ("Texture3D", 3D) = "white" {} _MyCubemap ("Cubemap", CUBE) = "" {} 

will be declared for access in Cg / HLSL code as:

 fixed4 _MyColor; float4 _MyVector; float _MyRange; float _MyFloat; int _MyInt; sampler2D _MyTexture2D; sampler3D _MyTexture3D; samplerCUBE _MyCubemap; 


Type types in ShaderLab are mapped to Cg / HLSL variable types as follows:

• The Color and Vector properties are mapped to float4 , half4, or fixed4 variables .
• Range and Float properties are mapped to floating point , half, or fixed variables.
• Texture properties correspond to sampler2D variables for regular (2D) textures.
• Cubemaps map for samplerCUBE .
• 3D textures are displayed on sampler3D .

+2
source share

Unity's shader properties are simply public variables visible to the engine because the Cg shader is wrapped in a ShaderLab program.

You can see the shader structure in Unity at this Andy Touch presentation: https://www.youtube.com/watch?v=zr1zQpdYG1Q&t=7m36s

So, when you see fixed _Stroke; half4 _StrokeColor; fixed _Stroke; half4 _StrokeColor; later in your code, these are just the actual variables used by the Cg program and tied to these properties.

Check the adjacent section of the Unity sections to see how these properties map to shader variables.

+2
source share

All Articles