// Standard geometry shader example // https://github.com/keijiro/StandardGeometryShader Shader "DBV/Kristo/GrassShader" { Properties { _Color("Color", Color) = (1, 1, 1, 1) _MainTex("Albedo", 2D) = "white" {} [Space] _Glossiness("Smoothness", Range(0, 1)) = 0.5 [Gamma] _Metallic("Metallic", Range(0, 1)) = 0 [Space] _BumpMap("Normal Map", 2D) = "bump" {} _BumpScale("Scale", Float) = 1 [Space] _OcclusionMap("Occlusion Map", 2D) = "white" {} _OcclusionStrength("Strength", Range(0, 1)) = 1 [Space] _LocalTime("Animation Time", Float) = 0.0 [Space] _BendRotationRandom("Bend Rotation Random", Range(0, 1)) = 0.2 [Space] _BladeWidth("Blade Width", Float) = 0.05 _BladeWidthRandom("Blade Width Random", Float) = 0.02 _BladeHeight("Blade Height", Float) = 0.5 _BladeHeightRandom("Blade Height Random", Float) = 0.3 [Space] _AlphaCutoff ("Alpha cutoff", Range(0,1)) = 0.05 _Test ("_Test", Range(0,10)) = 1 } SubShader { Tags { "RenderType"="Opaque" } // This shader only implements the deferred rendering pass (GBuffer // construction) and the shadow caster pass, so that it doesn't // support forward rendering. Pass { Tags { "LightMode"="Deferred" } Cull Off CGPROGRAM #pragma target 5.0 #pragma vertex Vertex #pragma geometry Geometry #pragma fragment Fragment #pragma multi_compile_prepassfinal noshadowmask nodynlightmap nodirlightmap nolightmap #include "GrassGeometry.cginc" ENDCG } //Pass //{ // Tags { "LightMode"="ShadowCaster" } // Cull Off // CGPROGRAM // #pragma target 5.0 // #pragma vertex Vertex // #pragma geometry Geometry // #pragma fragment Fragment // #pragma multi_compile_shadowcaster noshadowmask nodynlightmap nodirlightmap nolightmap // #define UNITY_PASS_SHADOWCASTER // #include "GrassGeometry.cginc" // ENDCG //} } }