Shaders

The procedural Shaders script contains constants corresponding to the IDs of and properties and keywords in the shaders you add to the list in the Weaver Window so that instead of material.SetTexture("_OcclusionMap", texture) you can use material.SetTexture(Shaders.Standard._OcclusionMap, texture).

If you want to release a shader to the public which users may want to control via code, feel free to use this system to generate a script to release with the shader.

Scenes Panel

The Scenes panel in the Weaver Window allows the procedural script to be entirely disabled and allows you to specify which shaders you want it to include.

Sample Output

// This file was procedurally generated by Weaver. Any modifications will be overwritten.

#pragma warning disable // All.

namespace Weaver
{
    /// <summary>This class was procedurally generated by Weaver.</summary>
    public static class Shaders
    {
        /// <summary>Standard</summary>
        public static class Standard
        {
            /// <summary>Shader Name (for use with <see cref="UnityEngine.Shader.Find(string)"/>)</summary>
            public const string Name = "Standard";

            /// <summary>Color [Color]</summary>
            public static readonly int _Color = UnityEngine.Shader.PropertyToID("_Color");

            /// <summary>Albedo [2D Texture]</summary>
            public static readonly int _MainTex = UnityEngine.Shader.PropertyToID("_MainTex");

            /// <summary>Alpha Cutoff [Range(Default=0.5, Min=0, Max=1)]</summary>
            public static readonly int _Cutoff = UnityEngine.Shader.PropertyToID("_Cutoff");

            /// <summary>Smoothness [Range(Default=0.5, Min=0, Max=1)]</summary>
            public static readonly int _Glossiness = UnityEngine.Shader.PropertyToID("_Glossiness");

            /// <summary>Smoothness Scale [Range(Default=1, Min=0, Max=1)]</summary>
            public static readonly int _GlossMapScale = UnityEngine.Shader.PropertyToID("_GlossMapScale");

            /// <summary>Smoothness texture channel [Float]</summary>
            public static readonly int _SmoothnessTextureChannel = UnityEngine.Shader.PropertyToID("_SmoothnessTextureChannel");

            /// <summary>Metallic [Range(Default=0, Min=0, Max=1)]</summary>
            public static readonly int _Metallic = UnityEngine.Shader.PropertyToID("_Metallic");

            /// <summary>Metallic [2D Texture]</summary>
            public static readonly int _MetallicGlossMap = UnityEngine.Shader.PropertyToID("_MetallicGlossMap");

            /// <summary>Specular Highlights [Float]</summary>
            public static readonly int _SpecularHighlights = UnityEngine.Shader.PropertyToID("_SpecularHighlights");

            /// <summary>Glossy Reflections [Float]</summary>
            public static readonly int _GlossyReflections = UnityEngine.Shader.PropertyToID("_GlossyReflections");

            /// <summary>Scale [Float]</summary>
            public static readonly int _BumpScale = UnityEngine.Shader.PropertyToID("_BumpScale");

            /// <summary>Normal Map [2D Texture]</summary>
            public static readonly int _BumpMap = UnityEngine.Shader.PropertyToID("_BumpMap");

            /// <summary>Height Scale [Range(Default=0.02, Min=0.005, Max=0.08)]</summary>
            public static readonly int _Parallax = UnityEngine.Shader.PropertyToID("_Parallax");

            /// <summary>Height Map [2D Texture]</summary>
            public static readonly int _ParallaxMap = UnityEngine.Shader.PropertyToID("_ParallaxMap");

            /// <summary>Strength [Range(Default=1, Min=0, Max=1)]</summary>
            public static readonly int _OcclusionStrength = UnityEngine.Shader.PropertyToID("_OcclusionStrength");

            /// <summary>Occlusion [2D Texture]</summary>
            public static readonly int _OcclusionMap = UnityEngine.Shader.PropertyToID("_OcclusionMap");

            /// <summary>Color [Color]</summary>
            public static readonly int _EmissionColor = UnityEngine.Shader.PropertyToID("_EmissionColor");

            /// <summary>Emission [2D Texture]</summary>
            public static readonly int _EmissionMap = UnityEngine.Shader.PropertyToID("_EmissionMap");

            /// <summary>Detail Mask [2D Texture]</summary>
            public static readonly int _DetailMask = UnityEngine.Shader.PropertyToID("_DetailMask");

            /// <summary>Detail Albedo x2 [2D Texture]</summary>
            public static readonly int _DetailAlbedoMap = UnityEngine.Shader.PropertyToID("_DetailAlbedoMap");

            /// <summary>Scale [Float]</summary>
            public static readonly int _DetailNormalMapScale = UnityEngine.Shader.PropertyToID("_DetailNormalMapScale");

            /// <summary>Normal Map [2D Texture]</summary>
            public static readonly int _DetailNormalMap = UnityEngine.Shader.PropertyToID("_DetailNormalMap");

            /// <summary>UV Set for secondary textures [Float]</summary>
            public static readonly int _UVSec = UnityEngine.Shader.PropertyToID("_UVSec");

            /// <summary>__mode [Float]</summary>
            public static readonly int _Mode = UnityEngine.Shader.PropertyToID("_Mode");

            /// <summary>__src [Float]</summary>
            public static readonly int _SrcBlend = UnityEngine.Shader.PropertyToID("_SrcBlend");

            /// <summary>__dst [Float]</summary>
            public static readonly int _DstBlend = UnityEngine.Shader.PropertyToID("_DstBlend");

            /// <summary>__zw [Float]</summary>
            public static readonly int _ZWrite = UnityEngine.Shader.PropertyToID("_ZWrite");
        }
    }
}