This page is a very basic toturial for shaders and materials and explains what ColorMatrix do.
Shaders and materials
Relation with GameObjects
- Standard properties: Defined in the material file
- Per renderer: Defined with scripts
For example, the
Sprites-Default has the main texture in "per renderer", so this material can be used in all GameObject because this texture is defined by the
Sprite renderer component.
For a 3d object, the
Standard material has a main texture standard (because materials are usually configured by another software). For this reason you may change manually the shader in each material.
When you add a ColorMatrix component, the script search in the
ShaderReplaceList file to find the current Shader (Sprites-Default for a sprite).
If the shader is found, the material of the rendering component is replaced.
ColorMatrix script need a specific shader because it use more variables.
Frame debugger view
Including ColorMatrix in your own shaders
There is a node for shader graph and amplify shader. If you create your own shaders in glsl, see Custom shaders page