├── CGIncludes ├── AutoLight.cginc ├── HLSLSupport.cginc ├── Lighting.cginc ├── TerrainEngine.cginc ├── Tessellation.cginc ├── UnityCG.cginc └── UnityShaderVariables.cginc ├── DefaultResources ├── Alpha-BumpSpec.shader ├── Alpha-Bumped.shader ├── Alpha-Diffuse.shader ├── Alpha-Glossy.shader ├── Alpha-Parallax.shader ├── Alpha-ParallaxSpec.shader ├── Alpha-VertexLit.shader ├── AlphaTest-BumpSpec.shader ├── AlphaTest-Bumped.shader ├── AlphaTest-Diffuse.shader ├── AlphaTest-Glossy.shader ├── AlphaTest-SoftEdgeUnlit.shader ├── AlphaTest-VertexLit.shader ├── Camera-DepthNormalTexture.shader ├── Camera-DepthTexture.shader ├── Decal.shader ├── Flare.shader ├── Font.shader ├── Illumin-BumpSpec.shader ├── Illumin-Bumped.shader ├── Illumin-Diffuse.shader ├── Illumin-Glossy.shader ├── Illumin-Parallax.shader ├── Illumin-ParallaxSpec.shader ├── Illumin-VertexLit.shader ├── Internal-BlitCopy.shader ├── Internal-Clear.shader ├── Internal-CombineDepthNormals.shader ├── Internal-ErrorShader.shader ├── Internal-Flare.shader ├── Internal-GUITexture.shader ├── Internal-GUITextureBlit.shader ├── Internal-GUITextureClip.shader ├── Internal-GUITextureClipText.shader ├── Internal-Halo.shader ├── Internal-PrePassCollectShadows.shader ├── Internal-PrePassLighting.shader ├── Normal-BumpSpec.shader ├── Normal-Bumped.shader ├── Normal-Diffuse.shader ├── Normal-DiffuseDetail.shader ├── Normal-DiffuseFast.shader ├── Normal-Glossy.shader ├── Normal-Parallax.shader ├── Normal-ParallaxSpec.shader ├── Normal-VertexLit.shader ├── Particle Add.shader ├── Particle AddMultiply.shader ├── Particle AddSmooth.shader ├── Particle Alpha Blend.shader ├── Particle Blend.shader ├── Particle Multiply.shader ├── Particle MultiplyDouble.shader ├── Particle Premultiply Blend.shader ├── Particle VertexLit Blended.shader ├── Reflect-BumpNolight.shader ├── Reflect-BumpSpec.shader ├── Reflect-BumpVertexLit.shader ├── Reflect-Bumped.shader ├── Reflect-Diffuse.shader ├── Reflect-Glossy.shader ├── Reflect-Parallax.shader ├── Reflect-ParallaxSpec.shader ├── Reflect-VertexLit.shader ├── Shadow-ScreenBlur.shader ├── Shadow-ScreenBlurRotated.shader ├── Skybox.shader ├── Sprites-Default.shader ├── TerrainShaders │ ├── Details │ │ ├── VertexLit.shader │ │ ├── WavingGrass.shader │ │ └── WavingGrassBillboard.shader │ ├── Splats │ │ ├── AddPass.shader │ │ └── FirstPass.shader │ └── Trees │ │ └── BillboardTree.shader └── skybox cubed.shader ├── DefaultResourcesExtra ├── Alpha-BumpSpec.shader ├── Alpha-Bumped.shader ├── Alpha-Diffuse.shader ├── Alpha-Glossy.shader ├── Alpha-Parallax.shader ├── Alpha-ParallaxSpec.shader ├── Alpha-VertexLit.shader ├── AlphaTest-BumpSpec.shader ├── AlphaTest-Bumped.shader ├── AlphaTest-Diffuse.shader ├── AlphaTest-Glossy.shader ├── AlphaTest-SoftEdgeUnlit.shader ├── AlphaTest-VertexLit.shader ├── Decal.shader ├── Flare.shader ├── Illumin-BumpSpec.shader ├── Illumin-Bumped.shader ├── Illumin-Diffuse.shader ├── Illumin-Glossy.shader ├── Illumin-Parallax.shader ├── Illumin-ParallaxSpec.shader ├── Illumin-VertexLit.shader ├── Lightmap-BumpSpec.shader ├── Lightmap-Bumped.shader ├── Lightmap-Diffuse.shader ├── Lightmap-Glossy.shader ├── Lightmap-VertexLit.shader ├── Mobile │ ├── Mobile-BumpSpec-1DirectionalLight.shader │ ├── Mobile-BumpSpec.shader │ ├── Mobile-Bumped.shader │ ├── Mobile-Diffuse.shader │ ├── Mobile-Lightmap-Unlit.shader │ ├── Mobile-Particle-Add.shader │ ├── Mobile-Particle-Alpha-VertexLit.shader │ ├── Mobile-Particle-Alpha.shader │ ├── Mobile-Particle-Multiply.shader │ ├── Mobile-Skybox.shader │ ├── Mobile-VertexLit-OnlyDirectionalLights.shader │ └── Mobile-VertexLit.shader ├── Nature │ ├── SoftOcclusion │ │ ├── SH_Vertex.cginc │ │ ├── TreeSoftOcclusionBark.shader │ │ ├── TreeSoftOcclusionBarkRendertex.shader │ │ ├── TreeSoftOcclusionLeaves.shader │ │ └── TreeSoftOcclusionLeavesRendertex.shader │ ├── Terrain │ │ ├── TerrBumpAddPass.shader │ │ └── TerrBumpFirstPass.shader │ └── TreeCreator │ │ ├── Tree.cginc │ │ ├── TreeCreatorBark.shader │ │ ├── TreeCreatorBarkOptimized.shader │ │ ├── TreeCreatorBarkRendertex.shader │ │ ├── TreeCreatorLeaves.shader │ │ ├── TreeCreatorLeavesFast.shader │ │ ├── TreeCreatorLeavesFastOptimized.shader │ │ ├── TreeCreatorLeavesOptimized.shader │ │ ├── TreeCreatorLeavesRendertex.shader │ │ └── TreeVertexLit.cginc ├── Normal-BumpSpec.shader ├── Normal-Bumped.shader ├── Normal-Diffuse.shader ├── Normal-DiffuseDetail.shader ├── Normal-DiffuseFast.shader ├── Normal-Glossy.shader ├── Normal-Parallax.shader ├── Normal-ParallaxSpec.shader ├── Normal-VertexLit.shader ├── Particle Add.shader ├── Particle AddMultiply.shader ├── Particle AddSmooth.shader ├── Particle Alpha Blend.shader ├── Particle Blend.shader ├── Particle Multiply.shader ├── Particle MultiplyDouble.shader ├── Particle Premultiply Blend.shader ├── Particle VertexLit Blended.shader ├── Reflect-BumpNolight.shader ├── Reflect-BumpSpec.shader ├── Reflect-BumpVertexLit.shader ├── Reflect-Bumped.shader ├── Reflect-Diffuse.shader ├── Reflect-Glossy.shader ├── Reflect-Parallax.shader ├── Reflect-ParallaxSpec.shader ├── Reflect-VertexLit.shader ├── Skybox.shader ├── Sprites-Diffuse.shader ├── Sprites │ ├── Sprites-AlphaBlended.shader │ └── Sprites-PixelSnap-AlphaBlended.shader ├── TerrainShaders │ ├── Details │ │ ├── VertexLit.shader │ │ ├── WavingGrass.shader │ │ └── WavingGrassBillboard.shader │ ├── Splats │ │ ├── AddPass.shader │ │ └── FirstPass.shader │ └── Trees │ │ └── BillboardTree.shader ├── UI │ ├── UI-Default.shader │ ├── UI-DefaultFont.shader │ ├── UI-Lit-Bumped.shader │ ├── UI-Lit-Detail.shader │ ├── UI-Lit-Refraction(ProOnly).shader │ ├── UI-Lit-RefractionDetail(ProOnly).shader │ ├── UI-Lit-Transparent.shader │ ├── UI-Unlit-Detail.shader │ ├── UI-Unlit-Text.shader │ ├── UI-Unlit-TextDetail.shader │ └── UI-Unlit-Transparent.shader ├── Unlit │ ├── Unlit-Alpha.shader │ ├── Unlit-AlphaTest.shader │ └── Unlit-Normal.shader ├── skybox cubed.shader └── uGUI │ ├── GUI-Default.shader │ ├── GUI-DefaultFont.shader │ ├── GUI-Lit-Bumped.shader │ ├── GUI-Lit-Detail.shader │ ├── GUI-Lit-Refraction(ProOnly).shader │ ├── GUI-Lit-RefractionDetail(ProOnly).shader │ ├── GUI-Lit-Transparent.shader │ ├── GUI-Unlit-Detail.shader │ ├── GUI-Unlit-Text.shader │ ├── GUI-Unlit-TextDetail.shader │ ├── GUI-Unlit-Transparent.shader │ └── StencilMask.shader └── README.md /DefaultResources/Alpha-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Bumped Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {} 7 | _BumpMap ("Normalmap", 2D) = "bump" {} 8 | } 9 | 10 | SubShader { 11 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 12 | LOD 400 13 | 14 | CGPROGRAM 15 | #pragma surface surf BlinnPhong alpha 16 | 17 | sampler2D _MainTex; 18 | sampler2D _BumpMap; 19 | fixed4 _Color; 20 | half _Shininess; 21 | 22 | struct Input { 23 | float2 uv_MainTex; 24 | float2 uv_BumpMap; 25 | }; 26 | 27 | void surf (Input IN, inout SurfaceOutput o) { 28 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 29 | o.Albedo = tex.rgb * _Color.rgb; 30 | o.Gloss = tex.a; 31 | o.Alpha = tex.a * _Color.a; 32 | o.Specular = _Shininess; 33 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 34 | } 35 | ENDCG 36 | } 37 | 38 | FallBack "Transparent/VertexLit" 39 | } -------------------------------------------------------------------------------- /DefaultResources/Alpha-Bumped.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Bumped Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 5 | _BumpMap ("Normalmap", 2D) = "bump" {} 6 | } 7 | 8 | SubShader { 9 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 10 | LOD 300 11 | 12 | CGPROGRAM 13 | #pragma surface surf Lambert alpha 14 | 15 | sampler2D _MainTex; 16 | sampler2D _BumpMap; 17 | fixed4 _Color; 18 | 19 | struct Input { 20 | float2 uv_MainTex; 21 | float2 uv_BumpMap; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 26 | o.Albedo = c.rgb; 27 | o.Alpha = c.a; 28 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 29 | } 30 | ENDCG 31 | } 32 | 33 | FallBack "Transparent/Diffuse" 34 | } -------------------------------------------------------------------------------- /DefaultResources/Alpha-Diffuse.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 5 | } 6 | 7 | SubShader { 8 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 9 | LOD 200 10 | 11 | CGPROGRAM 12 | #pragma surface surf Lambert alpha 13 | 14 | sampler2D _MainTex; 15 | fixed4 _Color; 16 | 17 | struct Input { 18 | float2 uv_MainTex; 19 | }; 20 | 21 | void surf (Input IN, inout SurfaceOutput o) { 22 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 23 | o.Albedo = c.rgb; 24 | o.Alpha = c.a; 25 | } 26 | ENDCG 27 | } 28 | 29 | Fallback "Transparent/VertexLit" 30 | } 31 | -------------------------------------------------------------------------------- /DefaultResources/Alpha-Glossy.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {} 7 | } 8 | 9 | SubShader { 10 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 11 | LOD 300 12 | 13 | CGPROGRAM 14 | #pragma surface surf BlinnPhong alpha 15 | 16 | sampler2D _MainTex; 17 | fixed4 _Color; 18 | half _Shininess; 19 | 20 | struct Input { 21 | float2 uv_MainTex; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 26 | o.Albedo = tex.rgb * _Color.rgb; 27 | o.Gloss = tex.a; 28 | o.Alpha = tex.a * _Color.a; 29 | o.Specular = _Shininess; 30 | } 31 | ENDCG 32 | } 33 | 34 | Fallback "Transparent/VertexLit" 35 | } 36 | -------------------------------------------------------------------------------- /DefaultResources/Alpha-Parallax.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Parallax Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 5 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 6 | _BumpMap ("Normalmap", 2D) = "bump" {} 7 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 8 | } 9 | 10 | SubShader { 11 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 12 | LOD 500 13 | 14 | CGPROGRAM 15 | #pragma surface surf Lambert alpha 16 | 17 | sampler2D _MainTex; 18 | sampler2D _BumpMap; 19 | sampler2D _ParallaxMap; 20 | fixed4 _Color; 21 | float _Parallax; 22 | 23 | struct Input { 24 | float2 uv_MainTex; 25 | float2 uv_BumpMap; 26 | float3 viewDir; 27 | }; 28 | 29 | void surf (Input IN, inout SurfaceOutput o) { 30 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 31 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 32 | IN.uv_MainTex += offset; 33 | IN.uv_BumpMap += offset; 34 | 35 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 36 | o.Albedo = c.rgb; 37 | o.Alpha = c.a; 38 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 39 | } 40 | ENDCG 41 | } 42 | 43 | FallBack "Transparent/Bumped Diffuse" 44 | } -------------------------------------------------------------------------------- /DefaultResources/Alpha-ParallaxSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Parallax Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 7 | _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {} 8 | _BumpMap ("Normalmap", 2D) = "bump" {} 9 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 10 | } 11 | 12 | SubShader { 13 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 14 | LOD 600 15 | 16 | CGPROGRAM 17 | #pragma surface surf BlinnPhong alpha 18 | #pragma exclude_renderers flash 19 | 20 | sampler2D _MainTex; 21 | sampler2D _BumpMap; 22 | sampler2D _ParallaxMap; 23 | fixed4 _Color; 24 | half _Shininess; 25 | float _Parallax; 26 | 27 | struct Input { 28 | float2 uv_MainTex; 29 | float2 uv_BumpMap; 30 | float3 viewDir; 31 | }; 32 | 33 | void surf (Input IN, inout SurfaceOutput o) { 34 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 35 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 36 | IN.uv_MainTex += offset; 37 | IN.uv_BumpMap += offset; 38 | 39 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 40 | o.Albedo = tex.rgb * _Color.rgb; 41 | o.Gloss = tex.a; 42 | o.Alpha = tex.a * _Color.a; 43 | o.Specular = _Shininess; 44 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 45 | } 46 | ENDCG 47 | } 48 | 49 | FallBack "Transparent/Bumped Specular" 50 | } 51 | -------------------------------------------------------------------------------- /DefaultResources/AlphaTest-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Cutout/Bumped Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {} 7 | _BumpMap ("Normalmap", 2D) = "bump" {} 8 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 9 | } 10 | 11 | SubShader { 12 | Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"} 13 | LOD 400 14 | 15 | CGPROGRAM 16 | #pragma surface surf BlinnPhong alphatest:_Cutoff 17 | #pragma exclude_renderers flash 18 | 19 | sampler2D _MainTex; 20 | sampler2D _BumpMap; 21 | fixed4 _Color; 22 | half _Shininess; 23 | 24 | struct Input { 25 | float2 uv_MainTex; 26 | float2 uv_BumpMap; 27 | }; 28 | 29 | void surf (Input IN, inout SurfaceOutput o) { 30 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 31 | o.Albedo = tex.rgb * _Color.rgb; 32 | o.Gloss = tex.a; 33 | o.Alpha = tex.a * _Color.a; 34 | o.Specular = _Shininess; 35 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 36 | } 37 | ENDCG 38 | } 39 | 40 | FallBack "Transparent/Cutout/VertexLit" 41 | } 42 | -------------------------------------------------------------------------------- /DefaultResources/AlphaTest-Bumped.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Cutout/Bumped Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 5 | _BumpMap ("Normalmap", 2D) = "bump" {} 6 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 7 | } 8 | 9 | SubShader { 10 | Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"} 11 | LOD 300 12 | 13 | CGPROGRAM 14 | #pragma surface surf Lambert alphatest:_Cutoff 15 | 16 | sampler2D _MainTex; 17 | sampler2D _BumpMap; 18 | fixed4 _Color; 19 | 20 | struct Input { 21 | float2 uv_MainTex; 22 | float2 uv_BumpMap; 23 | }; 24 | 25 | void surf (Input IN, inout SurfaceOutput o) { 26 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 27 | o.Albedo = c.rgb; 28 | o.Alpha = c.a; 29 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 30 | } 31 | ENDCG 32 | } 33 | 34 | FallBack "Transparent/Cutout/Diffuse" 35 | } 36 | -------------------------------------------------------------------------------- /DefaultResources/AlphaTest-Diffuse.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Cutout/Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 5 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 6 | } 7 | 8 | SubShader { 9 | Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"} 10 | LOD 200 11 | 12 | CGPROGRAM 13 | #pragma surface surf Lambert alphatest:_Cutoff 14 | 15 | sampler2D _MainTex; 16 | fixed4 _Color; 17 | 18 | struct Input { 19 | float2 uv_MainTex; 20 | }; 21 | 22 | void surf (Input IN, inout SurfaceOutput o) { 23 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 24 | o.Albedo = c.rgb; 25 | o.Alpha = c.a; 26 | } 27 | ENDCG 28 | } 29 | 30 | Fallback "Transparent/Cutout/VertexLit" 31 | } 32 | -------------------------------------------------------------------------------- /DefaultResources/AlphaTest-Glossy.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Cutout/Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {} 7 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 8 | } 9 | 10 | SubShader { 11 | Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"} 12 | LOD 300 13 | 14 | CGPROGRAM 15 | #pragma surface surf BlinnPhong alphatest:_Cutoff 16 | 17 | sampler2D _MainTex; 18 | fixed4 _Color; 19 | half _Shininess; 20 | 21 | struct Input { 22 | float2 uv_MainTex; 23 | }; 24 | 25 | void surf (Input IN, inout SurfaceOutput o) { 26 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 27 | o.Albedo = tex.rgb * _Color.rgb; 28 | o.Gloss = tex.a; 29 | o.Alpha = tex.a * _Color.a; 30 | o.Specular = _Shininess; 31 | } 32 | ENDCG 33 | } 34 | 35 | Fallback "Transparent/Cutout/VertexLit" 36 | } 37 | -------------------------------------------------------------------------------- /DefaultResources/Decal.shader: -------------------------------------------------------------------------------- 1 | Shader "Decal" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB)", 2D) = "white" {} 5 | _DecalTex ("Decal (RGBA)", 2D) = "black" {} 6 | } 7 | 8 | SubShader { 9 | Tags { "RenderType"="Opaque" } 10 | LOD 250 11 | 12 | CGPROGRAM 13 | #pragma surface surf Lambert 14 | 15 | sampler2D _MainTex; 16 | sampler2D _DecalTex; 17 | fixed4 _Color; 18 | 19 | struct Input { 20 | float2 uv_MainTex; 21 | float2 uv_DecalTex; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex); 26 | half4 decal = tex2D(_DecalTex, IN.uv_DecalTex); 27 | c.rgb = lerp (c.rgb, decal.rgb, decal.a); 28 | c *= _Color; 29 | o.Albedo = c.rgb; 30 | o.Alpha = c.a; 31 | } 32 | ENDCG 33 | } 34 | 35 | Fallback "Diffuse" 36 | } 37 | -------------------------------------------------------------------------------- /DefaultResources/Flare.shader: -------------------------------------------------------------------------------- 1 | Shader "FX/Flare" { 2 | Properties { 3 | _MainTex ("Particle Texture", 2D) = "black" {} 4 | } 5 | SubShader { 6 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 7 | Cull Off Lighting Off ZWrite Off Ztest Always Fog { Mode Off } 8 | Blend One One 9 | 10 | Pass { 11 | CGPROGRAM 12 | #pragma vertex vert 13 | #pragma fragment frag 14 | #pragma fragmentoption ARB_precision_hint_fastest 15 | 16 | #include "UnityCG.cginc" 17 | 18 | sampler2D _MainTex; 19 | fixed4 _TintColor; 20 | 21 | struct appdata_t { 22 | float4 vertex : POSITION; 23 | fixed4 color : COLOR; 24 | float2 texcoord : TEXCOORD0; 25 | }; 26 | 27 | struct v2f { 28 | float4 vertex : POSITION; 29 | fixed4 color : COLOR; 30 | float2 texcoord : TEXCOORD0; 31 | }; 32 | 33 | float4 _MainTex_ST; 34 | 35 | v2f vert (appdata_t v) 36 | { 37 | v2f o; 38 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 39 | o.color = v.color; 40 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 41 | return o; 42 | } 43 | 44 | fixed4 frag (v2f i) : COLOR 45 | { 46 | fixed4 col; 47 | fixed4 tex = tex2D(_MainTex, i.texcoord); 48 | col.rgb = i.color.rgb * tex.rgb; 49 | col.a = tex.a; 50 | return col; 51 | } 52 | ENDCG 53 | } 54 | } 55 | 56 | SubShader { 57 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 58 | Cull Off Lighting Off ZWrite Off Ztest Always Fog { Mode Off } 59 | Blend One One 60 | Color (1,1,1,1) 61 | Pass { 62 | SetTexture [_MainTex] { combine texture * primary, texture } 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /DefaultResources/Font.shader: -------------------------------------------------------------------------------- 1 | Shader "GUI/Text Shader" { 2 | Properties { 3 | _MainTex ("Font Texture", 2D) = "white" {} 4 | _Color ("Text Color", Color) = (1,1,1,1) 5 | } 6 | 7 | SubShader { 8 | 9 | Tags { 10 | "Queue"="Transparent" 11 | "IgnoreProjector"="True" 12 | "RenderType"="Transparent" 13 | "PreviewType"="Plane" 14 | } 15 | Lighting Off Cull Off ZTest Always ZWrite Off Fog { Mode Off } 16 | Blend SrcAlpha OneMinusSrcAlpha 17 | 18 | Pass { 19 | CGPROGRAM 20 | #pragma vertex vert 21 | #pragma fragment frag 22 | 23 | #include "UnityCG.cginc" 24 | 25 | struct appdata_t { 26 | float4 vertex : POSITION; 27 | fixed4 color : COLOR; 28 | float2 texcoord : TEXCOORD0; 29 | }; 30 | 31 | struct v2f { 32 | float4 vertex : SV_POSITION; 33 | fixed4 color : COLOR; 34 | float2 texcoord : TEXCOORD0; 35 | }; 36 | 37 | sampler2D _MainTex; 38 | uniform float4 _MainTex_ST; 39 | uniform fixed4 _Color; 40 | 41 | v2f vert (appdata_t v) 42 | { 43 | v2f o; 44 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 45 | o.color = v.color * _Color; 46 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 47 | return o; 48 | } 49 | 50 | fixed4 frag (v2f i) : SV_Target 51 | { 52 | fixed4 col = i.color; 53 | col.a *= tex2D(_MainTex, i.texcoord).a; 54 | return col; 55 | } 56 | ENDCG 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /DefaultResources/Illumin-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Self-Illumin/Bumped Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 7 | _Illum ("Illumin (A)", 2D) = "white" {} 8 | _BumpMap ("Normalmap", 2D) = "bump" {} 9 | _EmissionLM ("Emission (Lightmapper)", Float) = 0 10 | } 11 | SubShader { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 400 14 | CGPROGRAM 15 | #pragma surface surf BlinnPhong 16 | 17 | sampler2D _MainTex; 18 | sampler2D _BumpMap; 19 | sampler2D _Illum; 20 | fixed4 _Color; 21 | half _Shininess; 22 | 23 | struct Input { 24 | float2 uv_MainTex; 25 | float2 uv_Illum; 26 | float2 uv_BumpMap; 27 | }; 28 | 29 | void surf (Input IN, inout SurfaceOutput o) { 30 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 31 | fixed4 c = tex * _Color; 32 | o.Albedo = c.rgb; 33 | o.Emission = c.rgb * UNITY_SAMPLE_1CHANNEL(_Illum, IN.uv_Illum); 34 | o.Gloss = tex.a; 35 | o.Alpha = c.a; 36 | o.Specular = _Shininess; 37 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 38 | } 39 | ENDCG 40 | } 41 | FallBack "Self-Illumin/Specular" 42 | } 43 | -------------------------------------------------------------------------------- /DefaultResources/Illumin-Bumped.shader: -------------------------------------------------------------------------------- 1 | Shader "Self-Illumin/Bumped Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 5 | _Illum ("Illumin (A)", 2D) = "white" {} 6 | _BumpMap ("Normalmap", 2D) = "bump" {} 7 | _EmissionLM ("Emission (Lightmapper)", Float) = 0 8 | } 9 | SubShader { 10 | Tags { "RenderType"="Opaque" } 11 | LOD 300 12 | 13 | CGPROGRAM 14 | #pragma surface surf Lambert 15 | 16 | sampler2D _MainTex; 17 | sampler2D _BumpMap; 18 | sampler2D _Illum; 19 | fixed4 _Color; 20 | 21 | struct Input { 22 | float2 uv_MainTex; 23 | float2 uv_Illum; 24 | float2 uv_BumpMap; 25 | }; 26 | 27 | void surf (Input IN, inout SurfaceOutput o) { 28 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 29 | fixed4 c = tex * _Color; 30 | o.Albedo = c.rgb; 31 | o.Emission = c.rgb * UNITY_SAMPLE_1CHANNEL(_Illum, IN.uv_Illum); 32 | o.Alpha = c.a; 33 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 34 | } 35 | ENDCG 36 | } 37 | FallBack "Self-Illumin/Diffuse" 38 | } 39 | -------------------------------------------------------------------------------- /DefaultResources/Illumin-Diffuse.shader: -------------------------------------------------------------------------------- 1 | Shader "Self-Illumin/Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 5 | _Illum ("Illumin (A)", 2D) = "white" {} 6 | _EmissionLM ("Emission (Lightmapper)", Float) = 0 7 | } 8 | SubShader { 9 | Tags { "RenderType"="Opaque" } 10 | LOD 200 11 | 12 | CGPROGRAM 13 | #pragma surface surf Lambert 14 | 15 | sampler2D _MainTex; 16 | sampler2D _Illum; 17 | fixed4 _Color; 18 | 19 | struct Input { 20 | float2 uv_MainTex; 21 | float2 uv_Illum; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 26 | fixed4 c = tex * _Color; 27 | o.Albedo = c.rgb; 28 | o.Emission = c.rgb * UNITY_SAMPLE_1CHANNEL(_Illum, IN.uv_Illum); 29 | o.Alpha = c.a; 30 | } 31 | ENDCG 32 | } 33 | FallBack "Self-Illumin/VertexLit" 34 | } 35 | -------------------------------------------------------------------------------- /DefaultResources/Illumin-Glossy.shader: -------------------------------------------------------------------------------- 1 | Shader "Self-Illumin/Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 7 | _Illum ("Illumin (A)", 2D) = "white" {} 8 | _EmissionLM ("Emission (Lightmapper)", Float) = 0 9 | } 10 | SubShader { 11 | Tags { "RenderType"="Opaque" } 12 | LOD 300 13 | 14 | CGPROGRAM 15 | #pragma surface surf BlinnPhong 16 | 17 | sampler2D _MainTex; 18 | sampler2D _Illum; 19 | fixed4 _Color; 20 | half _Shininess; 21 | 22 | struct Input { 23 | float2 uv_MainTex; 24 | float2 uv_Illum; 25 | }; 26 | 27 | void surf (Input IN, inout SurfaceOutput o) { 28 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 29 | fixed4 c = tex * _Color; 30 | o.Albedo = c.rgb; 31 | o.Emission = c.rgb * UNITY_SAMPLE_1CHANNEL(_Illum, IN.uv_Illum); 32 | o.Gloss = tex.a; 33 | o.Alpha = c.a; 34 | o.Specular = _Shininess; 35 | } 36 | ENDCG 37 | } 38 | FallBack "Self-Illumin/Diffuse" 39 | } 40 | -------------------------------------------------------------------------------- /DefaultResources/Illumin-Parallax.shader: -------------------------------------------------------------------------------- 1 | Shader "Self-Illumin/Parallax Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 5 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 6 | _Illum ("Illumin (A)", 2D) = "white" {} 7 | _BumpMap ("Normalmap", 2D) = "bump" {} 8 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 9 | _EmissionLM ("Emission (Lightmapper)", Float) = 0 10 | } 11 | SubShader { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 500 14 | 15 | CGPROGRAM 16 | #pragma surface surf Lambert 17 | 18 | sampler2D _MainTex; 19 | sampler2D _BumpMap; 20 | sampler2D _ParallaxMap; 21 | sampler2D _Illum; 22 | fixed4 _Color; 23 | float _Parallax; 24 | 25 | struct Input { 26 | float2 uv_MainTex; 27 | float2 uv_BumpMap; 28 | float2 uv_Illum; 29 | float3 viewDir; 30 | }; 31 | 32 | void surf (Input IN, inout SurfaceOutput o) { 33 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 34 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 35 | IN.uv_MainTex += offset; 36 | IN.uv_BumpMap += offset; 37 | IN.uv_Illum += offset; 38 | 39 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 40 | o.Albedo = c.rgb; 41 | o.Emission = c.rgb * UNITY_SAMPLE_1CHANNEL(_Illum, IN.uv_Illum); 42 | o.Alpha = c.a; 43 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 44 | } 45 | ENDCG 46 | } 47 | FallBack "Self-Illumin/Bumped Diffuse" 48 | } 49 | -------------------------------------------------------------------------------- /DefaultResources/Illumin-ParallaxSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Self-Illumin/Parallax Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 7 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 8 | _Illum ("Illumin (A)", 2D) = "white" {} 9 | _BumpMap ("Normalmap", 2D) = "bump" {} 10 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 11 | _EmissionLM ("Emission (Lightmapper)", Float) = 0 12 | } 13 | SubShader { 14 | Tags { "RenderType"="Opaque" } 15 | LOD 600 16 | 17 | CGPROGRAM 18 | #pragma surface surf BlinnPhong 19 | #pragma target 3.0 20 | 21 | sampler2D _MainTex; 22 | sampler2D _BumpMap; 23 | sampler2D _ParallaxMap; 24 | sampler2D _Illum; 25 | fixed4 _Color; 26 | float _Parallax; 27 | half _Shininess; 28 | 29 | struct Input { 30 | float2 uv_MainTex; 31 | float2 uv_BumpMap; 32 | float2 uv_Illum; 33 | float3 viewDir; 34 | }; 35 | 36 | void surf (Input IN, inout SurfaceOutput o) { 37 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 38 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 39 | IN.uv_MainTex += offset; 40 | IN.uv_BumpMap += offset; 41 | IN.uv_Illum += offset; 42 | 43 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 44 | fixed4 c = tex * _Color; 45 | o.Albedo = c.rgb; 46 | o.Gloss = tex.a; 47 | o.Emission = c.rgb * UNITY_SAMPLE_1CHANNEL(_Illum, IN.uv_Illum); 48 | o.Specular = _Shininess; 49 | o.Alpha = c.a; 50 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 51 | } 52 | ENDCG 53 | } 54 | FallBack "Self-Illumin/Bumped Specular" 55 | } 56 | -------------------------------------------------------------------------------- /DefaultResources/Illumin-VertexLit.shader: -------------------------------------------------------------------------------- 1 | Shader "Self-Illumin/VertexLit" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Spec Color", Color) = (1,1,1,1) 5 | _Shininess ("Shininess", Range (0.1, 1)) = 0.7 6 | _MainTex ("Base (RGB)", 2D) = "white" {} 7 | _Illum ("Illumin (A)", 2D) = "white" {} 8 | _EmissionLM ("Emission (Lightmapper)", Float) = 0 9 | } 10 | 11 | // ------------------------------------------------------------------ 12 | // Dual texture cards 13 | 14 | SubShader { 15 | LOD 100 16 | Tags { "RenderType"="Opaque" } 17 | 18 | Pass { 19 | Name "BASE" 20 | Tags {"LightMode" = "Vertex"} 21 | Material { 22 | Diffuse [_Color] 23 | Shininess [_Shininess] 24 | Specular [_SpecColor] 25 | } 26 | SeparateSpecular On 27 | Lighting On 28 | SetTexture [_Illum] { 29 | constantColor [_Color] 30 | combine constant lerp (texture) previous 31 | } 32 | SetTexture [_MainTex] { 33 | Combine texture * previous, texture*primary 34 | } 35 | } 36 | } 37 | 38 | Fallback "VertexLit" 39 | } 40 | -------------------------------------------------------------------------------- /DefaultResources/Internal-BlitCopy.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/BlitCopy" { 2 | Properties { _MainTex ("", any) = "" {} } 3 | SubShader { 4 | Pass { 5 | ZTest Always Cull Off ZWrite Off Fog { Mode Off } 6 | 7 | CGPROGRAM 8 | #pragma vertex vert 9 | #pragma fragment frag 10 | 11 | #include "UnityCG.cginc" 12 | 13 | sampler2D _MainTex; 14 | 15 | struct appdata_t { 16 | float4 vertex : POSITION; 17 | float2 texcoord : TEXCOORD0; 18 | }; 19 | 20 | struct v2f { 21 | float4 vertex : SV_POSITION; 22 | float2 texcoord : TEXCOORD0; 23 | }; 24 | 25 | v2f vert (appdata_t v) 26 | { 27 | v2f o; 28 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 29 | o.texcoord = v.texcoord.xy; 30 | return o; 31 | } 32 | 33 | fixed4 frag (v2f i) : SV_Target 34 | { 35 | return tex2D(_MainTex, i.texcoord); 36 | } 37 | ENDCG 38 | 39 | } 40 | } 41 | Fallback Off 42 | } 43 | -------------------------------------------------------------------------------- /DefaultResources/Internal-Clear.shader: -------------------------------------------------------------------------------- 1 | // Only used on D3D11 for non-fullscreen clears 2 | Shader "Hidden/InternalClear" { 3 | 4 | CGINCLUDE 5 | #pragma vertex vert 6 | #pragma fragment frag 7 | #include "UnityShaderVariables.cginc" 8 | 9 | struct appdata_t { 10 | float4 vertex : POSITION; 11 | fixed4 color : COLOR; 12 | }; 13 | 14 | struct v2f { 15 | float4 vertex : SV_POSITION; 16 | fixed4 color : COLOR; 17 | }; 18 | 19 | v2f vert (appdata_t v) 20 | { 21 | v2f o; 22 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 23 | o.color = v.color; 24 | return o; 25 | } 26 | 27 | fixed4 frag (v2f i) : SV_Target 28 | { 29 | return i.color; 30 | } 31 | ENDCG 32 | 33 | SubShader { 34 | ZTest Always Cull Off Fog { Mode Off } 35 | Pass { 36 | ColorMask 0 ZWrite Off 37 | CGPROGRAM 38 | ENDCG 39 | } 40 | Pass { 41 | ZWrite Off 42 | CGPROGRAM 43 | ENDCG 44 | } 45 | Pass { 46 | ColorMask 0 47 | CGPROGRAM 48 | ENDCG 49 | } 50 | Pass { 51 | CGPROGRAM 52 | ENDCG 53 | } 54 | Pass { 55 | ColorMask 0 ZWrite Off 56 | Stencil { Comp Always Pass Zero } 57 | CGPROGRAM 58 | ENDCG 59 | } 60 | Pass { 61 | ZWrite Off 62 | Stencil { Comp Always Pass Zero } 63 | CGPROGRAM 64 | ENDCG 65 | } 66 | Pass { 67 | ColorMask 0 68 | Stencil { Comp Always Pass Zero } 69 | CGPROGRAM 70 | ENDCG 71 | } 72 | Pass { 73 | Stencil { Comp Always Pass Zero } 74 | CGPROGRAM 75 | ENDCG 76 | } 77 | } 78 | Fallback Off 79 | } 80 | -------------------------------------------------------------------------------- /DefaultResources/Internal-CombineDepthNormals.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/Internal-CombineDepthNormals" { 2 | SubShader { 3 | 4 | Pass { 5 | ZWrite Off ZTest Always Cull Off Fog { Mode Off } 6 | CGPROGRAM 7 | #pragma vertex vert 8 | #pragma fragment frag 9 | #include "UnityCG.cginc" 10 | 11 | struct appdata { 12 | float4 vertex : POSITION; 13 | float2 texcoord : TEXCOORD0; 14 | }; 15 | 16 | struct v2f { 17 | float4 pos : SV_POSITION; 18 | float2 uv : TEXCOORD0; 19 | }; 20 | float4 _CameraNormalsTexture_ST; 21 | 22 | v2f vert (appdata v) 23 | { 24 | v2f o; 25 | o.pos = mul(UNITY_MATRIX_MVP, v.vertex); 26 | o.uv = TRANSFORM_TEX(v.texcoord,_CameraNormalsTexture); 27 | return o; 28 | } 29 | sampler2D_float _CameraDepthTexture; 30 | sampler2D _CameraNormalsTexture; 31 | 32 | float4x4 _WorldToCamera; 33 | 34 | fixed4 frag (v2f i) : SV_Target 35 | { 36 | float d = SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.uv); 37 | float3 n = tex2D (_CameraNormalsTexture, i.uv) * 2.0 - 1.0; 38 | d = Linear01Depth (d); 39 | n = mul ((float3x3)_WorldToCamera, n); 40 | n.z = -n.z; 41 | return (d < (1.0-1.0/65025.0)) ? EncodeDepthNormal (d, n.xyz) : float4(0.5,0.5,1.0,1.0); 42 | } 43 | ENDCG 44 | } 45 | 46 | } 47 | Fallback Off 48 | } 49 | -------------------------------------------------------------------------------- /DefaultResources/Internal-ErrorShader.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/InternalErrorShader" 2 | { 3 | SubShader 4 | { 5 | Pass 6 | { 7 | Fog { Mode Off } 8 | CGPROGRAM 9 | #pragma vertex vert 10 | #pragma fragment frag 11 | float4 vert (float4 pos : POSITION) : SV_POSITION { return mul(UNITY_MATRIX_MVP,pos); } 12 | fixed4 frag () : COLOR { return fixed4(1,0,1,1); } 13 | ENDCG 14 | } 15 | } 16 | Fallback Off 17 | } 18 | -------------------------------------------------------------------------------- /DefaultResources/Internal-Flare.shader: -------------------------------------------------------------------------------- 1 | 2 | Shader "Hidden/Internal-Flare" 3 | { 4 | SubShader { 5 | 6 | Tags {"RenderType"="Overlay"} 7 | ZWrite Off ZTest Always 8 | Fog {Mode Off} 9 | Cull Off 10 | Blend One One 11 | ColorMask RGB 12 | 13 | Pass { 14 | CGPROGRAM 15 | #pragma vertex vert 16 | #pragma fragment frag 17 | 18 | #include "UnityCG.cginc" 19 | 20 | sampler2D _FlareTexture; 21 | 22 | struct appdata_t { 23 | float4 vertex : POSITION; 24 | fixed4 color : COLOR; 25 | float2 texcoord : TEXCOORD0; 26 | }; 27 | 28 | struct v2f { 29 | float4 vertex : SV_POSITION; 30 | fixed4 color : COLOR; 31 | float2 texcoord : TEXCOORD0; 32 | }; 33 | 34 | float4 _FlareTexture_ST; 35 | 36 | v2f vert (appdata_t v) 37 | { 38 | v2f o; 39 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 40 | o.color = v.color; 41 | o.texcoord = TRANSFORM_TEX(v.texcoord, _FlareTexture); 42 | return o; 43 | } 44 | 45 | fixed4 frag (v2f i) : SV_Target 46 | { 47 | return tex2D(_FlareTexture, i.texcoord) * i.color; 48 | } 49 | ENDCG 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /DefaultResources/Internal-GUITexture.shader: -------------------------------------------------------------------------------- 1 | 2 | Shader "Hidden/Internal-GUITexture" 3 | { 4 | Properties { _MainTex ("Texture", any) = "" {} } 5 | 6 | SubShader { 7 | 8 | Tags { "ForceSupported" = "True" "RenderType"="Overlay" } 9 | 10 | Lighting Off 11 | Blend SrcAlpha OneMinusSrcAlpha 12 | Cull Off 13 | ZWrite Off 14 | Fog { Mode Off } 15 | ZTest Always 16 | 17 | Pass { 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | 22 | #include "UnityCG.cginc" 23 | 24 | struct appdata_t { 25 | float4 vertex : POSITION; 26 | fixed4 color : COLOR; 27 | float2 texcoord : TEXCOORD0; 28 | }; 29 | 30 | struct v2f { 31 | float4 vertex : SV_POSITION; 32 | fixed4 color : COLOR; 33 | float2 texcoord : TEXCOORD0; 34 | }; 35 | 36 | sampler2D _MainTex; 37 | 38 | uniform float4 _MainTex_ST; 39 | 40 | v2f vert (appdata_t v) 41 | { 42 | v2f o; 43 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 44 | o.color = v.color; 45 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 46 | return o; 47 | } 48 | 49 | fixed4 frag (v2f i) : SV_Target 50 | { 51 | return 2.0f * tex2D(_MainTex, i.texcoord) * i.color; 52 | } 53 | ENDCG 54 | } 55 | } 56 | 57 | Fallback off 58 | } 59 | -------------------------------------------------------------------------------- /DefaultResources/Internal-GUITextureBlit.shader: -------------------------------------------------------------------------------- 1 | 2 | Shader "Hidden/Internal-GUITextureBlit" 3 | { 4 | Properties { _MainTex ("Texture", Any) = "white" {} } 5 | 6 | SubShader { 7 | Tags { "ForceSupported" = "True" } 8 | 9 | Lighting Off 10 | Blend SrcAlpha OneMinusSrcAlpha 11 | Cull Off 12 | ZWrite Off 13 | Fog { Mode Off } 14 | ZTest Always 15 | 16 | Pass { 17 | CGPROGRAM 18 | #pragma vertex vert 19 | #pragma fragment frag 20 | 21 | #include "UnityCG.cginc" 22 | 23 | struct appdata_t { 24 | float4 vertex : POSITION; 25 | fixed4 color : COLOR; 26 | float2 texcoord : TEXCOORD0; 27 | }; 28 | 29 | struct v2f { 30 | float4 vertex : SV_POSITION; 31 | fixed4 color : COLOR; 32 | float2 texcoord : TEXCOORD0; 33 | float2 texgencoord : TEXCOORD1; 34 | }; 35 | 36 | uniform float4 _MainTex_ST; 37 | uniform fixed4 _Color; 38 | uniform float4x4 _GUIClipTextureMatrix; 39 | 40 | v2f vert (appdata_t v) 41 | { 42 | v2f o; 43 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 44 | float4 texgen = mul(UNITY_MATRIX_MV, v.vertex); 45 | o.texgencoord = mul(_GUIClipTextureMatrix, texgen); 46 | o.color = v.color; 47 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 48 | return o; 49 | } 50 | 51 | sampler2D _MainTex; 52 | sampler2D _GUIClipTexture; 53 | 54 | fixed4 frag (v2f i) : SV_Target 55 | { 56 | fixed4 col; 57 | col.rgb = tex2D (_MainTex, i.texcoord).rgb * i.color.rgb; 58 | col.a = i.color.a * tex2D(_GUIClipTexture, i.texgencoord).a; 59 | return col; 60 | } 61 | ENDCG 62 | } 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /DefaultResources/Internal-GUITextureClip.shader: -------------------------------------------------------------------------------- 1 | 2 | Shader "Hidden/Internal-GUITextureClip" 3 | { 4 | Properties { _MainTex ("Texture", Any) = "white" {} } 5 | 6 | SubShader { 7 | 8 | Tags { "ForceSupported" = "True" } 9 | 10 | Lighting Off 11 | Blend SrcAlpha OneMinusSrcAlpha 12 | Cull Off 13 | ZWrite Off 14 | Fog { Mode Off } 15 | ZTest Always 16 | 17 | Pass { 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | 22 | #include "UnityCG.cginc" 23 | 24 | struct appdata_t { 25 | float4 vertex : POSITION; 26 | fixed4 color : COLOR; 27 | float2 texcoord : TEXCOORD0; 28 | }; 29 | 30 | struct v2f { 31 | float4 vertex : SV_POSITION; 32 | fixed4 color : COLOR; 33 | float2 texcoord : TEXCOORD0; 34 | float2 texgencoord : TEXCOORD1; 35 | }; 36 | 37 | sampler2D _MainTex; 38 | sampler2D _GUIClipTexture; 39 | 40 | uniform float4 _MainTex_ST; 41 | uniform fixed4 _Color; 42 | uniform float4x4 _GUIClipTextureMatrix; 43 | 44 | v2f vert (appdata_t v) 45 | { 46 | v2f o; 47 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 48 | float4 texgen = mul(UNITY_MATRIX_MV, v.vertex); 49 | o.texgencoord = mul(_GUIClipTextureMatrix, texgen); 50 | o.color = v.color; 51 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 52 | return o; 53 | } 54 | 55 | fixed4 frag (v2f i) : SV_Target 56 | { 57 | fixed4 col = tex2D(_MainTex, i.texcoord) * i.color; 58 | col.a *= tex2D(_GUIClipTexture, i.texgencoord).a; 59 | return col; 60 | } 61 | ENDCG 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /DefaultResources/Internal-GUITextureClipText.shader: -------------------------------------------------------------------------------- 1 | 2 | Shader "Hidden/Internal-GUITextureClipText" 3 | { 4 | Properties { _MainTex ("Texture", 2D) = "white" {} } 5 | 6 | SubShader { 7 | Tags { "ForceSupported" = "True" } 8 | 9 | Lighting Off 10 | Blend SrcAlpha OneMinusSrcAlpha 11 | Cull Off 12 | ZWrite Off 13 | Fog { Mode Off } 14 | ZTest Always 15 | 16 | Pass { 17 | CGPROGRAM 18 | #pragma vertex vert 19 | #pragma fragment frag 20 | 21 | #include "UnityCG.cginc" 22 | 23 | struct appdata_t { 24 | float4 vertex : POSITION; 25 | fixed4 color : COLOR; 26 | float2 texcoord : TEXCOORD0; 27 | }; 28 | 29 | struct v2f { 30 | float4 vertex : SV_POSITION; 31 | fixed4 color : COLOR; 32 | float2 texcoord : TEXCOORD0; 33 | float2 texgencoord : TEXCOORD1; 34 | }; 35 | 36 | sampler2D _MainTex; 37 | sampler2D _GUIClipTexture; 38 | 39 | uniform float4 _MainTex_ST; 40 | uniform fixed4 _Color; 41 | uniform float4x4 _GUIClipTextureMatrix; 42 | 43 | v2f vert (appdata_t v) 44 | { 45 | v2f o; 46 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 47 | float4 texgen = mul(UNITY_MATRIX_MV, v.vertex); 48 | o.texgencoord = mul(_GUIClipTextureMatrix, texgen); 49 | o.color = v.color * _Color; 50 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 51 | return o; 52 | } 53 | 54 | fixed4 frag (v2f i) : SV_Target 55 | { 56 | fixed4 col = i.color; 57 | col.a *= tex2D(_MainTex, i.texcoord).a * tex2D(_GUIClipTexture, i.texgencoord).a; 58 | return col; 59 | } 60 | ENDCG 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /DefaultResources/Internal-Halo.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/Internal-Halo" { 2 | SubShader { 3 | Tags {"RenderType"="Overlay"} 4 | ZWrite off Cull off // NOTE: 'Cull off' is important as the halo meshes flip handedness each time... BUG: #1220 5 | Fog { Color (0,0,0,0) } 6 | Blend OneMinusDstColor One 7 | AlphaTest Greater 0 8 | ColorMask RGB 9 | Pass { 10 | CGPROGRAM 11 | #pragma vertex vert 12 | #pragma fragment frag 13 | #include "UnityCG.cginc" 14 | sampler2D _HaloFalloff; 15 | struct appdata_t { 16 | float4 vertex : POSITION; 17 | fixed4 color : COLOR; 18 | float2 texcoord : TEXCOORD0; 19 | }; 20 | struct v2f { 21 | float4 vertex : SV_POSITION; 22 | fixed4 color : COLOR; 23 | float2 texcoord : TEXCOORD0; 24 | }; 25 | float4 _HaloFalloff_ST; 26 | v2f vert (appdata_t v) 27 | { 28 | v2f o; 29 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 30 | o.color = v.color; 31 | o.texcoord = TRANSFORM_TEX(v.texcoord,_HaloFalloff); 32 | return o; 33 | } 34 | fixed4 frag (v2f i) : SV_Target 35 | { 36 | half a = tex2D(_HaloFalloff, i.texcoord).a; 37 | return half4 (i.color.rgb * a, a); 38 | } 39 | ENDCG 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /DefaultResources/Normal-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Bumped Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 5 | _Shininess ("Shininess", Range (0.03, 1)) = 0.078125 6 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 7 | _BumpMap ("Normalmap", 2D) = "bump" {} 8 | } 9 | SubShader { 10 | Tags { "RenderType"="Opaque" } 11 | LOD 400 12 | 13 | CGPROGRAM 14 | #pragma surface surf BlinnPhong 15 | 16 | 17 | sampler2D _MainTex; 18 | sampler2D _BumpMap; 19 | fixed4 _Color; 20 | half _Shininess; 21 | 22 | struct Input { 23 | float2 uv_MainTex; 24 | float2 uv_BumpMap; 25 | }; 26 | 27 | void surf (Input IN, inout SurfaceOutput o) { 28 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 29 | o.Albedo = tex.rgb * _Color.rgb; 30 | o.Gloss = tex.a; 31 | o.Alpha = tex.a * _Color.a; 32 | o.Specular = _Shininess; 33 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 34 | } 35 | ENDCG 36 | } 37 | 38 | FallBack "Specular" 39 | } 40 | -------------------------------------------------------------------------------- /DefaultResources/Normal-Bumped.shader: -------------------------------------------------------------------------------- 1 | Shader "Bumped Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB)", 2D) = "white" {} 5 | _BumpMap ("Normalmap", 2D) = "bump" {} 6 | } 7 | 8 | SubShader { 9 | Tags { "RenderType"="Opaque" } 10 | LOD 300 11 | 12 | CGPROGRAM 13 | #pragma surface surf Lambert 14 | 15 | sampler2D _MainTex; 16 | sampler2D _BumpMap; 17 | fixed4 _Color; 18 | 19 | struct Input { 20 | float2 uv_MainTex; 21 | float2 uv_BumpMap; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 26 | o.Albedo = c.rgb; 27 | o.Alpha = c.a; 28 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 29 | } 30 | ENDCG 31 | } 32 | 33 | FallBack "Diffuse" 34 | } 35 | -------------------------------------------------------------------------------- /DefaultResources/Normal-Diffuse.shader: -------------------------------------------------------------------------------- 1 | Shader "Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB)", 2D) = "white" {} 5 | } 6 | SubShader { 7 | Tags { "RenderType"="Opaque" } 8 | LOD 200 9 | 10 | CGPROGRAM 11 | #pragma surface surf Lambert 12 | 13 | sampler2D _MainTex; 14 | fixed4 _Color; 15 | 16 | struct Input { 17 | float2 uv_MainTex; 18 | }; 19 | 20 | void surf (Input IN, inout SurfaceOutput o) { 21 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 22 | o.Albedo = c.rgb; 23 | o.Alpha = c.a; 24 | } 25 | ENDCG 26 | } 27 | 28 | Fallback "VertexLit" 29 | } 30 | -------------------------------------------------------------------------------- /DefaultResources/Normal-DiffuseDetail.shader: -------------------------------------------------------------------------------- 1 | Shader "Diffuse Detail" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB)", 2D) = "white" {} 5 | _Detail ("Detail (RGB)", 2D) = "gray" {} 6 | } 7 | 8 | SubShader { 9 | Tags { "RenderType"="Opaque" } 10 | LOD 250 11 | 12 | CGPROGRAM 13 | #pragma surface surf Lambert 14 | 15 | sampler2D _MainTex; 16 | sampler2D _Detail; 17 | fixed4 _Color; 18 | 19 | struct Input { 20 | float2 uv_MainTex; 21 | float2 uv_Detail; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 26 | c.rgb *= tex2D(_Detail,IN.uv_Detail).rgb*2; 27 | o.Albedo = c.rgb; 28 | o.Alpha = c.a; 29 | } 30 | ENDCG 31 | } 32 | 33 | Fallback "Diffuse" 34 | } 35 | -------------------------------------------------------------------------------- /DefaultResources/Normal-DiffuseFast.shader: -------------------------------------------------------------------------------- 1 | // Does not do anything in 3.x 2 | Shader "Legacy Shaders/Diffuse Fast" { 3 | Properties { 4 | _Color ("Main Color", Color) = (1,1,1,1) 5 | _MainTex ("Base (RGB)", 2D) = "white" {} 6 | } 7 | Fallback "VertexLit" 8 | } -------------------------------------------------------------------------------- /DefaultResources/Normal-Glossy.shader: -------------------------------------------------------------------------------- 1 | Shader "Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 7 | } 8 | 9 | SubShader { 10 | Tags { "RenderType"="Opaque" } 11 | LOD 300 12 | 13 | CGPROGRAM 14 | #pragma surface surf BlinnPhong 15 | 16 | sampler2D _MainTex; 17 | fixed4 _Color; 18 | half _Shininess; 19 | 20 | struct Input { 21 | float2 uv_MainTex; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 26 | o.Albedo = tex.rgb * _Color.rgb; 27 | o.Gloss = tex.a; 28 | o.Alpha = tex.a * _Color.a; 29 | o.Specular = _Shininess; 30 | } 31 | ENDCG 32 | } 33 | 34 | Fallback "VertexLit" 35 | } 36 | -------------------------------------------------------------------------------- /DefaultResources/Normal-Parallax.shader: -------------------------------------------------------------------------------- 1 | Shader "Parallax Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 5 | _MainTex ("Base (RGB)", 2D) = "white" {} 6 | _BumpMap ("Normalmap", 2D) = "bump" {} 7 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 8 | } 9 | 10 | SubShader { 11 | Tags { "RenderType"="Opaque" } 12 | LOD 500 13 | 14 | CGPROGRAM 15 | #pragma surface surf Lambert 16 | 17 | sampler2D _MainTex; 18 | sampler2D _BumpMap; 19 | sampler2D _ParallaxMap; 20 | fixed4 _Color; 21 | float _Parallax; 22 | 23 | struct Input { 24 | float2 uv_MainTex; 25 | float2 uv_BumpMap; 26 | float3 viewDir; 27 | }; 28 | 29 | void surf (Input IN, inout SurfaceOutput o) { 30 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 31 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 32 | IN.uv_MainTex += offset; 33 | IN.uv_BumpMap += offset; 34 | 35 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 36 | o.Albedo = c.rgb; 37 | o.Alpha = c.a; 38 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 39 | } 40 | ENDCG 41 | } 42 | 43 | FallBack "Bumped Diffuse" 44 | } 45 | -------------------------------------------------------------------------------- /DefaultResources/Normal-ParallaxSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Parallax Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 7 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 8 | _BumpMap ("Normalmap", 2D) = "bump" {} 9 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 10 | } 11 | SubShader { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 600 14 | 15 | CGPROGRAM 16 | #pragma surface surf BlinnPhong 17 | #pragma target 3.0 18 | 19 | sampler2D _MainTex; 20 | sampler2D _BumpMap; 21 | sampler2D _ParallaxMap; 22 | fixed4 _Color; 23 | half _Shininess; 24 | float _Parallax; 25 | 26 | struct Input { 27 | float2 uv_MainTex; 28 | float2 uv_BumpMap; 29 | float3 viewDir; 30 | }; 31 | 32 | void surf (Input IN, inout SurfaceOutput o) { 33 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 34 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 35 | IN.uv_MainTex += offset; 36 | IN.uv_BumpMap += offset; 37 | 38 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 39 | o.Albedo = tex.rgb * _Color.rgb; 40 | o.Gloss = tex.a; 41 | o.Alpha = tex.a * _Color.a; 42 | o.Specular = _Shininess; 43 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 44 | } 45 | ENDCG 46 | } 47 | 48 | FallBack "Bumped Specular" 49 | } 50 | -------------------------------------------------------------------------------- /DefaultResources/Particle AddSmooth.shader: -------------------------------------------------------------------------------- 1 | Shader "Particles/Additive (Soft)" { 2 | Properties { 3 | _MainTex ("Particle Texture", 2D) = "white" {} 4 | _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 5 | } 6 | 7 | Category { 8 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 9 | Blend One OneMinusSrcColor 10 | ColorMask RGB 11 | Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) } 12 | BindChannels { 13 | Bind "Color", color 14 | Bind "Vertex", vertex 15 | Bind "TexCoord", texcoord 16 | } 17 | 18 | // ---- Fragment program cards 19 | SubShader { 20 | Pass { 21 | 22 | CGPROGRAM 23 | #pragma vertex vert 24 | #pragma fragment frag 25 | #pragma fragmentoption ARB_precision_hint_fastest 26 | #pragma multi_compile_particles 27 | 28 | #include "UnityCG.cginc" 29 | 30 | sampler2D _MainTex; 31 | fixed4 _TintColor; 32 | 33 | struct appdata_t { 34 | float4 vertex : POSITION; 35 | fixed4 color : COLOR; 36 | float2 texcoord : TEXCOORD0; 37 | }; 38 | 39 | struct v2f { 40 | float4 vertex : POSITION; 41 | fixed4 color : COLOR; 42 | float2 texcoord : TEXCOORD0; 43 | #ifdef SOFTPARTICLES_ON 44 | float4 projPos : TEXCOORD1; 45 | #endif 46 | }; 47 | 48 | float4 _MainTex_ST; 49 | 50 | v2f vert (appdata_t v) 51 | { 52 | v2f o; 53 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 54 | #ifdef SOFTPARTICLES_ON 55 | o.projPos = ComputeScreenPos (o.vertex); 56 | COMPUTE_EYEDEPTH(o.projPos.z); 57 | #endif 58 | o.color = v.color; 59 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 60 | return o; 61 | } 62 | 63 | sampler2D _CameraDepthTexture; 64 | float _InvFade; 65 | 66 | fixed4 frag (v2f i) : COLOR 67 | { 68 | #ifdef SOFTPARTICLES_ON 69 | float sceneZ = LinearEyeDepth (UNITY_SAMPLE_DEPTH(tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)))); 70 | float partZ = i.projPos.z; 71 | float fade = saturate (_InvFade * (sceneZ-partZ)); 72 | i.color.a *= fade; 73 | #endif 74 | 75 | half4 prev = i.color * tex2D(_MainTex, i.texcoord); 76 | prev.rgb *= prev.a; 77 | return prev; 78 | } 79 | ENDCG 80 | } 81 | } 82 | 83 | // ---- Dual texture cards 84 | SubShader { 85 | Pass { 86 | SetTexture [_MainTex] { 87 | combine texture * primary 88 | } 89 | SetTexture [_MainTex] { 90 | combine previous * previous alpha, previous 91 | } 92 | } 93 | } 94 | 95 | // ---- Single texture cards (does not do particle colors) 96 | SubShader { 97 | Pass { 98 | SetTexture [_MainTex] { 99 | combine texture * texture alpha, texture 100 | } 101 | } 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /DefaultResources/Particle Blend.shader: -------------------------------------------------------------------------------- 1 | Shader "Particles/Blend" { 2 | Properties { 3 | _MainTex ("Particle Texture", 2D) = "white" {} 4 | _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 5 | } 6 | 7 | Category { 8 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 9 | Blend DstColor One 10 | ColorMask RGB 11 | Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) } 12 | BindChannels { 13 | Bind "Color", color 14 | Bind "Vertex", vertex 15 | Bind "TexCoord", texcoord 16 | } 17 | 18 | SubShader { 19 | Pass { 20 | 21 | CGPROGRAM 22 | #pragma vertex vert 23 | #pragma fragment frag 24 | #pragma fragmentoption ARB_precision_hint_fastest 25 | #pragma multi_compile_particles 26 | 27 | #include "UnityCG.cginc" 28 | 29 | sampler2D _MainTex; 30 | fixed4 _TintColor; 31 | 32 | struct appdata_t { 33 | float4 vertex : POSITION; 34 | fixed4 color : COLOR; 35 | float2 texcoord : TEXCOORD0; 36 | }; 37 | 38 | struct v2f { 39 | float4 vertex : POSITION; 40 | fixed4 color : COLOR; 41 | float2 texcoord : TEXCOORD0; 42 | #ifdef SOFTPARTICLES_ON 43 | float4 projPos : TEXCOORD1; 44 | #endif 45 | }; 46 | 47 | float4 _MainTex_ST; 48 | 49 | v2f vert (appdata_t v) 50 | { 51 | v2f o; 52 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 53 | #ifdef SOFTPARTICLES_ON 54 | o.projPos = ComputeScreenPos (o.vertex); 55 | COMPUTE_EYEDEPTH(o.projPos.z); 56 | #endif 57 | o.color = v.color; 58 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 59 | return o; 60 | } 61 | 62 | sampler2D _CameraDepthTexture; 63 | float _InvFade; 64 | 65 | fixed4 frag (v2f i) : COLOR 66 | { 67 | #ifdef SOFTPARTICLES_ON 68 | float sceneZ = LinearEyeDepth (UNITY_SAMPLE_DEPTH(tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)))); 69 | float partZ = i.projPos.z; 70 | float fade = saturate (_InvFade * (sceneZ-partZ)); 71 | i.color *= fade; 72 | #endif 73 | 74 | return i.color * tex2D(_MainTex, i.texcoord); 75 | } 76 | ENDCG 77 | } 78 | } 79 | 80 | SubShader { 81 | Pass { 82 | SetTexture [_MainTex] { combine texture * primary } 83 | } 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /DefaultResources/Particle Premultiply Blend.shader: -------------------------------------------------------------------------------- 1 | Shader "Particles/Alpha Blended Premultiply" { 2 | Properties { 3 | _MainTex ("Particle Texture", 2D) = "white" {} 4 | _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 5 | } 6 | 7 | Category { 8 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 9 | Blend One OneMinusSrcAlpha 10 | ColorMask RGB 11 | Cull Off Lighting Off ZWrite Off Fog { Mode Off } 12 | BindChannels { 13 | Bind "Color", color 14 | Bind "Vertex", vertex 15 | Bind "TexCoord", texcoord 16 | } 17 | 18 | // ---- Fragment program cards 19 | SubShader { 20 | Pass { 21 | 22 | CGPROGRAM 23 | #pragma vertex vert 24 | #pragma fragment frag 25 | #pragma fragmentoption ARB_precision_hint_fastest 26 | #pragma multi_compile_particles 27 | 28 | #include "UnityCG.cginc" 29 | 30 | sampler2D _MainTex; 31 | fixed4 _TintColor; 32 | 33 | struct appdata_t { 34 | float4 vertex : POSITION; 35 | fixed4 color : COLOR; 36 | float2 texcoord : TEXCOORD0; 37 | }; 38 | 39 | struct v2f { 40 | float4 vertex : POSITION; 41 | fixed4 color : COLOR; 42 | float2 texcoord : TEXCOORD0; 43 | #ifdef SOFTPARTICLES_ON 44 | float4 projPos : TEXCOORD1; 45 | #endif 46 | }; 47 | 48 | float4 _MainTex_ST; 49 | 50 | v2f vert (appdata_t v) 51 | { 52 | v2f o; 53 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 54 | #ifdef SOFTPARTICLES_ON 55 | o.projPos = ComputeScreenPos (o.vertex); 56 | COMPUTE_EYEDEPTH(o.projPos.z); 57 | #endif 58 | o.color = v.color; 59 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 60 | return o; 61 | } 62 | 63 | sampler2D _CameraDepthTexture; 64 | float _InvFade; 65 | 66 | fixed4 frag (v2f i) : COLOR 67 | { 68 | #ifdef SOFTPARTICLES_ON 69 | float sceneZ = LinearEyeDepth (UNITY_SAMPLE_DEPTH(tex2Dproj(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos)))); 70 | float partZ = i.projPos.z; 71 | float fade = saturate (_InvFade * (sceneZ-partZ)); 72 | i.color.a *= fade; 73 | #endif 74 | 75 | return i.color * tex2D(_MainTex, i.texcoord) * i.color.a; 76 | } 77 | ENDCG 78 | } 79 | } 80 | 81 | // ---- Dual texture cards 82 | SubShader { 83 | Pass { 84 | SetTexture [_MainTex] { 85 | combine primary * primary alpha 86 | } 87 | SetTexture [_MainTex] { 88 | combine previous * texture 89 | } 90 | } 91 | } 92 | 93 | // ---- Single texture cards (not entirely correct) 94 | SubShader { 95 | Pass { 96 | SetTexture [_MainTex] { 97 | combine texture * primary 98 | } 99 | } 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /DefaultResources/Particle VertexLit Blended.shader: -------------------------------------------------------------------------------- 1 | Shader "Particles/VertexLit Blended" { 2 | Properties { 3 | _EmisColor ("Emissive Color", Color) = (.2,.2,.2,0) 4 | _MainTex ("Particle Texture", 2D) = "white" {} 5 | } 6 | 7 | SubShader { 8 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 9 | Tags { "LightMode" = "Vertex" } 10 | Cull Off 11 | Lighting On 12 | Material { Emission [_EmisColor] } 13 | ColorMaterial AmbientAndDiffuse 14 | ZWrite Off 15 | ColorMask RGB 16 | Blend SrcAlpha OneMinusSrcAlpha 17 | AlphaTest Greater .001 18 | Pass { 19 | SetTexture [_MainTex] { combine primary * texture } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /DefaultResources/Reflect-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Reflective/Bumped Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5,0.5,0.5,1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 7 | _MainTex ("Base (RGB) RefStrGloss (A)", 2D) = "white" {} 8 | _Cube ("Reflection Cubemap", Cube) = "" { TexGen CubeReflect } 9 | _BumpMap ("Normalmap", 2D) = "bump" {} 10 | } 11 | 12 | SubShader { 13 | Tags { "RenderType"="Opaque" } 14 | LOD 400 15 | CGPROGRAM 16 | #pragma surface surf BlinnPhong 17 | #pragma target 3.0 18 | //input limit (8) exceeded, shader uses 9 19 | #pragma exclude_renderers d3d11_9x 20 | 21 | sampler2D _MainTex; 22 | sampler2D _BumpMap; 23 | samplerCUBE _Cube; 24 | 25 | fixed4 _Color; 26 | fixed4 _ReflectColor; 27 | half _Shininess; 28 | 29 | struct Input { 30 | float2 uv_MainTex; 31 | float2 uv_BumpMap; 32 | float3 worldRefl; 33 | INTERNAL_DATA 34 | }; 35 | 36 | void surf (Input IN, inout SurfaceOutput o) { 37 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 38 | fixed4 c = tex * _Color; 39 | o.Albedo = c.rgb; 40 | 41 | o.Gloss = tex.a; 42 | o.Specular = _Shininess; 43 | 44 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 45 | 46 | float3 worldRefl = WorldReflectionVector (IN, o.Normal); 47 | fixed4 reflcol = texCUBE (_Cube, worldRefl); 48 | reflcol *= tex.a; 49 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 50 | o.Alpha = reflcol.a * _ReflectColor.a; 51 | } 52 | ENDCG 53 | } 54 | 55 | FallBack "Reflective/Bumped Diffuse" 56 | } 57 | -------------------------------------------------------------------------------- /DefaultResources/Reflect-BumpVertexLit.shader: -------------------------------------------------------------------------------- 1 | Shader "Reflective/Bumped VertexLit" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Spec Color", Color) = (1,1,1,1) 5 | _Shininess ("Shininess", Range (0.1, 1)) = 0.7 6 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 7 | _MainTex ("Base (RGB) RefStrength (A)", 2D) = "white" {} 8 | _Cube ("Reflection Cubemap", Cube) = "" { TexGen CubeReflect } 9 | _BumpMap ("Normalmap", 2D) = "bump" {} 10 | } 11 | 12 | Category { 13 | Tags { "RenderType"="Opaque" } 14 | LOD 250 15 | SubShader { 16 | UsePass "Reflective/Bumped Unlit/BASE" 17 | Pass { 18 | Tags { "LightMode" = "Vertex" } 19 | Blend One One ZWrite Off Fog { Color (0,0,0,0) } 20 | Material { 21 | Diffuse [_Color] 22 | Ambient [_Color] 23 | Shininess [_Shininess] 24 | Specular [_SpecColor] 25 | Emission [_Emission] 26 | } 27 | Lighting On 28 | SeparateSpecular On 29 | SetTexture [_MainTex] { 30 | constantColor [_Color] 31 | Combine texture * primary DOUBLE, texture * primary 32 | } 33 | } 34 | } 35 | } 36 | 37 | FallBack "Reflective/VertexLit" 38 | } 39 | -------------------------------------------------------------------------------- /DefaultResources/Reflect-Bumped.shader: -------------------------------------------------------------------------------- 1 | Shader "Reflective/Bumped Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 5 | _MainTex ("Base (RGB) RefStrength (A)", 2D) = "white" {} 6 | _Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect } 7 | _BumpMap ("Normalmap", 2D) = "bump" {} 8 | } 9 | 10 | SubShader { 11 | Tags { "RenderType"="Opaque" } 12 | LOD 300 13 | 14 | CGPROGRAM 15 | #pragma surface surf Lambert 16 | #pragma exclude_renderers d3d11_9x 17 | 18 | sampler2D _MainTex; 19 | sampler2D _BumpMap; 20 | samplerCUBE _Cube; 21 | 22 | fixed4 _Color; 23 | fixed4 _ReflectColor; 24 | 25 | struct Input { 26 | float2 uv_MainTex; 27 | float2 uv_BumpMap; 28 | float3 worldRefl; 29 | INTERNAL_DATA 30 | }; 31 | 32 | void surf (Input IN, inout SurfaceOutput o) { 33 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 34 | fixed4 c = tex * _Color; 35 | o.Albedo = c.rgb; 36 | 37 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 38 | 39 | float3 worldRefl = WorldReflectionVector (IN, o.Normal); 40 | fixed4 reflcol = texCUBE (_Cube, worldRefl); 41 | reflcol *= tex.a; 42 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 43 | o.Alpha = reflcol.a * _ReflectColor.a; 44 | } 45 | ENDCG 46 | } 47 | 48 | FallBack "Reflective/VertexLit" 49 | } 50 | -------------------------------------------------------------------------------- /DefaultResources/Reflect-Diffuse.shader: -------------------------------------------------------------------------------- 1 | Shader "Reflective/Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 5 | _MainTex ("Base (RGB) RefStrength (A)", 2D) = "white" {} 6 | _Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect } 7 | } 8 | SubShader { 9 | LOD 200 10 | Tags { "RenderType"="Opaque" } 11 | 12 | CGPROGRAM 13 | #pragma surface surf Lambert 14 | 15 | sampler2D _MainTex; 16 | samplerCUBE _Cube; 17 | 18 | fixed4 _Color; 19 | fixed4 _ReflectColor; 20 | 21 | struct Input { 22 | float2 uv_MainTex; 23 | float3 worldRefl; 24 | }; 25 | 26 | void surf (Input IN, inout SurfaceOutput o) { 27 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 28 | fixed4 c = tex * _Color; 29 | o.Albedo = c.rgb; 30 | 31 | fixed4 reflcol = texCUBE (_Cube, IN.worldRefl); 32 | reflcol *= tex.a; 33 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 34 | o.Alpha = reflcol.a * _ReflectColor.a; 35 | } 36 | ENDCG 37 | } 38 | 39 | FallBack "Reflective/VertexLit" 40 | } 41 | -------------------------------------------------------------------------------- /DefaultResources/Reflect-Glossy.shader: -------------------------------------------------------------------------------- 1 | Shader "Reflective/Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 7 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 8 | _Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect } 9 | } 10 | SubShader { 11 | LOD 300 12 | Tags { "RenderType"="Opaque" } 13 | 14 | CGPROGRAM 15 | #pragma surface surf BlinnPhong 16 | 17 | sampler2D _MainTex; 18 | samplerCUBE _Cube; 19 | 20 | fixed4 _Color; 21 | fixed4 _ReflectColor; 22 | half _Shininess; 23 | 24 | struct Input { 25 | float2 uv_MainTex; 26 | float3 worldRefl; 27 | }; 28 | 29 | void surf (Input IN, inout SurfaceOutput o) { 30 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 31 | fixed4 c = tex * _Color; 32 | o.Albedo = c.rgb; 33 | o.Gloss = tex.a; 34 | o.Specular = _Shininess; 35 | 36 | fixed4 reflcol = texCUBE (_Cube, IN.worldRefl); 37 | reflcol *= tex.a; 38 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 39 | o.Alpha = reflcol.a * _ReflectColor.a; 40 | } 41 | ENDCG 42 | } 43 | 44 | FallBack "Reflective/VertexLit" 45 | } 46 | -------------------------------------------------------------------------------- /DefaultResources/Reflect-Parallax.shader: -------------------------------------------------------------------------------- 1 | Shader "Reflective/Parallax Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 5 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 6 | _MainTex ("Base (RGB) RefStrength (A)", 2D) = "white" {} 7 | _Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect } 8 | _BumpMap ("Normalmap", 2D) = "bump" {} 9 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 10 | } 11 | SubShader { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 500 14 | 15 | CGPROGRAM 16 | #pragma surface surf Lambert 17 | #pragma target 3.0 18 | //input limit (8) exceeded, shader uses 9 19 | #pragma exclude_renderers d3d11_9x 20 | 21 | sampler2D _MainTex; 22 | sampler2D _BumpMap; 23 | samplerCUBE _Cube; 24 | sampler2D _ParallaxMap; 25 | 26 | fixed4 _Color; 27 | fixed4 _ReflectColor; 28 | float _Parallax; 29 | 30 | struct Input { 31 | float2 uv_MainTex; 32 | float2 uv_BumpMap; 33 | float3 worldRefl; 34 | float3 viewDir; 35 | INTERNAL_DATA 36 | }; 37 | 38 | void surf (Input IN, inout SurfaceOutput o) { 39 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 40 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 41 | IN.uv_MainTex += offset; 42 | IN.uv_BumpMap += offset; 43 | 44 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 45 | fixed4 c = tex * _Color; 46 | o.Albedo = c.rgb; 47 | 48 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 49 | 50 | float3 worldRefl = WorldReflectionVector (IN, o.Normal); 51 | fixed4 reflcol = texCUBE (_Cube, worldRefl); 52 | reflcol *= tex.a; 53 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 54 | o.Alpha = reflcol.a * _ReflectColor.a; 55 | } 56 | ENDCG 57 | } 58 | 59 | FallBack "Reflective/Bumped Diffuse" 60 | } 61 | -------------------------------------------------------------------------------- /DefaultResources/Reflect-ParallaxSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Reflective/Parallax Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5,0.5,0.5,1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 7 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 8 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" { } 9 | _Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect } 10 | _BumpMap ("Normalmap", 2D) = "bump" { } 11 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 12 | } 13 | SubShader { 14 | Tags { "RenderType"="Opaque" } 15 | LOD 600 16 | 17 | CGPROGRAM 18 | #pragma surface surf BlinnPhong 19 | #pragma target 3.0 20 | //input limit (8) exceeded, shader uses 9 21 | #pragma exclude_renderers d3d11_9x 22 | 23 | sampler2D _MainTex; 24 | sampler2D _BumpMap; 25 | samplerCUBE _Cube; 26 | sampler2D _ParallaxMap; 27 | 28 | fixed4 _Color; 29 | fixed4 _ReflectColor; 30 | half _Shininess; 31 | float _Parallax; 32 | 33 | struct Input { 34 | float2 uv_MainTex; 35 | float2 uv_BumpMap; 36 | float3 worldRefl; 37 | float3 viewDir; 38 | INTERNAL_DATA 39 | }; 40 | 41 | void surf (Input IN, inout SurfaceOutput o) { 42 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 43 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 44 | IN.uv_MainTex += offset; 45 | IN.uv_BumpMap += offset; 46 | 47 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 48 | o.Albedo = tex.rgb * _Color.rgb; 49 | o.Gloss = tex.a; 50 | o.Specular = _Shininess; 51 | 52 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 53 | 54 | float3 worldRefl = WorldReflectionVector (IN, o.Normal); 55 | fixed4 reflcol = texCUBE (_Cube, worldRefl); 56 | reflcol *= tex.a; 57 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 58 | o.Alpha = reflcol.a * _ReflectColor.a; 59 | } 60 | ENDCG 61 | } 62 | 63 | FallBack "Reflective/Bumped Specular" 64 | } 65 | -------------------------------------------------------------------------------- /DefaultResources/Shadow-ScreenBlur.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/Shadow-ScreenBlur" { 2 | Properties { 3 | _MainTex ("Base", 2D) = "white" {} 4 | } 5 | SubShader { 6 | Pass { 7 | ZTest Always Cull Off ZWrite Off 8 | Fog { Mode off } 9 | 10 | CGPROGRAM 11 | #pragma vertex vert 12 | #pragma fragment frag 13 | #pragma exclude_renderers noshadows 14 | #include "UnityCG.cginc" 15 | 16 | v2f_img vert (appdata_img v) 17 | { 18 | v2f_img o; 19 | o.pos = mul (UNITY_MATRIX_MVP, v.vertex); 20 | o.uv = v.texcoord.xy; 21 | #if SHADER_API_FLASH 22 | o.uv.xy *= unity_NPOTScale.xy; 23 | #endif 24 | return o; 25 | } 26 | 27 | 28 | uniform sampler2D _MainTex; 29 | 30 | // x,y of each - sample offset for blur 31 | uniform float4 _BlurOffsets0; 32 | uniform float4 _BlurOffsets1; 33 | uniform float4 _BlurOffsets2; 34 | uniform float4 _BlurOffsets3; 35 | uniform float4 _BlurOffsets4; 36 | uniform float4 _BlurOffsets5; 37 | uniform float4 _BlurOffsets6; 38 | uniform float4 _BlurOffsets7; 39 | 40 | float4 unity_ShadowBlurParams; 41 | 42 | 43 | 44 | #define LOOP_ITERATION(i) { \ 45 | float4 theSample = tex2D( _MainTex, (coord + radius * _BlurOffsets##i).xy ); \ 46 | float sampleDist = theSample.b + theSample.a / 255.0; \ 47 | float diff = dist - sampleDist; \ 48 | diff = saturate( diffTolerance - abs(diff) ); \ 49 | mask.xy += diff * theSample.xy; } 50 | 51 | fixed4 frag (v2f_img i) : SV_Target 52 | { 53 | float4 coord = float4(i.uv,0,0); 54 | float4 mask = tex2D( _MainTex, coord.xy ); 55 | float dist = mask.b + mask.a / 255.0; 56 | float radius = saturate(unity_ShadowBlurParams.y / (1.0-dist)); 57 | 58 | float diffTolerance = unity_ShadowBlurParams.x; 59 | 60 | mask.xy *= diffTolerance; 61 | 62 | // Would this code look better in a loop? You bet. 63 | // But, that requires using a uniform array in GLSL, 64 | // which means that shaderlab would need support for array parameters. 65 | // So, until we have that, this needs to be unrolled to work in GLSL, 66 | // then we can revert to the looped version. 67 | 68 | LOOP_ITERATION (0); 69 | LOOP_ITERATION (1); 70 | LOOP_ITERATION (2); 71 | LOOP_ITERATION (3); 72 | 73 | // In Flash, due to very limited register count we can't do more samples :( 74 | #ifndef SHADER_API_FLASH 75 | LOOP_ITERATION (4); 76 | LOOP_ITERATION (5); 77 | LOOP_ITERATION (6); 78 | LOOP_ITERATION (7); 79 | #endif 80 | 81 | float shadow = mask.x / mask.y; 82 | return shadow; 83 | } 84 | ENDCG 85 | } 86 | } 87 | 88 | Fallback Off 89 | } -------------------------------------------------------------------------------- /DefaultResources/Sprites-Default.shader: -------------------------------------------------------------------------------- 1 | Shader "Sprites/Default" 2 | { 3 | Properties 4 | { 5 | [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} 6 | _Color ("Tint", Color) = (1,1,1,1) 7 | [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 8 | } 9 | 10 | SubShader 11 | { 12 | Tags 13 | { 14 | "Queue"="Transparent" 15 | "IgnoreProjector"="True" 16 | "RenderType"="Transparent" 17 | "PreviewType"="Plane" 18 | "CanUseSpriteAtlas"="True" 19 | } 20 | 21 | Cull Off 22 | Lighting Off 23 | ZWrite Off 24 | Fog { Mode Off } 25 | Blend One OneMinusSrcAlpha 26 | 27 | Pass 28 | { 29 | CGPROGRAM 30 | #pragma vertex vert 31 | #pragma fragment frag 32 | #pragma multi_compile DUMMY PIXELSNAP_ON 33 | #include "UnityCG.cginc" 34 | 35 | struct appdata_t 36 | { 37 | float4 vertex : POSITION; 38 | float4 color : COLOR; 39 | float2 texcoord : TEXCOORD0; 40 | }; 41 | 42 | struct v2f 43 | { 44 | float4 vertex : SV_POSITION; 45 | fixed4 color : COLOR; 46 | half2 texcoord : TEXCOORD0; 47 | }; 48 | 49 | fixed4 _Color; 50 | 51 | v2f vert(appdata_t IN) 52 | { 53 | v2f OUT; 54 | OUT.vertex = mul(UNITY_MATRIX_MVP, IN.vertex); 55 | OUT.texcoord = IN.texcoord; 56 | OUT.color = IN.color * _Color; 57 | #ifdef PIXELSNAP_ON 58 | OUT.vertex = UnityPixelSnap (OUT.vertex); 59 | #endif 60 | 61 | return OUT; 62 | } 63 | 64 | sampler2D _MainTex; 65 | 66 | fixed4 frag(v2f IN) : SV_Target 67 | { 68 | fixed4 c = tex2D(_MainTex, IN.texcoord) * IN.color; 69 | c.rgb *= c.a; 70 | return c; 71 | } 72 | ENDCG 73 | } 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /DefaultResources/TerrainShaders/Details/VertexLit.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/TerrainEngine/Details/Vertexlit" { 2 | Properties { 3 | _MainTex ("Main Texture", 2D) = "white" { } 4 | } 5 | SubShader { 6 | Tags { "RenderType"="Opaque" } 7 | LOD 200 8 | 9 | CGPROGRAM 10 | #pragma surface surf Lambert 11 | 12 | sampler2D _MainTex; 13 | 14 | struct Input { 15 | float2 uv_MainTex; 16 | fixed4 color : COLOR; 17 | }; 18 | 19 | void surf (Input IN, inout SurfaceOutput o) { 20 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * IN.color; 21 | o.Albedo = c.rgb; 22 | o.Alpha = c.a; 23 | } 24 | 25 | ENDCG 26 | } 27 | SubShader { 28 | Tags { "RenderType"="Opaque" } 29 | Pass { 30 | Tags { "LightMode" = "Vertex" } 31 | ColorMaterial AmbientAndDiffuse 32 | Lighting On 33 | SetTexture [_MainTex] { 34 | combine texture * primary DOUBLE, texture * primary 35 | } 36 | } 37 | Pass { 38 | Tags { "LightMode" = "VertexLMRGBM" } 39 | ColorMaterial AmbientAndDiffuse 40 | BindChannels { 41 | Bind "Vertex", vertex 42 | Bind "texcoord1", texcoord0 // lightmap uses 2nd uv 43 | Bind "texcoord", texcoord1 // main uses 1st uv 44 | } 45 | SetTexture [unity_Lightmap] { 46 | matrix [unity_LightmapMatrix] 47 | combine texture * texture alpha DOUBLE 48 | } 49 | SetTexture [_MainTex] { combine texture * previous QUAD, texture } 50 | } 51 | } 52 | 53 | Fallback "VertexLit" 54 | } 55 | -------------------------------------------------------------------------------- /DefaultResources/TerrainShaders/Details/WavingGrass.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/TerrainEngine/Details/WavingDoublePass" { 2 | Properties { 3 | _WavingTint ("Fade Color", Color) = (.7,.6,.5, 0) 4 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 5 | _WaveAndDistance ("Wave and distance", Vector) = (12, 3.6, 1, 1) 6 | _Cutoff ("Cutoff", float) = 0.5 7 | } 8 | 9 | SubShader { 10 | Tags { 11 | "Queue" = "Geometry+200" 12 | "IgnoreProjector"="True" 13 | "RenderType"="Grass" 14 | } 15 | Cull Off 16 | LOD 200 17 | ColorMask RGB 18 | 19 | CGPROGRAM 20 | #pragma surface surf Lambert vertex:WavingGrassVert addshadow 21 | #pragma exclude_renderers flash 22 | #include "TerrainEngine.cginc" 23 | 24 | sampler2D _MainTex; 25 | fixed _Cutoff; 26 | 27 | struct Input { 28 | float2 uv_MainTex; 29 | fixed4 color : COLOR; 30 | }; 31 | 32 | void surf (Input IN, inout SurfaceOutput o) { 33 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * IN.color; 34 | o.Albedo = c.rgb; 35 | o.Alpha = c.a; 36 | clip (o.Alpha - _Cutoff); 37 | o.Alpha *= IN.color.a; 38 | } 39 | ENDCG 40 | } 41 | 42 | SubShader { 43 | Tags { 44 | "Queue" = "Geometry+200" 45 | "IgnoreProjector"="True" 46 | "RenderType"="Grass" 47 | } 48 | Cull Off 49 | LOD 200 50 | ColorMask RGB 51 | 52 | Pass { 53 | Tags { "LightMode" = "Vertex" } 54 | Material { 55 | Diffuse (1,1,1,1) 56 | Ambient (1,1,1,1) 57 | } 58 | Lighting On 59 | ColorMaterial AmbientAndDiffuse 60 | AlphaTest Greater [_Cutoff] 61 | SetTexture [_MainTex] { combine texture * primary DOUBLE, texture } 62 | } 63 | Pass { 64 | Tags { "LightMode" = "VertexLMRGBM" } 65 | AlphaTest Greater [_Cutoff] 66 | BindChannels { 67 | Bind "Vertex", vertex 68 | Bind "texcoord1", texcoord0 // lightmap uses 2nd uv 69 | Bind "texcoord", texcoord1 // main uses 1st uv 70 | } 71 | SetTexture [unity_Lightmap] { 72 | matrix [unity_LightmapMatrix] 73 | combine texture * texture alpha DOUBLE 74 | } 75 | SetTexture [_MainTex] { combine texture * previous QUAD, texture } 76 | } 77 | } 78 | 79 | Fallback Off 80 | } 81 | -------------------------------------------------------------------------------- /DefaultResources/TerrainShaders/Details/WavingGrassBillboard.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/TerrainEngine/Details/BillboardWavingDoublePass" { 2 | Properties { 3 | _WavingTint ("Fade Color", Color) = (.7,.6,.5, 0) 4 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 5 | _WaveAndDistance ("Wave and distance", Vector) = (12, 3.6, 1, 1) 6 | _Cutoff ("Cutoff", float) = 0.5 7 | } 8 | 9 | CGINCLUDE 10 | #include "UnityCG.cginc" 11 | #include "TerrainEngine.cginc" 12 | #pragma glsl_no_auto_normalization 13 | 14 | struct v2f { 15 | float4 pos : POSITION; 16 | fixed4 color : COLOR; 17 | float4 uv : TEXCOORD0; 18 | }; 19 | v2f BillboardVert (appdata_full v) { 20 | v2f o; 21 | WavingGrassBillboardVert (v); 22 | o.color = v.color; 23 | 24 | o.color.rgb *= ShadeVertexLights (v.vertex, v.normal); 25 | 26 | o.pos = mul (UNITY_MATRIX_MVP, v.vertex); 27 | o.uv = v.texcoord; 28 | return o; 29 | } 30 | ENDCG 31 | 32 | SubShader { 33 | Tags { 34 | "Queue" = "Geometry+200" 35 | "IgnoreProjector"="True" 36 | "RenderType"="GrassBillboard" 37 | } 38 | Cull Off 39 | LOD 200 40 | ColorMask RGB 41 | 42 | CGPROGRAM 43 | #pragma surface surf Lambert vertex:WavingGrassBillboardVert addshadow 44 | #pragma exclude_renderers flash 45 | 46 | sampler2D _MainTex; 47 | fixed _Cutoff; 48 | 49 | struct Input { 50 | float2 uv_MainTex; 51 | fixed4 color : COLOR; 52 | }; 53 | 54 | void surf (Input IN, inout SurfaceOutput o) { 55 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * IN.color; 56 | o.Albedo = c.rgb; 57 | o.Alpha = c.a; 58 | clip (o.Alpha - _Cutoff); 59 | o.Alpha *= IN.color.a; 60 | } 61 | 62 | ENDCG 63 | } 64 | 65 | SubShader { 66 | Tags { 67 | "Queue" = "Geometry+200" 68 | "IgnoreProjector"="True" 69 | "RenderType"="GrassBillboard" 70 | } 71 | 72 | ColorMask RGB 73 | Cull Off 74 | Lighting On 75 | 76 | Pass { 77 | CGPROGRAM 78 | #pragma vertex BillboardVert 79 | #pragma exclude_renderers shaderonly 80 | ENDCG 81 | 82 | AlphaTest Greater [_Cutoff] 83 | 84 | SetTexture [_MainTex] { combine texture * primary DOUBLE, texture * primary } 85 | } 86 | } 87 | 88 | Fallback Off 89 | } 90 | -------------------------------------------------------------------------------- /DefaultResources/TerrainShaders/Splats/AddPass.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/TerrainEngine/Splatmap/Lightmap-AddPass" { 2 | Properties { 3 | _Control ("Control (RGBA)", 2D) = "black" {} 4 | _Splat3 ("Layer 3 (A)", 2D) = "white" {} 5 | _Splat2 ("Layer 2 (B)", 2D) = "white" {} 6 | _Splat1 ("Layer 1 (G)", 2D) = "white" {} 7 | _Splat0 ("Layer 0 (R)", 2D) = "white" {} 8 | } 9 | 10 | SubShader { 11 | Tags { 12 | "SplatCount" = "4" 13 | "Queue" = "Geometry-99" 14 | "IgnoreProjector"="True" 15 | "RenderType" = "Opaque" 16 | } 17 | 18 | CGPROGRAM 19 | #pragma surface surf Lambert decal:add 20 | struct Input { 21 | float2 uv_Control : TEXCOORD0; 22 | float2 uv_Splat0 : TEXCOORD1; 23 | float2 uv_Splat1 : TEXCOORD2; 24 | float2 uv_Splat2 : TEXCOORD3; 25 | float2 uv_Splat3 : TEXCOORD4; 26 | }; 27 | 28 | sampler2D _Control; 29 | sampler2D _Splat0,_Splat1,_Splat2,_Splat3; 30 | 31 | void surf (Input IN, inout SurfaceOutput o) { 32 | fixed4 splat_control = tex2D (_Control, IN.uv_Control); 33 | fixed3 col; 34 | col = splat_control.r * tex2D (_Splat0, IN.uv_Splat0).rgb; 35 | col += splat_control.g * tex2D (_Splat1, IN.uv_Splat1).rgb; 36 | col += splat_control.b * tex2D (_Splat2, IN.uv_Splat2).rgb; 37 | col += splat_control.a * tex2D (_Splat3, IN.uv_Splat3).rgb; 38 | o.Albedo = col; 39 | o.Alpha = 0.0; 40 | } 41 | ENDCG 42 | } 43 | 44 | Fallback off 45 | } 46 | -------------------------------------------------------------------------------- /DefaultResources/TerrainShaders/Splats/FirstPass.shader: -------------------------------------------------------------------------------- 1 | Shader "Nature/Terrain/Diffuse" { 2 | Properties { 3 | [HideInInspector] _Control ("Control (RGBA)", 2D) = "red" {} 4 | [HideInInspector] _Splat3 ("Layer 3 (A)", 2D) = "white" {} 5 | [HideInInspector] _Splat2 ("Layer 2 (B)", 2D) = "white" {} 6 | [HideInInspector] _Splat1 ("Layer 1 (G)", 2D) = "white" {} 7 | [HideInInspector] _Splat0 ("Layer 0 (R)", 2D) = "white" {} 8 | // used in fallback on old cards & base map 9 | [HideInInspector] _MainTex ("BaseMap (RGB)", 2D) = "white" {} 10 | [HideInInspector] _Color ("Main Color", Color) = (1,1,1,1) 11 | } 12 | 13 | SubShader { 14 | Tags { 15 | "SplatCount" = "4" 16 | "Queue" = "Geometry-100" 17 | "RenderType" = "Opaque" 18 | } 19 | CGPROGRAM 20 | #pragma surface surf Lambert 21 | struct Input { 22 | float2 uv_Control : TEXCOORD0; 23 | float2 uv_Splat0 : TEXCOORD1; 24 | float2 uv_Splat1 : TEXCOORD2; 25 | float2 uv_Splat2 : TEXCOORD3; 26 | float2 uv_Splat3 : TEXCOORD4; 27 | }; 28 | 29 | sampler2D _Control; 30 | sampler2D _Splat0,_Splat1,_Splat2,_Splat3; 31 | 32 | void surf (Input IN, inout SurfaceOutput o) { 33 | fixed4 splat_control = tex2D (_Control, IN.uv_Control); 34 | fixed3 col; 35 | col = splat_control.r * tex2D (_Splat0, IN.uv_Splat0).rgb; 36 | col += splat_control.g * tex2D (_Splat1, IN.uv_Splat1).rgb; 37 | col += splat_control.b * tex2D (_Splat2, IN.uv_Splat2).rgb; 38 | col += splat_control.a * tex2D (_Splat3, IN.uv_Splat3).rgb; 39 | o.Albedo = col; 40 | o.Alpha = 0.0; 41 | } 42 | ENDCG 43 | } 44 | 45 | Dependency "AddPassShader" = "Hidden/TerrainEngine/Splatmap/Lightmap-AddPass" 46 | Dependency "BaseMapShader" = "Diffuse" 47 | 48 | // Fallback to Diffuse 49 | Fallback "Diffuse" 50 | } 51 | -------------------------------------------------------------------------------- /DefaultResources/TerrainShaders/Trees/BillboardTree.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/TerrainEngine/BillboardTree" { 2 | Properties { 3 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 4 | } 5 | 6 | SubShader { 7 | Tags { "Queue" = "Transparent-100" "IgnoreProjector"="True" "RenderType"="TreeBillboard" } 8 | 9 | Pass { 10 | ColorMask rgb 11 | Blend SrcAlpha OneMinusSrcAlpha 12 | ZWrite Off Cull Off 13 | 14 | CGPROGRAM 15 | #pragma vertex vert 16 | #include "UnityCG.cginc" 17 | #include "TerrainEngine.cginc" 18 | #pragma fragment frag 19 | 20 | struct v2f { 21 | float4 pos : POSITION; 22 | fixed4 color : COLOR0; 23 | float2 uv : TEXCOORD0; 24 | }; 25 | 26 | v2f vert (appdata_tree_billboard v) { 27 | v2f o; 28 | TerrainBillboardTree(v.vertex, v.texcoord1.xy, v.texcoord.y); 29 | o.pos = mul (UNITY_MATRIX_MVP, v.vertex); 30 | o.uv.x = v.texcoord.x; 31 | o.uv.y = v.texcoord.y > 0; 32 | o.color = v.color; 33 | return o; 34 | } 35 | 36 | sampler2D _MainTex; 37 | fixed4 frag(v2f input) : COLOR 38 | { 39 | fixed4 col = tex2D( _MainTex, input.uv); 40 | col.rgb *= input.color.rgb; 41 | clip(col.a); 42 | return col; 43 | } 44 | ENDCG 45 | } 46 | } 47 | 48 | SubShader { 49 | Tags { "Queue" = "Transparent-100" "IgnoreProjector"="True" "RenderType"="TreeBillboard" } 50 | 51 | Pass { 52 | 53 | CGPROGRAM 54 | #pragma vertex vert 55 | #pragma exclude_renderers shaderonly 56 | #include "UnityCG.cginc" 57 | #include "TerrainEngine.cginc" 58 | 59 | struct v2f { 60 | float4 pos : POSITION; 61 | fixed4 color : COLOR0; 62 | float2 uv : TEXCOORD0; 63 | }; 64 | 65 | v2f vert (appdata_tree_billboard v) { 66 | v2f o; 67 | TerrainBillboardTree(v.vertex, v.texcoord1.xy, v.texcoord.y); 68 | o.pos = mul (UNITY_MATRIX_MVP, v.vertex); 69 | o.uv.x = v.texcoord.x; 70 | o.uv.y = v.texcoord.y > 0; 71 | o.color = v.color; 72 | return o; 73 | } 74 | ENDCG 75 | 76 | ColorMask rgb 77 | Blend SrcAlpha OneMinusSrcAlpha 78 | ZWrite Off Cull Off 79 | 80 | AlphaTest Greater 0 81 | SetTexture [_MainTex] { combine texture * primary, texture } 82 | } 83 | } 84 | 85 | Fallback Off 86 | } -------------------------------------------------------------------------------- /DefaultResources/skybox cubed.shader: -------------------------------------------------------------------------------- 1 | Shader "RenderFX/Skybox Cubed" { 2 | Properties { 3 | _Tint ("Tint Color", Color) = (.5, .5, .5, .5) 4 | _Tex ("Cubemap", Cube) = "white" {} 5 | } 6 | 7 | SubShader { 8 | Tags { "Queue"="Background" "RenderType"="Background" } 9 | Cull Off ZWrite Off Fog { Mode Off } 10 | 11 | Pass { 12 | 13 | CGPROGRAM 14 | #pragma vertex vert 15 | #pragma fragment frag 16 | #pragma fragmentoption ARB_precision_hint_fastest 17 | 18 | #include "UnityCG.cginc" 19 | 20 | samplerCUBE _Tex; 21 | fixed4 _Tint; 22 | 23 | struct appdata_t { 24 | float4 vertex : POSITION; 25 | float3 texcoord : TEXCOORD0; 26 | }; 27 | 28 | struct v2f { 29 | float4 vertex : POSITION; 30 | float3 texcoord : TEXCOORD0; 31 | }; 32 | 33 | v2f vert (appdata_t v) 34 | { 35 | v2f o; 36 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 37 | o.texcoord = v.texcoord; 38 | return o; 39 | } 40 | 41 | fixed4 frag (v2f i) : COLOR 42 | { 43 | fixed4 tex = texCUBE (_Tex, i.texcoord); 44 | fixed4 col; 45 | col.rgb = tex.rgb + _Tint.rgb - unity_ColorSpaceGrey; 46 | col.a = tex.a * _Tint.a; 47 | return col; 48 | } 49 | ENDCG 50 | } 51 | } 52 | 53 | 54 | SubShader { 55 | Tags { "Queue"="Background" "RenderType"="Background" } 56 | Cull Off ZWrite Off Fog { Mode Off } 57 | Color [_Tint] 58 | Pass { 59 | SetTexture [_Tex] { combine texture +- primary, texture * primary } 60 | } 61 | } 62 | 63 | Fallback Off 64 | 65 | } 66 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Alpha-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Bumped Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {} 7 | _BumpMap ("Normalmap", 2D) = "bump" {} 8 | } 9 | 10 | SubShader { 11 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 12 | LOD 400 13 | 14 | CGPROGRAM 15 | #pragma surface surf BlinnPhong alpha 16 | 17 | sampler2D _MainTex; 18 | sampler2D _BumpMap; 19 | fixed4 _Color; 20 | half _Shininess; 21 | 22 | struct Input { 23 | float2 uv_MainTex; 24 | float2 uv_BumpMap; 25 | }; 26 | 27 | void surf (Input IN, inout SurfaceOutput o) { 28 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 29 | o.Albedo = tex.rgb * _Color.rgb; 30 | o.Gloss = tex.a; 31 | o.Alpha = tex.a * _Color.a; 32 | o.Specular = _Shininess; 33 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 34 | } 35 | ENDCG 36 | } 37 | 38 | FallBack "Transparent/VertexLit" 39 | } -------------------------------------------------------------------------------- /DefaultResourcesExtra/Alpha-Bumped.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Bumped Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 5 | _BumpMap ("Normalmap", 2D) = "bump" {} 6 | } 7 | 8 | SubShader { 9 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 10 | LOD 300 11 | 12 | CGPROGRAM 13 | #pragma surface surf Lambert alpha 14 | 15 | sampler2D _MainTex; 16 | sampler2D _BumpMap; 17 | fixed4 _Color; 18 | 19 | struct Input { 20 | float2 uv_MainTex; 21 | float2 uv_BumpMap; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 26 | o.Albedo = c.rgb; 27 | o.Alpha = c.a; 28 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 29 | } 30 | ENDCG 31 | } 32 | 33 | FallBack "Transparent/Diffuse" 34 | } -------------------------------------------------------------------------------- /DefaultResourcesExtra/Alpha-Diffuse.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 5 | } 6 | 7 | SubShader { 8 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 9 | LOD 200 10 | 11 | CGPROGRAM 12 | #pragma surface surf Lambert alpha 13 | 14 | sampler2D _MainTex; 15 | fixed4 _Color; 16 | 17 | struct Input { 18 | float2 uv_MainTex; 19 | }; 20 | 21 | void surf (Input IN, inout SurfaceOutput o) { 22 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 23 | o.Albedo = c.rgb; 24 | o.Alpha = c.a; 25 | } 26 | ENDCG 27 | } 28 | 29 | Fallback "Transparent/VertexLit" 30 | } 31 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Alpha-Glossy.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {} 7 | } 8 | 9 | SubShader { 10 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 11 | LOD 300 12 | 13 | CGPROGRAM 14 | #pragma surface surf BlinnPhong alpha 15 | 16 | sampler2D _MainTex; 17 | fixed4 _Color; 18 | half _Shininess; 19 | 20 | struct Input { 21 | float2 uv_MainTex; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 26 | o.Albedo = tex.rgb * _Color.rgb; 27 | o.Gloss = tex.a; 28 | o.Alpha = tex.a * _Color.a; 29 | o.Specular = _Shininess; 30 | } 31 | ENDCG 32 | } 33 | 34 | Fallback "Transparent/VertexLit" 35 | } 36 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Alpha-Parallax.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Parallax Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 5 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 6 | _BumpMap ("Normalmap", 2D) = "bump" {} 7 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 8 | } 9 | 10 | SubShader { 11 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 12 | LOD 500 13 | 14 | CGPROGRAM 15 | #pragma surface surf Lambert alpha 16 | 17 | sampler2D _MainTex; 18 | sampler2D _BumpMap; 19 | sampler2D _ParallaxMap; 20 | fixed4 _Color; 21 | float _Parallax; 22 | 23 | struct Input { 24 | float2 uv_MainTex; 25 | float2 uv_BumpMap; 26 | float3 viewDir; 27 | }; 28 | 29 | void surf (Input IN, inout SurfaceOutput o) { 30 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 31 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 32 | IN.uv_MainTex += offset; 33 | IN.uv_BumpMap += offset; 34 | 35 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 36 | o.Albedo = c.rgb; 37 | o.Alpha = c.a; 38 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 39 | } 40 | ENDCG 41 | } 42 | 43 | FallBack "Transparent/Bumped Diffuse" 44 | } -------------------------------------------------------------------------------- /DefaultResourcesExtra/Alpha-ParallaxSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Parallax Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 7 | _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {} 8 | _BumpMap ("Normalmap", 2D) = "bump" {} 9 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 10 | } 11 | 12 | SubShader { 13 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 14 | LOD 600 15 | 16 | CGPROGRAM 17 | #pragma surface surf BlinnPhong alpha 18 | #pragma exclude_renderers flash 19 | 20 | sampler2D _MainTex; 21 | sampler2D _BumpMap; 22 | sampler2D _ParallaxMap; 23 | fixed4 _Color; 24 | half _Shininess; 25 | float _Parallax; 26 | 27 | struct Input { 28 | float2 uv_MainTex; 29 | float2 uv_BumpMap; 30 | float3 viewDir; 31 | }; 32 | 33 | void surf (Input IN, inout SurfaceOutput o) { 34 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 35 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 36 | IN.uv_MainTex += offset; 37 | IN.uv_BumpMap += offset; 38 | 39 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 40 | o.Albedo = tex.rgb * _Color.rgb; 41 | o.Gloss = tex.a; 42 | o.Alpha = tex.a * _Color.a; 43 | o.Specular = _Shininess; 44 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 45 | } 46 | ENDCG 47 | } 48 | 49 | FallBack "Transparent/Bumped Specular" 50 | } 51 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Alpha-VertexLit.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/VertexLit" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Spec Color", Color) = (1,1,1,0) 5 | _Emission ("Emissive Color", Color) = (0,0,0,0) 6 | _Shininess ("Shininess", Range (0.1, 1)) = 0.7 7 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 8 | } 9 | 10 | SubShader { 11 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 12 | LOD 100 13 | 14 | Alphatest Greater 0 15 | ZWrite Off 16 | Blend SrcAlpha OneMinusSrcAlpha 17 | ColorMask RGB 18 | 19 | // Non-lightmapped 20 | Pass { 21 | Tags { "LightMode" = "Vertex" } 22 | Material { 23 | Diffuse [_Color] 24 | Ambient [_Color] 25 | Shininess [_Shininess] 26 | Specular [_SpecColor] 27 | Emission [_Emission] 28 | } 29 | Lighting On 30 | SeparateSpecular On 31 | SetTexture [_MainTex] { 32 | Combine texture * primary DOUBLE, texture * primary 33 | } 34 | } 35 | 36 | // Lightmapped, encoded as dLDR 37 | Pass { 38 | Tags { "LightMode" = "VertexLM" } 39 | 40 | BindChannels { 41 | Bind "Vertex", vertex 42 | Bind "normal", normal 43 | Bind "texcoord1", texcoord0 // lightmap uses 2nd uv 44 | Bind "texcoord", texcoord1 // main uses 1st uv 45 | } 46 | SetTexture [unity_Lightmap] { 47 | matrix [unity_LightmapMatrix] 48 | constantColor [_Color] 49 | combine texture * constant 50 | } 51 | SetTexture [_MainTex] { 52 | combine texture * previous DOUBLE, texture * primary 53 | } 54 | } 55 | 56 | // Lightmapped, encoded as RGBM 57 | Pass { 58 | Tags { "LightMode" = "VertexLMRGBM" } 59 | 60 | BindChannels { 61 | Bind "Vertex", vertex 62 | Bind "normal", normal 63 | Bind "texcoord1", texcoord0 // lightmap uses 2nd uv 64 | Bind "texcoord1", texcoord1 // unused 65 | Bind "texcoord", texcoord2 // main uses 1st uv 66 | } 67 | 68 | SetTexture [unity_Lightmap] { 69 | matrix [unity_LightmapMatrix] 70 | combine texture * texture alpha DOUBLE 71 | } 72 | SetTexture [unity_Lightmap] { 73 | constantColor [_Color] 74 | combine previous * constant 75 | } 76 | SetTexture [_MainTex] { 77 | combine texture * previous QUAD, texture * primary 78 | } 79 | } 80 | } 81 | 82 | } -------------------------------------------------------------------------------- /DefaultResourcesExtra/AlphaTest-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Cutout/Bumped Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {} 7 | _BumpMap ("Normalmap", 2D) = "bump" {} 8 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 9 | } 10 | 11 | SubShader { 12 | Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"} 13 | LOD 400 14 | 15 | CGPROGRAM 16 | #pragma surface surf BlinnPhong alphatest:_Cutoff 17 | #pragma exclude_renderers flash 18 | 19 | sampler2D _MainTex; 20 | sampler2D _BumpMap; 21 | fixed4 _Color; 22 | half _Shininess; 23 | 24 | struct Input { 25 | float2 uv_MainTex; 26 | float2 uv_BumpMap; 27 | }; 28 | 29 | void surf (Input IN, inout SurfaceOutput o) { 30 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 31 | o.Albedo = tex.rgb * _Color.rgb; 32 | o.Gloss = tex.a; 33 | o.Alpha = tex.a * _Color.a; 34 | o.Specular = _Shininess; 35 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 36 | } 37 | ENDCG 38 | } 39 | 40 | FallBack "Transparent/Cutout/VertexLit" 41 | } 42 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/AlphaTest-Bumped.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Cutout/Bumped Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 5 | _BumpMap ("Normalmap", 2D) = "bump" {} 6 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 7 | } 8 | 9 | SubShader { 10 | Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"} 11 | LOD 300 12 | 13 | CGPROGRAM 14 | #pragma surface surf Lambert alphatest:_Cutoff 15 | 16 | sampler2D _MainTex; 17 | sampler2D _BumpMap; 18 | fixed4 _Color; 19 | 20 | struct Input { 21 | float2 uv_MainTex; 22 | float2 uv_BumpMap; 23 | }; 24 | 25 | void surf (Input IN, inout SurfaceOutput o) { 26 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 27 | o.Albedo = c.rgb; 28 | o.Alpha = c.a; 29 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 30 | } 31 | ENDCG 32 | } 33 | 34 | FallBack "Transparent/Cutout/Diffuse" 35 | } 36 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/AlphaTest-Diffuse.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Cutout/Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 5 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 6 | } 7 | 8 | SubShader { 9 | Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"} 10 | LOD 200 11 | 12 | CGPROGRAM 13 | #pragma surface surf Lambert alphatest:_Cutoff 14 | 15 | sampler2D _MainTex; 16 | fixed4 _Color; 17 | 18 | struct Input { 19 | float2 uv_MainTex; 20 | }; 21 | 22 | void surf (Input IN, inout SurfaceOutput o) { 23 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 24 | o.Albedo = c.rgb; 25 | o.Alpha = c.a; 26 | } 27 | ENDCG 28 | } 29 | 30 | Fallback "Transparent/Cutout/VertexLit" 31 | } 32 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/AlphaTest-Glossy.shader: -------------------------------------------------------------------------------- 1 | Shader "Transparent/Cutout/Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 0) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _MainTex ("Base (RGB) TransGloss (A)", 2D) = "white" {} 7 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 8 | } 9 | 10 | SubShader { 11 | Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"} 12 | LOD 300 13 | 14 | CGPROGRAM 15 | #pragma surface surf BlinnPhong alphatest:_Cutoff 16 | 17 | sampler2D _MainTex; 18 | fixed4 _Color; 19 | half _Shininess; 20 | 21 | struct Input { 22 | float2 uv_MainTex; 23 | }; 24 | 25 | void surf (Input IN, inout SurfaceOutput o) { 26 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 27 | o.Albedo = tex.rgb * _Color.rgb; 28 | o.Gloss = tex.a; 29 | o.Alpha = tex.a * _Color.a; 30 | o.Specular = _Shininess; 31 | } 32 | ENDCG 33 | } 34 | 35 | Fallback "Transparent/Cutout/VertexLit" 36 | } 37 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Decal.shader: -------------------------------------------------------------------------------- 1 | Shader "Decal" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB)", 2D) = "white" {} 5 | _DecalTex ("Decal (RGBA)", 2D) = "black" {} 6 | } 7 | 8 | SubShader { 9 | Tags { "RenderType"="Opaque" } 10 | LOD 250 11 | 12 | CGPROGRAM 13 | #pragma surface surf Lambert 14 | 15 | sampler2D _MainTex; 16 | sampler2D _DecalTex; 17 | fixed4 _Color; 18 | 19 | struct Input { 20 | float2 uv_MainTex; 21 | float2 uv_DecalTex; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex); 26 | half4 decal = tex2D(_DecalTex, IN.uv_DecalTex); 27 | c.rgb = lerp (c.rgb, decal.rgb, decal.a); 28 | c *= _Color; 29 | o.Albedo = c.rgb; 30 | o.Alpha = c.a; 31 | } 32 | ENDCG 33 | } 34 | 35 | Fallback "Diffuse" 36 | } 37 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Flare.shader: -------------------------------------------------------------------------------- 1 | Shader "FX/Flare" { 2 | Properties { 3 | _MainTex ("Particle Texture", 2D) = "black" {} 4 | } 5 | SubShader { 6 | Tags { 7 | "Queue"="Transparent" 8 | "IgnoreProjector"="True" 9 | "RenderType"="Transparent" 10 | "PreviewType"="Plane" 11 | } 12 | Cull Off Lighting Off ZWrite Off Ztest Always Fog { Mode Off } 13 | Blend One One 14 | 15 | Pass { 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag 19 | 20 | #include "UnityCG.cginc" 21 | 22 | sampler2D _MainTex; 23 | fixed4 _TintColor; 24 | 25 | struct appdata_t { 26 | float4 vertex : POSITION; 27 | fixed4 color : COLOR; 28 | float2 texcoord : TEXCOORD0; 29 | }; 30 | 31 | struct v2f { 32 | float4 vertex : SV_POSITION; 33 | fixed4 color : COLOR; 34 | float2 texcoord : TEXCOORD0; 35 | }; 36 | 37 | float4 _MainTex_ST; 38 | 39 | v2f vert (appdata_t v) 40 | { 41 | v2f o; 42 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 43 | o.color = v.color; 44 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 45 | return o; 46 | } 47 | 48 | fixed4 frag (v2f i) : SV_Target 49 | { 50 | fixed4 col; 51 | fixed4 tex = tex2D(_MainTex, i.texcoord); 52 | col.rgb = i.color.rgb * tex.rgb; 53 | col.a = tex.a; 54 | return col; 55 | } 56 | ENDCG 57 | } 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Illumin-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Self-Illumin/Bumped Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 7 | _Illum ("Illumin (A)", 2D) = "white" {} 8 | _BumpMap ("Normalmap", 2D) = "bump" {} 9 | _EmissionLM ("Emission (Lightmapper)", Float) = 0 10 | } 11 | SubShader { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 400 14 | CGPROGRAM 15 | #pragma surface surf BlinnPhong 16 | 17 | sampler2D _MainTex; 18 | sampler2D _BumpMap; 19 | sampler2D _Illum; 20 | fixed4 _Color; 21 | half _Shininess; 22 | 23 | struct Input { 24 | float2 uv_MainTex; 25 | float2 uv_Illum; 26 | float2 uv_BumpMap; 27 | }; 28 | 29 | void surf (Input IN, inout SurfaceOutput o) { 30 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 31 | fixed4 c = tex * _Color; 32 | o.Albedo = c.rgb; 33 | o.Emission = c.rgb * tex2D(_Illum, IN.uv_Illum).a; 34 | o.Gloss = tex.a; 35 | o.Alpha = c.a; 36 | o.Specular = _Shininess; 37 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 38 | } 39 | ENDCG 40 | } 41 | FallBack "Self-Illumin/Specular" 42 | } 43 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Illumin-Bumped.shader: -------------------------------------------------------------------------------- 1 | Shader "Self-Illumin/Bumped Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 5 | _Illum ("Illumin (A)", 2D) = "white" {} 6 | _BumpMap ("Normalmap", 2D) = "bump" {} 7 | _EmissionLM ("Emission (Lightmapper)", Float) = 0 8 | } 9 | SubShader { 10 | Tags { "RenderType"="Opaque" } 11 | LOD 300 12 | 13 | CGPROGRAM 14 | #pragma surface surf Lambert 15 | 16 | sampler2D _MainTex; 17 | sampler2D _BumpMap; 18 | sampler2D _Illum; 19 | fixed4 _Color; 20 | 21 | struct Input { 22 | float2 uv_MainTex; 23 | float2 uv_Illum; 24 | float2 uv_BumpMap; 25 | }; 26 | 27 | void surf (Input IN, inout SurfaceOutput o) { 28 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 29 | fixed4 c = tex * _Color; 30 | o.Albedo = c.rgb; 31 | o.Emission = c.rgb * tex2D(_Illum, IN.uv_Illum).a; 32 | o.Alpha = c.a; 33 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 34 | } 35 | ENDCG 36 | } 37 | FallBack "Self-Illumin/Diffuse" 38 | } 39 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Illumin-Diffuse.shader: -------------------------------------------------------------------------------- 1 | Shader "Self-Illumin/Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 5 | _Illum ("Illumin (A)", 2D) = "white" {} 6 | _EmissionLM ("Emission (Lightmapper)", Float) = 0 7 | } 8 | SubShader { 9 | Tags { "RenderType"="Opaque" } 10 | LOD 200 11 | 12 | CGPROGRAM 13 | #pragma surface surf Lambert 14 | 15 | sampler2D _MainTex; 16 | sampler2D _Illum; 17 | fixed4 _Color; 18 | 19 | struct Input { 20 | float2 uv_MainTex; 21 | float2 uv_Illum; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 26 | fixed4 c = tex * _Color; 27 | o.Albedo = c.rgb; 28 | o.Emission = c.rgb * tex2D(_Illum, IN.uv_Illum).a; 29 | o.Alpha = c.a; 30 | } 31 | ENDCG 32 | } 33 | FallBack "Self-Illumin/VertexLit" 34 | } 35 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Illumin-Glossy.shader: -------------------------------------------------------------------------------- 1 | Shader "Self-Illumin/Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 7 | _Illum ("Illumin (A)", 2D) = "white" {} 8 | _EmissionLM ("Emission (Lightmapper)", Float) = 0 9 | } 10 | SubShader { 11 | Tags { "RenderType"="Opaque" } 12 | LOD 300 13 | 14 | CGPROGRAM 15 | #pragma surface surf BlinnPhong 16 | 17 | sampler2D _MainTex; 18 | sampler2D _Illum; 19 | fixed4 _Color; 20 | half _Shininess; 21 | 22 | struct Input { 23 | float2 uv_MainTex; 24 | float2 uv_Illum; 25 | }; 26 | 27 | void surf (Input IN, inout SurfaceOutput o) { 28 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 29 | fixed4 c = tex * _Color; 30 | o.Albedo = c.rgb; 31 | o.Emission = c.rgb * tex2D(_Illum, IN.uv_Illum).a; 32 | o.Gloss = tex.a; 33 | o.Alpha = c.a; 34 | o.Specular = _Shininess; 35 | } 36 | ENDCG 37 | } 38 | FallBack "Self-Illumin/Diffuse" 39 | } 40 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Illumin-Parallax.shader: -------------------------------------------------------------------------------- 1 | Shader "Self-Illumin/Parallax Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 5 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 6 | _Illum ("Illumin (A)", 2D) = "white" {} 7 | _BumpMap ("Normalmap", 2D) = "bump" {} 8 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 9 | _EmissionLM ("Emission (Lightmapper)", Float) = 0 10 | } 11 | SubShader { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 500 14 | 15 | CGPROGRAM 16 | #pragma surface surf Lambert 17 | 18 | sampler2D _MainTex; 19 | sampler2D _BumpMap; 20 | sampler2D _ParallaxMap; 21 | sampler2D _Illum; 22 | fixed4 _Color; 23 | float _Parallax; 24 | 25 | struct Input { 26 | float2 uv_MainTex; 27 | float2 uv_BumpMap; 28 | float2 uv_Illum; 29 | float3 viewDir; 30 | }; 31 | 32 | void surf (Input IN, inout SurfaceOutput o) { 33 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 34 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 35 | IN.uv_MainTex += offset; 36 | IN.uv_BumpMap += offset; 37 | IN.uv_Illum += offset; 38 | 39 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 40 | o.Albedo = c.rgb; 41 | o.Emission = c.rgb * tex2D(_Illum, IN.uv_Illum).a; 42 | o.Alpha = c.a; 43 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 44 | } 45 | ENDCG 46 | } 47 | FallBack "Self-Illumin/Bumped Diffuse" 48 | } 49 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Illumin-ParallaxSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Self-Illumin/Parallax Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 7 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 8 | _Illum ("Illumin (A)", 2D) = "white" {} 9 | _BumpMap ("Normalmap", 2D) = "bump" {} 10 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 11 | _EmissionLM ("Emission (Lightmapper)", Float) = 0 12 | } 13 | SubShader { 14 | Tags { "RenderType"="Opaque" } 15 | LOD 600 16 | 17 | CGPROGRAM 18 | #pragma surface surf BlinnPhong 19 | #pragma target 3.0 20 | 21 | sampler2D _MainTex; 22 | sampler2D _BumpMap; 23 | sampler2D _ParallaxMap; 24 | sampler2D _Illum; 25 | fixed4 _Color; 26 | float _Parallax; 27 | half _Shininess; 28 | 29 | struct Input { 30 | float2 uv_MainTex; 31 | float2 uv_BumpMap; 32 | float2 uv_Illum; 33 | float3 viewDir; 34 | }; 35 | 36 | void surf (Input IN, inout SurfaceOutput o) { 37 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 38 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 39 | IN.uv_MainTex += offset; 40 | IN.uv_BumpMap += offset; 41 | IN.uv_Illum += offset; 42 | 43 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 44 | fixed4 c = tex * _Color; 45 | o.Albedo = c.rgb; 46 | o.Gloss = tex.a; 47 | o.Emission = c.rgb * tex2D(_Illum, IN.uv_Illum).a; 48 | o.Specular = _Shininess; 49 | o.Alpha = c.a; 50 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 51 | } 52 | ENDCG 53 | } 54 | FallBack "Self-Illumin/Bumped Specular" 55 | } 56 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Illumin-VertexLit.shader: -------------------------------------------------------------------------------- 1 | Shader "Self-Illumin/VertexLit" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Spec Color", Color) = (1,1,1,1) 5 | _Shininess ("Shininess", Range (0.1, 1)) = 0.7 6 | _MainTex ("Base (RGB)", 2D) = "white" {} 7 | _Illum ("Illumin (A)", 2D) = "white" {} 8 | _EmissionLM ("Emission (Lightmapper)", Float) = 0 9 | } 10 | 11 | SubShader { 12 | LOD 100 13 | Tags { "RenderType"="Opaque" } 14 | 15 | Pass { 16 | Name "BASE" 17 | Tags {"LightMode" = "Vertex"} 18 | Material { 19 | Diffuse [_Color] 20 | Shininess [_Shininess] 21 | Specular [_SpecColor] 22 | } 23 | SeparateSpecular On 24 | Lighting On 25 | SetTexture [_Illum] { 26 | constantColor [_Color] 27 | combine constant lerp (texture) previous 28 | } 29 | SetTexture [_MainTex] { 30 | Combine texture * previous, texture*primary 31 | } 32 | } 33 | } 34 | 35 | Fallback "VertexLit" 36 | } 37 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Lightmap-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Legacy Shaders/Lightmapped/Bumped Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 7 | _BumpMap ("Normalmap", 2D) = "bump" {} 8 | _LightMap ("Lightmap (RGB)", 2D) = "lightmap" { LightmapMode } 9 | } 10 | FallBack "Legacy Shaders/Lightmapped/Bumped Diffuse" 11 | } 12 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Lightmap-Bumped.shader: -------------------------------------------------------------------------------- 1 | Shader "Legacy Shaders/Lightmapped/Bumped Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB)", 2D) = "white" {} 5 | _BumpMap ("Normalmap", 2D) = "bump" {} 6 | _LightMap ("Lightmap (RGB)", 2D) = "black" {} 7 | } 8 | 9 | SubShader { 10 | LOD 300 11 | Tags { "RenderType" = "Opaque" } 12 | CGPROGRAM 13 | #pragma surface surf Lambert 14 | struct Input { 15 | float2 uv_MainTex; 16 | float2 uv_BumpMap; 17 | float2 uv2_LightMap; 18 | }; 19 | sampler2D _MainTex; 20 | sampler2D _BumpMap; 21 | sampler2D _LightMap; 22 | fixed4 _Color; 23 | void surf (Input IN, inout SurfaceOutput o) 24 | { 25 | o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb * _Color; 26 | half4 lm = tex2D (_LightMap, IN.uv2_LightMap); 27 | o.Emission = lm.rgb*o.Albedo.rgb; 28 | o.Alpha = lm.a * _Color.a; 29 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 30 | } 31 | ENDCG 32 | } 33 | FallBack "Legacy Shaders/Lightmapped/Diffuse" 34 | } 35 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Lightmap-Diffuse.shader: -------------------------------------------------------------------------------- 1 | Shader "Legacy Shaders/Lightmapped/Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB)", 2D) = "white" {} 5 | _LightMap ("Lightmap (RGB)", 2D) = "black" {} 6 | } 7 | 8 | SubShader { 9 | LOD 200 10 | Tags { "RenderType" = "Opaque" } 11 | CGPROGRAM 12 | #pragma surface surf Lambert 13 | struct Input { 14 | float2 uv_MainTex; 15 | float2 uv2_LightMap; 16 | }; 17 | sampler2D _MainTex; 18 | sampler2D _LightMap; 19 | fixed4 _Color; 20 | void surf (Input IN, inout SurfaceOutput o) 21 | { 22 | o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb * _Color; 23 | half4 lm = tex2D (_LightMap, IN.uv2_LightMap); 24 | o.Emission = lm.rgb*o.Albedo.rgb; 25 | o.Alpha = lm.a * _Color.a; 26 | } 27 | ENDCG 28 | } 29 | FallBack "Legacy Shaders/Lightmapped/VertexLit" 30 | } 31 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Lightmap-Glossy.shader: -------------------------------------------------------------------------------- 1 | Shader "Legacy Shaders/Lightmapped/Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 7 | _LightMap ("Lightmap (RGB)", 2D) = "lightmap" { LightmapMode } 8 | } 9 | FallBack "Legacy Shaders/Lightmapped/Diffuse" 10 | } -------------------------------------------------------------------------------- /DefaultResourcesExtra/Lightmap-VertexLit.shader: -------------------------------------------------------------------------------- 1 | Shader "Legacy Shaders/Lightmapped/VertexLit" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Spec Color", Color) = (1,1,1,1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.7 6 | _MainTex ("Base (RGB)", 2D) = "white" {} 7 | _LightMap ("Lightmap (RGB)", 2D) = "lightmap" { LightmapMode } 8 | } 9 | 10 | SubShader { 11 | LOD 100 12 | Tags { "RenderType"="Opaque" } 13 | 14 | Pass { 15 | Name "BASE" 16 | Tags {"LightMode" = "Vertex"} 17 | Material { 18 | Diffuse [_Color] 19 | Shininess [_Shininess] 20 | Specular [_SpecColor] 21 | } 22 | 23 | Lighting On 24 | SeparateSpecular On 25 | 26 | BindChannels { 27 | Bind "Vertex", vertex 28 | Bind "normal", normal 29 | Bind "texcoord1", texcoord0 // lightmap uses 2nd uv 30 | Bind "texcoord1", texcoord1 // lightmap uses 2nd uv 31 | Bind "texcoord", texcoord2 // main uses 1st uv 32 | } 33 | 34 | SetTexture [_LightMap] { 35 | constantColor [_Color] 36 | combine texture * constant 37 | } 38 | SetTexture [_LightMap] { 39 | constantColor (0.5,0.5,0.5,0.5) 40 | combine previous * constant + primary 41 | } 42 | SetTexture [_MainTex] { 43 | combine texture * previous DOUBLE, texture * primary 44 | } 45 | } 46 | } 47 | 48 | Fallback "VertexLit" 49 | } 50 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Mobile/Mobile-BumpSpec-1DirectionalLight.shader: -------------------------------------------------------------------------------- 1 | // Simplified Bumped Specular shader. Differences from regular Bumped Specular one: 2 | // - no Main Color nor Specular Color 3 | // - specular lighting directions are approximated per vertex 4 | // - writes zero to alpha channel 5 | // - Normalmap uses Tiling/Offset of the Base texture 6 | // - no Deferred Lighting support 7 | // - no Lightmap support 8 | // - supports ONLY 1 directional light. Other lights are completely ignored. 9 | 10 | Shader "Mobile/Bumped Specular (1 Directional Light)" { 11 | Properties { 12 | _Shininess ("Shininess", Range (0.03, 1)) = 0.078125 13 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 14 | _BumpMap ("Normalmap", 2D) = "bump" {} 15 | } 16 | SubShader { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 250 19 | 20 | CGPROGRAM 21 | #pragma surface surf MobileBlinnPhong exclude_path:prepass nolightmap noforwardadd halfasview novertexlights 22 | 23 | inline fixed4 LightingMobileBlinnPhong (SurfaceOutput s, fixed3 lightDir, fixed3 halfDir, fixed atten) 24 | { 25 | fixed diff = max (0, dot (s.Normal, lightDir)); 26 | fixed nh = max (0, dot (s.Normal, halfDir)); 27 | fixed spec = pow (nh, s.Specular*128) * s.Gloss; 28 | 29 | fixed4 c; 30 | c.rgb = (s.Albedo * _LightColor0.rgb * diff + _LightColor0.rgb * spec) * (atten*2); 31 | c.a = 0.0; 32 | return c; 33 | } 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BumpMap; 37 | half _Shininess; 38 | 39 | struct Input { 40 | float2 uv_MainTex; 41 | }; 42 | 43 | void surf (Input IN, inout SurfaceOutput o) { 44 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 45 | o.Albedo = tex.rgb; 46 | o.Gloss = tex.a; 47 | o.Alpha = tex.a; 48 | o.Specular = _Shininess; 49 | o.Normal = UnpackNormal (tex2D(_BumpMap, IN.uv_MainTex)); 50 | } 51 | ENDCG 52 | } 53 | 54 | FallBack "Mobile/VertexLit" 55 | } 56 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Mobile/Mobile-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | // Simplified Bumped Specular shader. Differences from regular Bumped Specular one: 2 | // - no Main Color nor Specular Color 3 | // - specular lighting directions are approximated per vertex 4 | // - writes zero to alpha channel 5 | // - Normalmap uses Tiling/Offset of the Base texture 6 | // - no Deferred Lighting support 7 | // - no Lightmap support 8 | // - fully supports only 1 directional light. Other lights can affect it, but it will be per-vertex/SH. 9 | 10 | Shader "Mobile/Bumped Specular" { 11 | Properties { 12 | _Shininess ("Shininess", Range (0.03, 1)) = 0.078125 13 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 14 | _BumpMap ("Normalmap", 2D) = "bump" {} 15 | } 16 | SubShader { 17 | Tags { "RenderType"="Opaque" } 18 | LOD 250 19 | 20 | CGPROGRAM 21 | #pragma surface surf MobileBlinnPhong exclude_path:prepass nolightmap noforwardadd halfasview 22 | 23 | inline fixed4 LightingMobileBlinnPhong (SurfaceOutput s, fixed3 lightDir, fixed3 halfDir, fixed atten) 24 | { 25 | fixed diff = max (0, dot (s.Normal, lightDir)); 26 | fixed nh = max (0, dot (s.Normal, halfDir)); 27 | fixed spec = pow (nh, s.Specular*128) * s.Gloss; 28 | 29 | fixed4 c; 30 | c.rgb = (s.Albedo * _LightColor0.rgb * diff + _LightColor0.rgb * spec) * (atten*2); 31 | c.a = 0.0; 32 | return c; 33 | } 34 | 35 | sampler2D _MainTex; 36 | sampler2D _BumpMap; 37 | half _Shininess; 38 | 39 | struct Input { 40 | float2 uv_MainTex; 41 | }; 42 | 43 | void surf (Input IN, inout SurfaceOutput o) { 44 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 45 | o.Albedo = tex.rgb; 46 | o.Gloss = tex.a; 47 | o.Alpha = tex.a; 48 | o.Specular = _Shininess; 49 | o.Normal = UnpackNormal (tex2D(_BumpMap, IN.uv_MainTex)); 50 | } 51 | ENDCG 52 | } 53 | 54 | FallBack "Mobile/VertexLit" 55 | } 56 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Mobile/Mobile-Bumped.shader: -------------------------------------------------------------------------------- 1 | // Simplified Bumped shader. Differences from regular Bumped one: 2 | // - no Main Color 3 | // - Normalmap uses Tiling/Offset of the Base texture 4 | // - fully supports only 1 directional light. Other lights can affect it, but it will be per-vertex/SH. 5 | 6 | Shader "Mobile/Bumped Diffuse" { 7 | Properties { 8 | _MainTex ("Base (RGB)", 2D) = "white" {} 9 | _BumpMap ("Normalmap", 2D) = "bump" {} 10 | } 11 | 12 | SubShader { 13 | Tags { "RenderType"="Opaque" } 14 | LOD 250 15 | 16 | CGPROGRAM 17 | #pragma surface surf Lambert noforwardadd 18 | 19 | sampler2D _MainTex; 20 | sampler2D _BumpMap; 21 | 22 | struct Input { 23 | float2 uv_MainTex; 24 | }; 25 | 26 | void surf (Input IN, inout SurfaceOutput o) { 27 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex); 28 | o.Albedo = c.rgb; 29 | o.Alpha = c.a; 30 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_MainTex)); 31 | } 32 | ENDCG 33 | } 34 | 35 | FallBack "Mobile/Diffuse" 36 | } 37 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Mobile/Mobile-Diffuse.shader: -------------------------------------------------------------------------------- 1 | // Simplified Diffuse shader. Differences from regular Diffuse one: 2 | // - no Main Color 3 | // - fully supports only 1 directional light. Other lights can affect it, but it will be per-vertex/SH. 4 | 5 | Shader "Mobile/Diffuse" { 6 | Properties { 7 | _MainTex ("Base (RGB)", 2D) = "white" {} 8 | } 9 | SubShader { 10 | Tags { "RenderType"="Opaque" } 11 | LOD 150 12 | 13 | CGPROGRAM 14 | #pragma surface surf Lambert noforwardadd 15 | 16 | sampler2D _MainTex; 17 | 18 | struct Input { 19 | float2 uv_MainTex; 20 | }; 21 | 22 | void surf (Input IN, inout SurfaceOutput o) { 23 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex); 24 | o.Albedo = c.rgb; 25 | o.Alpha = c.a; 26 | } 27 | ENDCG 28 | } 29 | 30 | Fallback "Mobile/VertexLit" 31 | } 32 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Mobile/Mobile-Lightmap-Unlit.shader: -------------------------------------------------------------------------------- 1 | // Unlit shader. Simplest possible textured shader. 2 | // - SUPPORTS lightmap 3 | // - no lighting 4 | // - no per-material color 5 | 6 | Shader "Mobile/Unlit (Supports Lightmap)" { 7 | Properties { 8 | _MainTex ("Base (RGB)", 2D) = "white" {} 9 | } 10 | 11 | SubShader { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 100 14 | 15 | // Non-lightmapped 16 | Pass { 17 | Tags { "LightMode" = "Vertex" } 18 | Lighting Off 19 | SetTexture [_MainTex] { combine texture } 20 | } 21 | 22 | // Lightmapped, encoded as dLDR 23 | Pass { 24 | Tags { "LightMode" = "VertexLM" } 25 | 26 | Lighting Off 27 | BindChannels { 28 | Bind "Vertex", vertex 29 | Bind "texcoord1", texcoord0 // lightmap uses 2nd uv 30 | Bind "texcoord", texcoord1 // main uses 1st uv 31 | } 32 | 33 | SetTexture [unity_Lightmap] { 34 | matrix [unity_LightmapMatrix] 35 | combine texture 36 | } 37 | SetTexture [_MainTex] { 38 | combine texture * previous DOUBLE, texture * primary 39 | } 40 | } 41 | 42 | // Lightmapped, encoded as RGBM 43 | Pass { 44 | Tags { "LightMode" = "VertexLMRGBM" } 45 | 46 | Lighting Off 47 | BindChannels { 48 | Bind "Vertex", vertex 49 | Bind "texcoord1", texcoord0 // lightmap uses 2nd uv 50 | Bind "texcoord", texcoord1 // main uses 1st uv 51 | } 52 | 53 | SetTexture [unity_Lightmap] { 54 | matrix [unity_LightmapMatrix] 55 | combine texture * texture alpha DOUBLE 56 | } 57 | SetTexture [_MainTex] { 58 | combine texture * previous QUAD, texture * primary 59 | } 60 | } 61 | 62 | 63 | } 64 | } 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Mobile/Mobile-Particle-Add.shader: -------------------------------------------------------------------------------- 1 | // Simplified Additive Particle shader. Differences from regular Additive Particle one: 2 | // - no Tint color 3 | // - no Smooth particle support 4 | // - no AlphaTest 5 | // - no ColorMask 6 | 7 | Shader "Mobile/Particles/Additive" { 8 | Properties { 9 | _MainTex ("Particle Texture", 2D) = "white" {} 10 | } 11 | 12 | Category { 13 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 14 | Blend SrcAlpha One 15 | Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) } 16 | 17 | BindChannels { 18 | Bind "Color", color 19 | Bind "Vertex", vertex 20 | Bind "TexCoord", texcoord 21 | } 22 | 23 | SubShader { 24 | Pass { 25 | SetTexture [_MainTex] { 26 | combine texture * primary 27 | } 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /DefaultResourcesExtra/Mobile/Mobile-Particle-Alpha-VertexLit.shader: -------------------------------------------------------------------------------- 1 | // Simplified VertexLit Blended Particle shader. Differences from regular VertexLit Blended Particle one: 2 | // - no AlphaTest 3 | // - no ColorMask 4 | 5 | Shader "Mobile/Particles/VertexLit Blended" { 6 | Properties { 7 | _EmisColor ("Emissive Color", Color) = (.2,.2,.2,0) 8 | _MainTex ("Particle Texture", 2D) = "white" {} 9 | } 10 | 11 | Category { 12 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 13 | Blend SrcAlpha OneMinusSrcAlpha 14 | Cull Off ZWrite Off Fog { Color (0,0,0,0) } 15 | 16 | Lighting On 17 | Material { Emission [_EmisColor] } 18 | ColorMaterial AmbientAndDiffuse 19 | 20 | SubShader { 21 | Pass { 22 | SetTexture [_MainTex] { 23 | combine texture * primary 24 | } 25 | } 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /DefaultResourcesExtra/Mobile/Mobile-Particle-Alpha.shader: -------------------------------------------------------------------------------- 1 | // Simplified Alpha Blended Particle shader. Differences from regular Alpha Blended Particle one: 2 | // - no Tint color 3 | // - no Smooth particle support 4 | // - no AlphaTest 5 | // - no ColorMask 6 | 7 | Shader "Mobile/Particles/Alpha Blended" { 8 | Properties { 9 | _MainTex ("Particle Texture", 2D) = "white" {} 10 | } 11 | 12 | Category { 13 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 14 | Blend SrcAlpha OneMinusSrcAlpha 15 | Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) } 16 | 17 | BindChannels { 18 | Bind "Color", color 19 | Bind "Vertex", vertex 20 | Bind "TexCoord", texcoord 21 | } 22 | 23 | SubShader { 24 | Pass { 25 | SetTexture [_MainTex] { 26 | combine texture * primary 27 | } 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Mobile/Mobile-Particle-Multiply.shader: -------------------------------------------------------------------------------- 1 | // Simplified Multiply Particle shader. Differences from regular Multiply Particle one: 2 | // - no Smooth particle support 3 | // - no AlphaTest 4 | // - no ColorMask 5 | 6 | Shader "Mobile/Particles/Multiply" { 7 | Properties { 8 | _MainTex ("Particle Texture", 2D) = "white" {} 9 | } 10 | 11 | Category { 12 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 13 | Blend Zero SrcColor 14 | Cull Off Lighting Off ZWrite Off Fog { Color (1,1,1,1) } 15 | 16 | BindChannels { 17 | Bind "Color", color 18 | Bind "Vertex", vertex 19 | Bind "TexCoord", texcoord 20 | } 21 | 22 | SubShader { 23 | Pass { 24 | SetTexture [_MainTex] { 25 | combine texture * primary 26 | } 27 | SetTexture [_MainTex] { 28 | constantColor (1,1,1,1) 29 | combine previous lerp (previous) constant 30 | } 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Mobile/Mobile-Skybox.shader: -------------------------------------------------------------------------------- 1 | // Simplified Skybox shader. Differences from regular Skybox one: 2 | // - no tint color 3 | 4 | Shader "Mobile/Skybox" { 5 | Properties { 6 | _FrontTex ("Front (+Z)", 2D) = "white" {} 7 | _BackTex ("Back (-Z)", 2D) = "white" {} 8 | _LeftTex ("Left (+X)", 2D) = "white" {} 9 | _RightTex ("Right (-X)", 2D) = "white" {} 10 | _UpTex ("Up (+Y)", 2D) = "white" {} 11 | _DownTex ("Down (-Y)", 2D) = "white" {} 12 | } 13 | 14 | SubShader { 15 | Tags { "Queue"="Background" "RenderType"="Background" } 16 | Cull Off ZWrite Off Fog { Mode Off } 17 | Pass { 18 | SetTexture [_FrontTex] { combine texture } 19 | } 20 | Pass { 21 | SetTexture [_BackTex] { combine texture } 22 | } 23 | Pass { 24 | SetTexture [_LeftTex] { combine texture } 25 | } 26 | Pass { 27 | SetTexture [_RightTex] { combine texture } 28 | } 29 | Pass { 30 | SetTexture [_UpTex] { combine texture } 31 | } 32 | Pass { 33 | SetTexture [_DownTex] { combine texture } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Nature/SoftOcclusion/TreeSoftOcclusionBark.shader: -------------------------------------------------------------------------------- 1 | Shader "Nature/Tree Soft Occlusion Bark" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,0) 4 | _MainTex ("Main Texture", 2D) = "white" {} 5 | _BaseLight ("Base Light", Range(0, 1)) = 0.35 6 | _AO ("Amb. Occlusion", Range(0, 10)) = 2.4 7 | 8 | // These are here only to provide default values 9 | _Scale ("Scale", Vector) = (1,1,1,1) 10 | _SquashAmount ("Squash", Float) = 1 11 | } 12 | 13 | SubShader { 14 | Tags { 15 | "IgnoreProjector"="True" 16 | "RenderType" = "TreeOpaque" 17 | } 18 | 19 | Pass { 20 | Lighting On 21 | 22 | CGPROGRAM 23 | #pragma vertex bark 24 | #pragma fragment frag 25 | #pragma glsl_no_auto_normalization 26 | #include "SH_Vertex.cginc" 27 | 28 | sampler2D _MainTex; 29 | 30 | fixed4 frag(v2f input) : SV_Target 31 | { 32 | fixed4 col = input.color; 33 | col.rgb *= 2.0f * tex2D( _MainTex, input.uv.xy).rgb; 34 | return col; 35 | } 36 | ENDCG 37 | } 38 | 39 | Pass { 40 | Name "ShadowCaster" 41 | Tags { "LightMode" = "ShadowCaster" } 42 | 43 | Fog {Mode Off} 44 | ZWrite On ZTest LEqual Cull Off 45 | Offset 1, 1 46 | 47 | CGPROGRAM 48 | #pragma vertex vert 49 | #pragma fragment frag 50 | #pragma glsl_no_auto_normalization 51 | #pragma multi_compile_shadowcaster 52 | #include "UnityCG.cginc" 53 | #include "TerrainEngine.cginc" 54 | 55 | struct v2f { 56 | V2F_SHADOW_CASTER; 57 | }; 58 | 59 | struct appdata { 60 | float4 vertex : POSITION; 61 | fixed4 color : COLOR; 62 | }; 63 | v2f vert( appdata v ) 64 | { 65 | v2f o; 66 | TerrainAnimateTree(v.vertex, v.color.w); 67 | TRANSFER_SHADOW_CASTER(o) 68 | return o; 69 | } 70 | 71 | float4 frag( v2f i ) : SV_Target 72 | { 73 | SHADOW_CASTER_FRAGMENT(i) 74 | } 75 | ENDCG 76 | } 77 | } 78 | 79 | Dependency "BillboardShader" = "Hidden/Nature/Tree Soft Occlusion Bark Rendertex" 80 | Fallback Off 81 | } 82 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Nature/SoftOcclusion/TreeSoftOcclusionBarkRendertex.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/Nature/Tree Soft Occlusion Bark Rendertex" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,0) 4 | _MainTex ("Main Texture", 2D) = "white" {} 5 | _BaseLight ("Base Light", Range(0, 1)) = 0.35 6 | _AO ("Amb. Occlusion", Range(0, 10)) = 2.4 7 | 8 | // These are here only to provide default values 9 | _Scale ("Scale", Vector) = (1,1,1,1) 10 | _SquashAmount ("Squash", Float) = 1 11 | } 12 | 13 | SubShader { 14 | Fog { Mode Off } 15 | Pass { 16 | Lighting On 17 | 18 | CGPROGRAM 19 | #pragma vertex bark 20 | #pragma fragment frag 21 | #pragma glsl_no_auto_normalization 22 | #define WRITE_ALPHA_1 1 23 | #define USE_CUSTOM_LIGHT_DIR 1 24 | #include "SH_Vertex.cginc" 25 | 26 | sampler2D _MainTex; 27 | 28 | fixed4 frag(v2f input) : SV_Target 29 | { 30 | fixed4 col = input.color; 31 | col.rgb *= 2.0f * tex2D( _MainTex, input.uv.xy).rgb; 32 | return col; 33 | } 34 | ENDCG 35 | } 36 | } 37 | 38 | Fallback Off 39 | } -------------------------------------------------------------------------------- /DefaultResourcesExtra/Nature/SoftOcclusion/TreeSoftOcclusionLeavesRendertex.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/Nature/Tree Soft Occlusion Leaves Rendertex" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,0) 4 | _MainTex ("Main Texture", 2D) = "white" {} 5 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 6 | _HalfOverCutoff ("0.5 / Alpha cutoff", Range(0,1)) = 1.0 7 | _BaseLight ("Base Light", Range(0, 1)) = 0.35 8 | _AO ("Amb. Occlusion", Range(0, 10)) = 2.4 9 | _Occlusion ("Dir Occlusion", Range(0, 20)) = 7.5 10 | 11 | // These are here only to provide default values 12 | _Scale ("Scale", Vector) = (1,1,1,1) 13 | _SquashAmount ("Squash", Float) = 1 14 | } 15 | SubShader { 16 | 17 | Tags { "Queue" = "Transparent-99" } 18 | Cull Off 19 | Fog { Mode Off} 20 | 21 | Pass { 22 | Lighting On 23 | ZWrite On 24 | 25 | CGPROGRAM 26 | #pragma vertex leaves 27 | #pragma fragment frag 28 | #pragma glsl_no_auto_normalization 29 | #define USE_CUSTOM_LIGHT_DIR 1 30 | #include "SH_Vertex.cginc" 31 | 32 | sampler2D _MainTex; 33 | fixed _Cutoff; 34 | 35 | fixed4 frag(v2f input) : SV_Target 36 | { 37 | fixed4 col = tex2D( _MainTex, input.uv.xy); 38 | col.rgb *= 2.0f * input.color.rgb; 39 | clip(col.a - _Cutoff); 40 | col.a = 1; 41 | return col; 42 | } 43 | ENDCG 44 | } 45 | } 46 | 47 | Fallback Off 48 | } 49 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Nature/Terrain/TerrBumpAddPass.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/Nature/Terrain/Bumped Specular AddPass" { 2 | Properties { 3 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 4 | _Shininess ("Shininess", Range (0.03, 1)) = 0.078125 5 | 6 | // set by terrain engine 7 | _Control ("Control (RGBA)", 2D) = "red" {} 8 | _Splat3 ("Layer 3 (A)", 2D) = "white" {} 9 | _Splat2 ("Layer 2 (B)", 2D) = "white" {} 10 | _Splat1 ("Layer 1 (G)", 2D) = "white" {} 11 | _Splat0 ("Layer 0 (R)", 2D) = "white" {} 12 | _Normal3 ("Normal 3 (A)", 2D) = "bump" {} 13 | _Normal2 ("Normal 2 (B)", 2D) = "bump" {} 14 | _Normal1 ("Normal 1 (G)", 2D) = "bump" {} 15 | _Normal0 ("Normal 0 (R)", 2D) = "bump" {} 16 | } 17 | 18 | SubShader { 19 | Tags { 20 | "SplatCount" = "4" 21 | "Queue" = "Geometry-99" 22 | "IgnoreProjector"="True" 23 | "RenderType" = "Opaque" 24 | } 25 | CGPROGRAM 26 | #pragma surface surf BlinnPhong vertex:vert decal:add 27 | #pragma target 3.0 28 | 29 | void vert (inout appdata_full v) 30 | { 31 | v.tangent.xyz = cross(v.normal, float3(0,0,1)); 32 | v.tangent.w = -1; 33 | } 34 | 35 | struct Input { 36 | float2 uv_Control : TEXCOORD0; 37 | float2 uv_Splat0 : TEXCOORD1; 38 | float2 uv_Splat1 : TEXCOORD2; 39 | float2 uv_Splat2 : TEXCOORD3; 40 | float2 uv_Splat3 : TEXCOORD4; 41 | }; 42 | 43 | sampler2D _Control; 44 | sampler2D _Splat0,_Splat1,_Splat2,_Splat3; 45 | sampler2D _Normal0,_Normal1,_Normal2,_Normal3; 46 | half _Shininess; 47 | 48 | void surf (Input IN, inout SurfaceOutput o) { 49 | fixed4 splat_control = tex2D (_Control, IN.uv_Control); 50 | fixed4 col; 51 | col = splat_control.r * tex2D (_Splat0, IN.uv_Splat0); 52 | col += splat_control.g * tex2D (_Splat1, IN.uv_Splat1); 53 | col += splat_control.b * tex2D (_Splat2, IN.uv_Splat2); 54 | col += splat_control.a * tex2D (_Splat3, IN.uv_Splat3); 55 | o.Albedo = col.rgb; 56 | 57 | fixed4 nrm; 58 | nrm = splat_control.r * tex2D (_Normal0, IN.uv_Splat0); 59 | nrm += splat_control.g * tex2D (_Normal1, IN.uv_Splat1); 60 | nrm += splat_control.b * tex2D (_Normal2, IN.uv_Splat2); 61 | nrm += splat_control.a * tex2D (_Normal3, IN.uv_Splat3); 62 | // Sum of our four splat weights might not sum up to 1, in 63 | // case of more than 4 total splat maps. Need to lerp towards 64 | // "flat normal" in that case. 65 | fixed splatSum = dot(splat_control, fixed4(1,1,1,1)); 66 | fixed4 flatNormal = fixed4(0.5,0.5,1,0.5); // this is "flat normal" in both DXT5nm and xyz*2-1 cases 67 | nrm = lerp(flatNormal, nrm, splatSum); 68 | o.Normal = UnpackNormal(nrm); 69 | 70 | o.Gloss = col.a * splatSum; 71 | o.Specular = _Shininess; 72 | 73 | o.Alpha = 0.0; 74 | } 75 | ENDCG 76 | } 77 | 78 | Fallback "Hidden/TerrainEngine/Splatmap/Lightmap-AddPass" 79 | } 80 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Nature/TreeCreator/Tree.cginc: -------------------------------------------------------------------------------- 1 | #ifndef TREE_CG_INCLUDED 2 | #define TREE_CG_INCLUDED 3 | 4 | #include "TerrainEngine.cginc" 5 | 6 | fixed4 _Color; 7 | fixed3 _TranslucencyColor; 8 | fixed _TranslucencyViewDependency; 9 | half _ShadowStrength; 10 | 11 | struct LeafSurfaceOutput { 12 | fixed3 Albedo; 13 | fixed3 Normal; 14 | fixed3 Emission; 15 | fixed Translucency; 16 | half Specular; 17 | fixed Gloss; 18 | fixed Alpha; 19 | }; 20 | 21 | inline half4 LightingTreeLeaf (LeafSurfaceOutput s, half3 lightDir, half3 viewDir, half atten) 22 | { 23 | half3 h = normalize (lightDir + viewDir); 24 | 25 | half nl = dot (s.Normal, lightDir); 26 | 27 | half nh = max (0, dot (s.Normal, h)); 28 | half spec = pow (nh, s.Specular * 128.0) * s.Gloss; 29 | 30 | // view dependent back contribution for translucency 31 | fixed backContrib = saturate(dot(viewDir, -lightDir)); 32 | 33 | // normally translucency is more like -nl, but looks better when it's view dependent 34 | backContrib = lerp(saturate(-nl), backContrib, _TranslucencyViewDependency); 35 | 36 | fixed3 translucencyColor = backContrib * s.Translucency * _TranslucencyColor; 37 | 38 | // wrap-around diffuse 39 | nl = max(0, nl * 0.6 + 0.4); 40 | 41 | fixed4 c; 42 | c.rgb = s.Albedo * (translucencyColor * 2 + nl); 43 | c.rgb = c.rgb * _LightColor0.rgb + spec; 44 | 45 | // For directional lights, apply less shadow attenuation 46 | // based on shadow strength parameter. 47 | #if defined(DIRECTIONAL) || defined(DIRECTIONAL_COOKIE) 48 | c.rgb *= lerp(2, atten * 2, _ShadowStrength); 49 | #else 50 | c.rgb *= 2*atten; 51 | #endif 52 | 53 | return c; 54 | } 55 | 56 | #endif -------------------------------------------------------------------------------- /DefaultResourcesExtra/Nature/TreeCreator/TreeCreatorBark.shader: -------------------------------------------------------------------------------- 1 | Shader "Nature/Tree Creator Bark" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 5 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 6 | _BumpMap ("Normalmap", 2D) = "bump" {} 7 | _GlossMap ("Gloss (A)", 2D) = "black" {} 8 | 9 | // These are here only to provide default values 10 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 11 | _Scale ("Scale", Vector) = (1,1,1,1) 12 | _SquashAmount ("Squash", Float) = 1 13 | } 14 | 15 | SubShader { 16 | Tags { "RenderType"="TreeBark" } 17 | LOD 200 18 | 19 | CGPROGRAM 20 | #pragma surface surf BlinnPhong vertex:TreeVertBark addshadow nolightmap 21 | #pragma exclude_renderers flash 22 | #pragma glsl_no_auto_normalization 23 | #include "Tree.cginc" 24 | 25 | sampler2D _MainTex; 26 | sampler2D _BumpMap; 27 | sampler2D _GlossMap; 28 | half _Shininess; 29 | 30 | struct Input { 31 | float2 uv_MainTex; 32 | fixed4 color : COLOR; 33 | }; 34 | 35 | void surf (Input IN, inout SurfaceOutput o) { 36 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex); 37 | o.Albedo = c.rgb * _Color.rgb * IN.color.a; 38 | o.Gloss = tex2D(_GlossMap, IN.uv_MainTex).a; 39 | o.Alpha = c.a; 40 | o.Specular = _Shininess; 41 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_MainTex)); 42 | } 43 | ENDCG 44 | } 45 | 46 | Dependency "OptimizedShader" = "Hidden/Nature/Tree Creator Bark Optimized" 47 | FallBack "Diffuse" 48 | } 49 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Nature/TreeCreator/TreeCreatorBarkOptimized.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/Nature/Tree Creator Bark Optimized" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 5 | _BumpSpecMap ("Normalmap (GA) Spec (R)", 2D) = "bump" {} 6 | _TranslucencyMap ("Trans (RGB) Gloss(A)", 2D) = "white" {} 7 | 8 | // These are here only to provide default values 9 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 10 | _Scale ("Scale", Vector) = (1,1,1,1) 11 | _SquashAmount ("Squash", Float) = 1 12 | } 13 | 14 | SubShader { 15 | Tags { "RenderType"="TreeBark" } 16 | LOD 200 17 | 18 | CGPROGRAM 19 | #pragma surface surf BlinnPhong vertex:TreeVertBark addshadow nolightmap 20 | #pragma exclude_renderers flash 21 | #pragma glsl_no_auto_normalization 22 | #include "Tree.cginc" 23 | 24 | sampler2D _MainTex; 25 | sampler2D _BumpSpecMap; 26 | sampler2D _TranslucencyMap; 27 | 28 | struct Input { 29 | float2 uv_MainTex; 30 | fixed4 color : COLOR; 31 | }; 32 | 33 | void surf (Input IN, inout SurfaceOutput o) { 34 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex); 35 | o.Albedo = c.rgb * _Color.rgb * IN.color.a; 36 | 37 | fixed4 trngls = tex2D (_TranslucencyMap, IN.uv_MainTex); 38 | o.Gloss = trngls.a * _Color.r; 39 | o.Alpha = c.a; 40 | 41 | half4 norspc = tex2D (_BumpSpecMap, IN.uv_MainTex); 42 | o.Specular = norspc.r; 43 | o.Normal = UnpackNormalDXT5nm(norspc); 44 | } 45 | ENDCG 46 | } 47 | 48 | Dependency "BillboardShader" = "Hidden/Nature/Tree Creator Bark Rendertex" 49 | } 50 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Nature/TreeCreator/TreeCreatorBarkRendertex.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/Nature/Tree Creator Bark Rendertex" { 2 | Properties { 3 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 4 | _BumpSpecMap ("Normalmap (GA) Spec (R)", 2D) = "bump" {} 5 | _TranslucencyMap ("Trans (RGB) Gloss(A)", 2D) = "white" {} 6 | 7 | // These are here only to provide default values 8 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 9 | _Scale ("Scale", Vector) = (1,1,1,1) 10 | _SquashAmount ("Squash", Float) = 1 11 | } 12 | 13 | SubShader { 14 | Fog { Mode Off } 15 | Pass { 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag 19 | #include "UnityCG.cginc" 20 | 21 | struct v2f { 22 | float4 pos : SV_POSITION; 23 | float2 uv : TEXCOORD0; 24 | float3 color : TEXCOORD1; 25 | float2 params[3]: TEXCOORD2; 26 | }; 27 | 28 | CBUFFER_START(UnityTerrainImposter) 29 | float3 _TerrainTreeLightDirections[4]; 30 | float4 _TerrainTreeLightColors[4]; 31 | CBUFFER_END 32 | 33 | v2f vert (appdata_full v) { 34 | v2f o; 35 | o.pos = mul (UNITY_MATRIX_MVP, v.vertex); 36 | o.uv = v.texcoord.xy; 37 | float3 viewDir = normalize(ObjSpaceViewDir(v.vertex)); 38 | 39 | for (int j = 0; j < 3; j++) 40 | { 41 | float3 lightDir = _TerrainTreeLightDirections[j]; 42 | 43 | half nl = dot (v.normal, lightDir); 44 | o.params[j].r = max (0, nl); 45 | 46 | half3 h = normalize (lightDir + viewDir); 47 | float nh = max (0, dot (v.normal, h)); 48 | o.params[j].g = nh; 49 | } 50 | 51 | o.color = v.color.a; 52 | return o; 53 | } 54 | 55 | sampler2D _MainTex; 56 | sampler2D _BumpSpecMap; 57 | sampler2D _TranslucencyMap; 58 | fixed4 _SpecColor; 59 | 60 | fixed4 frag (v2f i) : SV_Target 61 | { 62 | fixed3 albedo = tex2D (_MainTex, i.uv).rgb * i.color; 63 | half gloss = tex2D(_TranslucencyMap, i.uv).a; 64 | half specular = tex2D (_BumpSpecMap, i.uv).r * 128.0; 65 | 66 | half3 light = UNITY_LIGHTMODEL_AMBIENT * albedo; 67 | 68 | for (int j = 0; j < 3; j++) 69 | { 70 | half3 lightColor = _TerrainTreeLightColors[j].rgb; 71 | 72 | half nl = i.params[j].r; 73 | light += albedo * lightColor * nl; 74 | 75 | float nh = i.params[j].g; 76 | float spec = pow (nh, specular) * gloss; 77 | light += lightColor * _SpecColor.rgb * spec; 78 | } 79 | 80 | fixed4 c; 81 | c.rgb = light * 2.0; 82 | c.a = 1.0; 83 | return c; 84 | } 85 | ENDCG 86 | } 87 | } 88 | 89 | FallBack Off 90 | } 91 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Nature/TreeCreator/TreeCreatorLeaves.shader: -------------------------------------------------------------------------------- 1 | Shader "Nature/Tree Creator Leaves" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 5 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 6 | _BumpMap ("Normalmap", 2D) = "bump" {} 7 | _GlossMap ("Gloss (A)", 2D) = "black" {} 8 | _TranslucencyMap ("Translucency (A)", 2D) = "white" {} 9 | _ShadowOffset ("Shadow Offset (A)", 2D) = "black" {} 10 | 11 | // These are here only to provide default values 12 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.3 13 | _Scale ("Scale", Vector) = (1,1,1,1) 14 | _SquashAmount ("Squash", Float) = 1 15 | } 16 | 17 | SubShader { 18 | Tags { "IgnoreProjector"="True" "RenderType"="TreeLeaf" } 19 | LOD 200 20 | 21 | CGPROGRAM 22 | #pragma surface surf TreeLeaf alphatest:_Cutoff vertex:TreeVertLeaf addshadow nolightmap 23 | #pragma exclude_renderers flash 24 | #pragma glsl_no_auto_normalization 25 | #include "Tree.cginc" 26 | 27 | sampler2D _MainTex; 28 | sampler2D _BumpMap; 29 | sampler2D _GlossMap; 30 | sampler2D _TranslucencyMap; 31 | half _Shininess; 32 | 33 | struct Input { 34 | float2 uv_MainTex; 35 | fixed4 color : COLOR; // color.a = AO 36 | }; 37 | 38 | void surf (Input IN, inout LeafSurfaceOutput o) { 39 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex); 40 | o.Albedo = c.rgb * _Color.rgb * IN.color.a; 41 | o.Translucency = tex2D(_TranslucencyMap, IN.uv_MainTex).rgb; 42 | o.Gloss = tex2D(_GlossMap, IN.uv_MainTex).a; 43 | o.Alpha = c.a; 44 | o.Specular = _Shininess; 45 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_MainTex)); 46 | } 47 | ENDCG 48 | } 49 | 50 | Dependency "OptimizedShader" = "Hidden/Nature/Tree Creator Leaves Optimized" 51 | FallBack "Diffuse" 52 | } 53 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Nature/TreeCreator/TreeVertexLit.cginc: -------------------------------------------------------------------------------- 1 | #ifndef TREE_VERTEXLIT_CG_INCLUDED 2 | #define TREE_VERTEXLIT_CG_INCLUDED 3 | 4 | #include "UnityCG.cginc" 5 | #include "TerrainEngine.cginc" 6 | 7 | fixed4 _Color; 8 | fixed3 _TranslucencyColor; 9 | fixed _TranslucencyViewDependency; 10 | half _ShadowStrength; 11 | 12 | // --- Lighting ---------------------------------------------------------------- 13 | 14 | fixed3 _LightColor0; 15 | fixed3 ShadeTranslucentMainLight (float4 vertex, float3 normal) 16 | { 17 | float3 viewDir = normalize(WorldSpaceViewDir(vertex)); 18 | float3 lightDir = normalize(WorldSpaceLightDir(vertex)); 19 | fixed3 lightColor = _LightColor0.rgb; 20 | 21 | float nl = dot (normal, lightDir); 22 | 23 | // view dependent back contribution for translucency 24 | fixed backContrib = saturate(dot(viewDir, -lightDir)); 25 | 26 | // normally translucency is more like -nl, but looks better when it's view dependent 27 | backContrib = lerp(saturate(-nl), backContrib, _TranslucencyViewDependency); 28 | 29 | // wrap-around diffuse 30 | fixed diffuse = max(0, nl * 0.6 + 0.4); 31 | 32 | return lightColor.rgb * (diffuse + backContrib * _TranslucencyColor); 33 | } 34 | 35 | 36 | fixed3 ShadeTranslucentLights (float4 vertex, float3 normal) 37 | { 38 | float3 viewDir = normalize(WorldSpaceViewDir(vertex)); 39 | float3 mainLightDir = normalize(WorldSpaceLightDir(vertex)); 40 | float3 frontlight = ShadeSH9 (float4(normal,1.0)); 41 | float3 backlight = ShadeSH9 (float4(-normal,1.0)); 42 | #ifdef VERTEXLIGHT_ON 43 | float3 worldPos = mul(_Object2World, vertex).xyz; 44 | frontlight += Shade4PointLights ( 45 | unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0, 46 | unity_LightColor[0].rgb, unity_LightColor[1].rgb, unity_LightColor[2].rgb, unity_LightColor[3].rgb, 47 | unity_4LightAtten0, worldPos, normal); 48 | backlight += Shade4PointLights ( 49 | unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0, 50 | unity_LightColor[0].rgb, unity_LightColor[1].rgb, unity_LightColor[2].rgb, unity_LightColor[3].rgb, 51 | unity_4LightAtten0, worldPos, -normal); 52 | #endif 53 | 54 | // view dependent back contribution for translucency using main light as a cue 55 | fixed backContrib = saturate(dot(viewDir, -mainLightDir)); 56 | backlight = lerp(backlight, backlight * backContrib, _TranslucencyViewDependency); 57 | 58 | // as we integrate over whole sphere instead of normal hemi-sphere 59 | // lighting gets too washed out, so let's half it down 60 | return 0.5 * (frontlight + backlight * _TranslucencyColor); 61 | } 62 | 63 | 64 | #endif 65 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Normal-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Bumped Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 5 | _Shininess ("Shininess", Range (0.03, 1)) = 0.078125 6 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 7 | _BumpMap ("Normalmap", 2D) = "bump" {} 8 | } 9 | SubShader { 10 | Tags { "RenderType"="Opaque" } 11 | LOD 400 12 | 13 | CGPROGRAM 14 | #pragma surface surf BlinnPhong 15 | 16 | 17 | sampler2D _MainTex; 18 | sampler2D _BumpMap; 19 | fixed4 _Color; 20 | half _Shininess; 21 | 22 | struct Input { 23 | float2 uv_MainTex; 24 | float2 uv_BumpMap; 25 | }; 26 | 27 | void surf (Input IN, inout SurfaceOutput o) { 28 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 29 | o.Albedo = tex.rgb * _Color.rgb; 30 | o.Gloss = tex.a; 31 | o.Alpha = tex.a * _Color.a; 32 | o.Specular = _Shininess; 33 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 34 | } 35 | ENDCG 36 | } 37 | 38 | FallBack "Specular" 39 | } 40 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Normal-Bumped.shader: -------------------------------------------------------------------------------- 1 | Shader "Bumped Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB)", 2D) = "white" {} 5 | _BumpMap ("Normalmap", 2D) = "bump" {} 6 | } 7 | 8 | SubShader { 9 | Tags { "RenderType"="Opaque" } 10 | LOD 300 11 | 12 | CGPROGRAM 13 | #pragma surface surf Lambert 14 | 15 | sampler2D _MainTex; 16 | sampler2D _BumpMap; 17 | fixed4 _Color; 18 | 19 | struct Input { 20 | float2 uv_MainTex; 21 | float2 uv_BumpMap; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 26 | o.Albedo = c.rgb; 27 | o.Alpha = c.a; 28 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 29 | } 30 | ENDCG 31 | } 32 | 33 | FallBack "Diffuse" 34 | } 35 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Normal-Diffuse.shader: -------------------------------------------------------------------------------- 1 | Shader "Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB)", 2D) = "white" {} 5 | } 6 | SubShader { 7 | Tags { "RenderType"="Opaque" } 8 | LOD 200 9 | 10 | CGPROGRAM 11 | #pragma surface surf Lambert 12 | 13 | sampler2D _MainTex; 14 | fixed4 _Color; 15 | 16 | struct Input { 17 | float2 uv_MainTex; 18 | }; 19 | 20 | void surf (Input IN, inout SurfaceOutput o) { 21 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 22 | o.Albedo = c.rgb; 23 | o.Alpha = c.a; 24 | } 25 | ENDCG 26 | } 27 | 28 | Fallback "VertexLit" 29 | } 30 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Normal-DiffuseDetail.shader: -------------------------------------------------------------------------------- 1 | Shader "Diffuse Detail" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _MainTex ("Base (RGB)", 2D) = "white" {} 5 | _Detail ("Detail (RGB)", 2D) = "gray" {} 6 | } 7 | 8 | SubShader { 9 | Tags { "RenderType"="Opaque" } 10 | LOD 250 11 | 12 | CGPROGRAM 13 | #pragma surface surf Lambert 14 | 15 | sampler2D _MainTex; 16 | sampler2D _Detail; 17 | fixed4 _Color; 18 | 19 | struct Input { 20 | float2 uv_MainTex; 21 | float2 uv_Detail; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 26 | c.rgb *= tex2D(_Detail,IN.uv_Detail).rgb*2; 27 | o.Albedo = c.rgb; 28 | o.Alpha = c.a; 29 | } 30 | ENDCG 31 | } 32 | 33 | Fallback "Diffuse" 34 | } 35 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Normal-DiffuseFast.shader: -------------------------------------------------------------------------------- 1 | // Does not do anything in 3.x 2 | Shader "Legacy Shaders/Diffuse Fast" { 3 | Properties { 4 | _Color ("Main Color", Color) = (1,1,1,1) 5 | _MainTex ("Base (RGB)", 2D) = "white" {} 6 | } 7 | Fallback "VertexLit" 8 | } -------------------------------------------------------------------------------- /DefaultResourcesExtra/Normal-Glossy.shader: -------------------------------------------------------------------------------- 1 | Shader "Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 7 | } 8 | 9 | SubShader { 10 | Tags { "RenderType"="Opaque" } 11 | LOD 300 12 | 13 | CGPROGRAM 14 | #pragma surface surf BlinnPhong 15 | 16 | sampler2D _MainTex; 17 | fixed4 _Color; 18 | half _Shininess; 19 | 20 | struct Input { 21 | float2 uv_MainTex; 22 | }; 23 | 24 | void surf (Input IN, inout SurfaceOutput o) { 25 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 26 | o.Albedo = tex.rgb * _Color.rgb; 27 | o.Gloss = tex.a; 28 | o.Alpha = tex.a * _Color.a; 29 | o.Specular = _Shininess; 30 | } 31 | ENDCG 32 | } 33 | 34 | Fallback "VertexLit" 35 | } 36 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Normal-Parallax.shader: -------------------------------------------------------------------------------- 1 | Shader "Parallax Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 5 | _MainTex ("Base (RGB)", 2D) = "white" {} 6 | _BumpMap ("Normalmap", 2D) = "bump" {} 7 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 8 | } 9 | 10 | SubShader { 11 | Tags { "RenderType"="Opaque" } 12 | LOD 500 13 | 14 | CGPROGRAM 15 | #pragma surface surf Lambert 16 | 17 | sampler2D _MainTex; 18 | sampler2D _BumpMap; 19 | sampler2D _ParallaxMap; 20 | fixed4 _Color; 21 | float _Parallax; 22 | 23 | struct Input { 24 | float2 uv_MainTex; 25 | float2 uv_BumpMap; 26 | float3 viewDir; 27 | }; 28 | 29 | void surf (Input IN, inout SurfaceOutput o) { 30 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 31 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 32 | IN.uv_MainTex += offset; 33 | IN.uv_BumpMap += offset; 34 | 35 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color; 36 | o.Albedo = c.rgb; 37 | o.Alpha = c.a; 38 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 39 | } 40 | ENDCG 41 | } 42 | 43 | FallBack "Bumped Diffuse" 44 | } 45 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Normal-ParallaxSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Parallax Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 7 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 8 | _BumpMap ("Normalmap", 2D) = "bump" {} 9 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 10 | } 11 | SubShader { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 600 14 | 15 | CGPROGRAM 16 | #pragma surface surf BlinnPhong 17 | #pragma target 3.0 18 | 19 | sampler2D _MainTex; 20 | sampler2D _BumpMap; 21 | sampler2D _ParallaxMap; 22 | fixed4 _Color; 23 | half _Shininess; 24 | float _Parallax; 25 | 26 | struct Input { 27 | float2 uv_MainTex; 28 | float2 uv_BumpMap; 29 | float3 viewDir; 30 | }; 31 | 32 | void surf (Input IN, inout SurfaceOutput o) { 33 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 34 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 35 | IN.uv_MainTex += offset; 36 | IN.uv_BumpMap += offset; 37 | 38 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 39 | o.Albedo = tex.rgb * _Color.rgb; 40 | o.Gloss = tex.a; 41 | o.Alpha = tex.a * _Color.a; 42 | o.Specular = _Shininess; 43 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 44 | } 45 | ENDCG 46 | } 47 | 48 | FallBack "Bumped Specular" 49 | } 50 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Particle Add.shader: -------------------------------------------------------------------------------- 1 | Shader "Particles/Additive" { 2 | Properties { 3 | _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5) 4 | _MainTex ("Particle Texture", 2D) = "white" {} 5 | _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 6 | } 7 | 8 | Category { 9 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 10 | Blend SrcAlpha One 11 | AlphaTest Greater .01 12 | ColorMask RGB 13 | Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) } 14 | 15 | SubShader { 16 | Pass { 17 | 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | #pragma multi_compile_particles 22 | 23 | #include "UnityCG.cginc" 24 | 25 | sampler2D _MainTex; 26 | fixed4 _TintColor; 27 | 28 | struct appdata_t { 29 | float4 vertex : POSITION; 30 | fixed4 color : COLOR; 31 | float2 texcoord : TEXCOORD0; 32 | }; 33 | 34 | struct v2f { 35 | float4 vertex : SV_POSITION; 36 | fixed4 color : COLOR; 37 | float2 texcoord : TEXCOORD0; 38 | #ifdef SOFTPARTICLES_ON 39 | float4 projPos : TEXCOORD1; 40 | #endif 41 | }; 42 | 43 | float4 _MainTex_ST; 44 | 45 | v2f vert (appdata_t v) 46 | { 47 | v2f o; 48 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 49 | #ifdef SOFTPARTICLES_ON 50 | o.projPos = ComputeScreenPos (o.vertex); 51 | COMPUTE_EYEDEPTH(o.projPos.z); 52 | #endif 53 | o.color = v.color; 54 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 55 | return o; 56 | } 57 | 58 | sampler2D_float _CameraDepthTexture; 59 | float _InvFade; 60 | 61 | fixed4 frag (v2f i) : SV_Target 62 | { 63 | #ifdef SOFTPARTICLES_ON 64 | float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos))); 65 | float partZ = i.projPos.z; 66 | float fade = saturate (_InvFade * (sceneZ-partZ)); 67 | i.color.a *= fade; 68 | #endif 69 | 70 | return 2.0f * i.color * _TintColor * tex2D(_MainTex, i.texcoord); 71 | } 72 | ENDCG 73 | } 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Particle AddMultiply.shader: -------------------------------------------------------------------------------- 1 | Shader "Particles/~Additive-Multiply" { 2 | Properties { 3 | _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5) 4 | _MainTex ("Particle Texture", 2D) = "white" {} 5 | _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 6 | } 7 | 8 | Category { 9 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 10 | Blend One OneMinusSrcAlpha 11 | ColorMask RGB 12 | Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,1) } 13 | 14 | SubShader { 15 | Pass { 16 | 17 | CGPROGRAM 18 | #pragma vertex vert 19 | #pragma fragment frag 20 | #pragma multi_compile_particles 21 | 22 | #include "UnityCG.cginc" 23 | 24 | sampler2D _MainTex; 25 | fixed4 _TintColor; 26 | 27 | struct appdata_t { 28 | float4 vertex : POSITION; 29 | fixed4 color : COLOR; 30 | float2 texcoord : TEXCOORD0; 31 | }; 32 | 33 | struct v2f { 34 | float4 vertex : SV_POSITION; 35 | fixed4 color : COLOR; 36 | float2 texcoord : TEXCOORD0; 37 | #ifdef SOFTPARTICLES_ON 38 | float4 projPos : TEXCOORD1; 39 | #endif 40 | }; 41 | 42 | float4 _MainTex_ST; 43 | 44 | v2f vert (appdata_t v) 45 | { 46 | v2f o; 47 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 48 | #ifdef SOFTPARTICLES_ON 49 | o.projPos = ComputeScreenPos (o.vertex); 50 | COMPUTE_EYEDEPTH(o.projPos.z); 51 | #endif 52 | o.color = v.color; 53 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 54 | return o; 55 | } 56 | 57 | sampler2D_float _CameraDepthTexture; 58 | float _InvFade; 59 | 60 | fixed4 frag (v2f i) : SV_Target 61 | { 62 | #ifdef SOFTPARTICLES_ON 63 | float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos))); 64 | float partZ = i.projPos.z; 65 | float fade = saturate (_InvFade * (sceneZ-partZ)); 66 | i.color *= fade; 67 | #endif 68 | 69 | fixed4 tex = tex2D(_MainTex, i.texcoord); 70 | fixed4 col; 71 | col.rgb = _TintColor.rgb * tex.rgb * i.color.rgb * 2.0f; 72 | col.a = (1 - tex.a) * (_TintColor.a * i.color.a * 2.0f); 73 | return col; 74 | } 75 | ENDCG 76 | } 77 | } 78 | 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Particle AddSmooth.shader: -------------------------------------------------------------------------------- 1 | Shader "Particles/Additive (Soft)" { 2 | Properties { 3 | _MainTex ("Particle Texture", 2D) = "white" {} 4 | _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 5 | } 6 | 7 | Category { 8 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 9 | Blend One OneMinusSrcColor 10 | ColorMask RGB 11 | Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) } 12 | 13 | SubShader { 14 | Pass { 15 | 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag 19 | #pragma multi_compile_particles 20 | 21 | #include "UnityCG.cginc" 22 | 23 | sampler2D _MainTex; 24 | fixed4 _TintColor; 25 | 26 | struct appdata_t { 27 | float4 vertex : POSITION; 28 | fixed4 color : COLOR; 29 | float2 texcoord : TEXCOORD0; 30 | }; 31 | 32 | struct v2f { 33 | float4 vertex : SV_POSITION; 34 | fixed4 color : COLOR; 35 | float2 texcoord : TEXCOORD0; 36 | #ifdef SOFTPARTICLES_ON 37 | float4 projPos : TEXCOORD1; 38 | #endif 39 | }; 40 | 41 | float4 _MainTex_ST; 42 | 43 | v2f vert (appdata_t v) 44 | { 45 | v2f o; 46 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 47 | #ifdef SOFTPARTICLES_ON 48 | o.projPos = ComputeScreenPos (o.vertex); 49 | COMPUTE_EYEDEPTH(o.projPos.z); 50 | #endif 51 | o.color = v.color; 52 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 53 | return o; 54 | } 55 | 56 | sampler2D_float _CameraDepthTexture; 57 | float _InvFade; 58 | 59 | fixed4 frag (v2f i) : SV_Target 60 | { 61 | #ifdef SOFTPARTICLES_ON 62 | float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos))); 63 | float partZ = i.projPos.z; 64 | float fade = saturate (_InvFade * (sceneZ-partZ)); 65 | i.color.a *= fade; 66 | #endif 67 | 68 | half4 prev = i.color * tex2D(_MainTex, i.texcoord); 69 | prev.rgb *= prev.a; 70 | return prev; 71 | } 72 | ENDCG 73 | } 74 | } 75 | } 76 | } -------------------------------------------------------------------------------- /DefaultResourcesExtra/Particle Alpha Blend.shader: -------------------------------------------------------------------------------- 1 | Shader "Particles/Alpha Blended" { 2 | Properties { 3 | _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5) 4 | _MainTex ("Particle Texture", 2D) = "white" {} 5 | _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 6 | } 7 | 8 | Category { 9 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 10 | Blend SrcAlpha OneMinusSrcAlpha 11 | AlphaTest Greater .01 12 | ColorMask RGB 13 | Cull Off Lighting Off ZWrite Off 14 | 15 | SubShader { 16 | Pass { 17 | 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | #pragma multi_compile_particles 22 | 23 | #include "UnityCG.cginc" 24 | 25 | sampler2D _MainTex; 26 | fixed4 _TintColor; 27 | 28 | struct appdata_t { 29 | float4 vertex : POSITION; 30 | fixed4 color : COLOR; 31 | float2 texcoord : TEXCOORD0; 32 | }; 33 | 34 | struct v2f { 35 | float4 vertex : SV_POSITION; 36 | fixed4 color : COLOR; 37 | float2 texcoord : TEXCOORD0; 38 | #ifdef SOFTPARTICLES_ON 39 | float4 projPos : TEXCOORD1; 40 | #endif 41 | }; 42 | 43 | float4 _MainTex_ST; 44 | 45 | v2f vert (appdata_t v) 46 | { 47 | v2f o; 48 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 49 | #ifdef SOFTPARTICLES_ON 50 | o.projPos = ComputeScreenPos (o.vertex); 51 | COMPUTE_EYEDEPTH(o.projPos.z); 52 | #endif 53 | o.color = v.color; 54 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 55 | return o; 56 | } 57 | 58 | sampler2D_float _CameraDepthTexture; 59 | float _InvFade; 60 | 61 | fixed4 frag (v2f i) : SV_Target 62 | { 63 | #ifdef SOFTPARTICLES_ON 64 | float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos))); 65 | float partZ = i.projPos.z; 66 | float fade = saturate (_InvFade * (sceneZ-partZ)); 67 | i.color.a *= fade; 68 | #endif 69 | 70 | return 2.0f * i.color * _TintColor * tex2D(_MainTex, i.texcoord); 71 | } 72 | ENDCG 73 | } 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Particle Blend.shader: -------------------------------------------------------------------------------- 1 | Shader "Particles/Blend" { 2 | Properties { 3 | _MainTex ("Particle Texture", 2D) = "white" {} 4 | _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 5 | } 6 | 7 | Category { 8 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 9 | Blend DstColor One 10 | ColorMask RGB 11 | Cull Off Lighting Off ZWrite Off Fog { Color (0,0,0,0) } 12 | 13 | SubShader { 14 | Pass { 15 | 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag 19 | #pragma multi_compile_particles 20 | 21 | #include "UnityCG.cginc" 22 | 23 | sampler2D _MainTex; 24 | fixed4 _TintColor; 25 | 26 | struct appdata_t { 27 | float4 vertex : POSITION; 28 | fixed4 color : COLOR; 29 | float2 texcoord : TEXCOORD0; 30 | }; 31 | 32 | struct v2f { 33 | float4 vertex : SV_POSITION; 34 | fixed4 color : COLOR; 35 | float2 texcoord : TEXCOORD0; 36 | #ifdef SOFTPARTICLES_ON 37 | float4 projPos : TEXCOORD1; 38 | #endif 39 | }; 40 | 41 | float4 _MainTex_ST; 42 | 43 | v2f vert (appdata_t v) 44 | { 45 | v2f o; 46 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 47 | #ifdef SOFTPARTICLES_ON 48 | o.projPos = ComputeScreenPos (o.vertex); 49 | COMPUTE_EYEDEPTH(o.projPos.z); 50 | #endif 51 | o.color = v.color; 52 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 53 | return o; 54 | } 55 | 56 | sampler2D_float _CameraDepthTexture; 57 | float _InvFade; 58 | 59 | fixed4 frag (v2f i) : SV_Target 60 | { 61 | #ifdef SOFTPARTICLES_ON 62 | float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos))); 63 | float partZ = i.projPos.z; 64 | float fade = saturate (_InvFade * (sceneZ-partZ)); 65 | i.color *= fade; 66 | #endif 67 | 68 | return i.color * tex2D(_MainTex, i.texcoord); 69 | } 70 | ENDCG 71 | } 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Particle Multiply.shader: -------------------------------------------------------------------------------- 1 | Shader "Particles/Multiply" { 2 | Properties { 3 | _MainTex ("Particle Texture", 2D) = "white" {} 4 | _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 5 | } 6 | 7 | Category { 8 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 9 | Blend Zero SrcColor 10 | Cull Off Lighting Off ZWrite Off Fog { Color (1,1,1,1) } 11 | 12 | SubShader { 13 | Pass { 14 | 15 | CGPROGRAM 16 | #pragma vertex vert 17 | #pragma fragment frag 18 | #pragma multi_compile_particles 19 | 20 | #include "UnityCG.cginc" 21 | 22 | sampler2D _MainTex; 23 | fixed4 _TintColor; 24 | 25 | struct appdata_t { 26 | float4 vertex : POSITION; 27 | fixed4 color : COLOR; 28 | float2 texcoord : TEXCOORD0; 29 | }; 30 | 31 | struct v2f { 32 | float4 vertex : SV_POSITION; 33 | fixed4 color : COLOR; 34 | float2 texcoord : TEXCOORD0; 35 | #ifdef SOFTPARTICLES_ON 36 | float4 projPos : TEXCOORD1; 37 | #endif 38 | }; 39 | 40 | float4 _MainTex_ST; 41 | 42 | v2f vert (appdata_t v) 43 | { 44 | v2f o; 45 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 46 | #ifdef SOFTPARTICLES_ON 47 | o.projPos = ComputeScreenPos (o.vertex); 48 | COMPUTE_EYEDEPTH(o.projPos.z); 49 | #endif 50 | o.color = v.color; 51 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 52 | return o; 53 | } 54 | 55 | sampler2D_float _CameraDepthTexture; 56 | float _InvFade; 57 | 58 | fixed4 frag (v2f i) : SV_Target 59 | { 60 | #ifdef SOFTPARTICLES_ON 61 | float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos))); 62 | float partZ = i.projPos.z; 63 | float fade = saturate (_InvFade * (sceneZ-partZ)); 64 | i.color.a *= fade; 65 | #endif 66 | 67 | half4 prev = i.color * tex2D(_MainTex, i.texcoord); 68 | return lerp(half4(1,1,1,1), prev, prev.a); 69 | } 70 | ENDCG 71 | } 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Particle MultiplyDouble.shader: -------------------------------------------------------------------------------- 1 | Shader "Particles/Multiply (Double)" { 2 | Properties { 3 | _MainTex ("Particle Texture", 2D) = "white" {} 4 | _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 5 | } 6 | 7 | Category { 8 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 9 | Blend DstColor SrcColor 10 | ColorMask RGB 11 | Cull Off Lighting Off ZWrite Off Fog { Color (0.5,0.5,0.5,0.5) } 12 | 13 | SubShader { 14 | Pass { 15 | 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag 19 | #pragma multi_compile_particles 20 | 21 | #include "UnityCG.cginc" 22 | 23 | sampler2D _MainTex; 24 | fixed4 _TintColor; 25 | 26 | struct appdata_t { 27 | float4 vertex : POSITION; 28 | fixed4 color : COLOR; 29 | float2 texcoord : TEXCOORD0; 30 | }; 31 | 32 | struct v2f { 33 | float4 vertex : SV_POSITION; 34 | fixed4 color : COLOR; 35 | float2 texcoord : TEXCOORD0; 36 | #ifdef SOFTPARTICLES_ON 37 | float4 projPos : TEXCOORD1; 38 | #endif 39 | }; 40 | 41 | float4 _MainTex_ST; 42 | 43 | v2f vert (appdata_t v) 44 | { 45 | v2f o; 46 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 47 | #ifdef SOFTPARTICLES_ON 48 | o.projPos = ComputeScreenPos (o.vertex); 49 | COMPUTE_EYEDEPTH(o.projPos.z); 50 | #endif 51 | o.color = v.color; 52 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 53 | return o; 54 | } 55 | 56 | sampler2D_float _CameraDepthTexture; 57 | float _InvFade; 58 | 59 | fixed4 frag (v2f i) : SV_Target 60 | { 61 | #ifdef SOFTPARTICLES_ON 62 | float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos))); 63 | float partZ = i.projPos.z; 64 | float fade = saturate (_InvFade * (sceneZ-partZ)); 65 | i.color.a *= fade; 66 | #endif 67 | 68 | fixed4 col; 69 | fixed4 tex = tex2D(_MainTex, i.texcoord); 70 | col.rgb = tex.rgb * i.color.rgb * 2; 71 | col.a = i.color.a * tex.a; 72 | return lerp(fixed4(0.5f,0.5f,0.5f,0.5f), col, col.a); 73 | } 74 | ENDCG 75 | } 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Particle Premultiply Blend.shader: -------------------------------------------------------------------------------- 1 | Shader "Particles/Alpha Blended Premultiply" { 2 | Properties { 3 | _MainTex ("Particle Texture", 2D) = "white" {} 4 | _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 5 | } 6 | 7 | Category { 8 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 9 | Blend One OneMinusSrcAlpha 10 | ColorMask RGB 11 | Cull Off Lighting Off ZWrite Off Fog { Mode Off } 12 | 13 | SubShader { 14 | Pass { 15 | 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag 19 | #pragma multi_compile_particles 20 | 21 | #include "UnityCG.cginc" 22 | 23 | sampler2D _MainTex; 24 | fixed4 _TintColor; 25 | 26 | struct appdata_t { 27 | float4 vertex : POSITION; 28 | fixed4 color : COLOR; 29 | float2 texcoord : TEXCOORD0; 30 | }; 31 | 32 | struct v2f { 33 | float4 vertex : SV_POSITION; 34 | fixed4 color : COLOR; 35 | float2 texcoord : TEXCOORD0; 36 | #ifdef SOFTPARTICLES_ON 37 | float4 projPos : TEXCOORD1; 38 | #endif 39 | }; 40 | 41 | float4 _MainTex_ST; 42 | 43 | v2f vert (appdata_t v) 44 | { 45 | v2f o; 46 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 47 | #ifdef SOFTPARTICLES_ON 48 | o.projPos = ComputeScreenPos (o.vertex); 49 | COMPUTE_EYEDEPTH(o.projPos.z); 50 | #endif 51 | o.color = v.color; 52 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 53 | return o; 54 | } 55 | 56 | sampler2D_float _CameraDepthTexture; 57 | float _InvFade; 58 | 59 | fixed4 frag (v2f i) : SV_Target 60 | { 61 | #ifdef SOFTPARTICLES_ON 62 | float sceneZ = LinearEyeDepth (SAMPLE_DEPTH_TEXTURE_PROJ(_CameraDepthTexture, UNITY_PROJ_COORD(i.projPos))); 63 | float partZ = i.projPos.z; 64 | float fade = saturate (_InvFade * (sceneZ-partZ)); 65 | i.color.a *= fade; 66 | #endif 67 | 68 | return i.color * tex2D(_MainTex, i.texcoord) * i.color.a; 69 | } 70 | ENDCG 71 | } 72 | } 73 | } 74 | } 75 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Particle VertexLit Blended.shader: -------------------------------------------------------------------------------- 1 | Shader "Particles/VertexLit Blended" { 2 | Properties { 3 | _EmisColor ("Emissive Color", Color) = (.2,.2,.2,0) 4 | _MainTex ("Particle Texture", 2D) = "white" {} 5 | } 6 | 7 | SubShader { 8 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } 9 | Tags { "LightMode" = "Vertex" } 10 | Cull Off 11 | Lighting On 12 | Material { Emission [_EmisColor] } 13 | ColorMaterial AmbientAndDiffuse 14 | ZWrite Off 15 | ColorMask RGB 16 | Blend SrcAlpha OneMinusSrcAlpha 17 | AlphaTest Greater .001 18 | Pass { 19 | SetTexture [_MainTex] { combine primary * texture } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /DefaultResourcesExtra/Reflect-BumpSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Reflective/Bumped Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5,0.5,0.5,1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 7 | _MainTex ("Base (RGB) RefStrGloss (A)", 2D) = "white" {} 8 | _Cube ("Reflection Cubemap", Cube) = "" { TexGen CubeReflect } 9 | _BumpMap ("Normalmap", 2D) = "bump" {} 10 | } 11 | 12 | SubShader { 13 | Tags { "RenderType"="Opaque" } 14 | LOD 400 15 | CGPROGRAM 16 | #pragma surface surf BlinnPhong 17 | #pragma target 3.0 18 | //input limit (8) exceeded, shader uses 9 19 | #pragma exclude_renderers d3d11_9x 20 | 21 | sampler2D _MainTex; 22 | sampler2D _BumpMap; 23 | samplerCUBE _Cube; 24 | 25 | fixed4 _Color; 26 | fixed4 _ReflectColor; 27 | half _Shininess; 28 | 29 | struct Input { 30 | float2 uv_MainTex; 31 | float2 uv_BumpMap; 32 | float3 worldRefl; 33 | INTERNAL_DATA 34 | }; 35 | 36 | void surf (Input IN, inout SurfaceOutput o) { 37 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 38 | fixed4 c = tex * _Color; 39 | o.Albedo = c.rgb; 40 | 41 | o.Gloss = tex.a; 42 | o.Specular = _Shininess; 43 | 44 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 45 | 46 | float3 worldRefl = WorldReflectionVector (IN, o.Normal); 47 | fixed4 reflcol = texCUBE (_Cube, worldRefl); 48 | reflcol *= tex.a; 49 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 50 | o.Alpha = reflcol.a * _ReflectColor.a; 51 | } 52 | ENDCG 53 | } 54 | 55 | FallBack "Reflective/Bumped Diffuse" 56 | } 57 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Reflect-BumpVertexLit.shader: -------------------------------------------------------------------------------- 1 | Shader "Reflective/Bumped VertexLit" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Spec Color", Color) = (1,1,1,1) 5 | _Shininess ("Shininess", Range (0.1, 1)) = 0.7 6 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 7 | _MainTex ("Base (RGB) RefStrength (A)", 2D) = "white" {} 8 | _Cube ("Reflection Cubemap", Cube) = "" { TexGen CubeReflect } 9 | _BumpMap ("Normalmap", 2D) = "bump" {} 10 | } 11 | 12 | Category { 13 | Tags { "RenderType"="Opaque" } 14 | LOD 250 15 | SubShader { 16 | UsePass "Reflective/Bumped Unlit/BASE" 17 | Pass { 18 | Tags { "LightMode" = "Vertex" } 19 | Blend One One ZWrite Off Fog { Color (0,0,0,0) } 20 | Material { 21 | Diffuse [_Color] 22 | Ambient [_Color] 23 | Shininess [_Shininess] 24 | Specular [_SpecColor] 25 | Emission [_Emission] 26 | } 27 | Lighting On 28 | SeparateSpecular On 29 | SetTexture [_MainTex] { 30 | constantColor [_Color] 31 | Combine texture * primary DOUBLE, texture * primary 32 | } 33 | } 34 | } 35 | } 36 | 37 | FallBack "Reflective/VertexLit" 38 | } 39 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Reflect-Bumped.shader: -------------------------------------------------------------------------------- 1 | Shader "Reflective/Bumped Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 5 | _MainTex ("Base (RGB) RefStrength (A)", 2D) = "white" {} 6 | _Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect } 7 | _BumpMap ("Normalmap", 2D) = "bump" {} 8 | } 9 | 10 | SubShader { 11 | Tags { "RenderType"="Opaque" } 12 | LOD 300 13 | 14 | CGPROGRAM 15 | #pragma surface surf Lambert 16 | #pragma exclude_renderers d3d11_9x 17 | 18 | sampler2D _MainTex; 19 | sampler2D _BumpMap; 20 | samplerCUBE _Cube; 21 | 22 | fixed4 _Color; 23 | fixed4 _ReflectColor; 24 | 25 | struct Input { 26 | float2 uv_MainTex; 27 | float2 uv_BumpMap; 28 | float3 worldRefl; 29 | INTERNAL_DATA 30 | }; 31 | 32 | void surf (Input IN, inout SurfaceOutput o) { 33 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 34 | fixed4 c = tex * _Color; 35 | o.Albedo = c.rgb; 36 | 37 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 38 | 39 | float3 worldRefl = WorldReflectionVector (IN, o.Normal); 40 | fixed4 reflcol = texCUBE (_Cube, worldRefl); 41 | reflcol *= tex.a; 42 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 43 | o.Alpha = reflcol.a * _ReflectColor.a; 44 | } 45 | ENDCG 46 | } 47 | 48 | FallBack "Reflective/VertexLit" 49 | } 50 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Reflect-Diffuse.shader: -------------------------------------------------------------------------------- 1 | Shader "Reflective/Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 5 | _MainTex ("Base (RGB) RefStrength (A)", 2D) = "white" {} 6 | _Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect } 7 | } 8 | SubShader { 9 | LOD 200 10 | Tags { "RenderType"="Opaque" } 11 | 12 | CGPROGRAM 13 | #pragma surface surf Lambert 14 | 15 | sampler2D _MainTex; 16 | samplerCUBE _Cube; 17 | 18 | fixed4 _Color; 19 | fixed4 _ReflectColor; 20 | 21 | struct Input { 22 | float2 uv_MainTex; 23 | float3 worldRefl; 24 | }; 25 | 26 | void surf (Input IN, inout SurfaceOutput o) { 27 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 28 | fixed4 c = tex * _Color; 29 | o.Albedo = c.rgb; 30 | 31 | fixed4 reflcol = texCUBE (_Cube, IN.worldRefl); 32 | reflcol *= tex.a; 33 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 34 | o.Alpha = reflcol.a * _ReflectColor.a; 35 | } 36 | ENDCG 37 | } 38 | 39 | FallBack "Reflective/VertexLit" 40 | } 41 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Reflect-Glossy.shader: -------------------------------------------------------------------------------- 1 | Shader "Reflective/Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5, 0.5, 0.5, 1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 7 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" {} 8 | _Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect } 9 | } 10 | SubShader { 11 | LOD 300 12 | Tags { "RenderType"="Opaque" } 13 | 14 | CGPROGRAM 15 | #pragma surface surf BlinnPhong 16 | 17 | sampler2D _MainTex; 18 | samplerCUBE _Cube; 19 | 20 | fixed4 _Color; 21 | fixed4 _ReflectColor; 22 | half _Shininess; 23 | 24 | struct Input { 25 | float2 uv_MainTex; 26 | float3 worldRefl; 27 | }; 28 | 29 | void surf (Input IN, inout SurfaceOutput o) { 30 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 31 | fixed4 c = tex * _Color; 32 | o.Albedo = c.rgb; 33 | o.Gloss = tex.a; 34 | o.Specular = _Shininess; 35 | 36 | fixed4 reflcol = texCUBE (_Cube, IN.worldRefl); 37 | reflcol *= tex.a; 38 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 39 | o.Alpha = reflcol.a * _ReflectColor.a; 40 | } 41 | ENDCG 42 | } 43 | 44 | FallBack "Reflective/VertexLit" 45 | } 46 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Reflect-Parallax.shader: -------------------------------------------------------------------------------- 1 | Shader "Reflective/Parallax Diffuse" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 5 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 6 | _MainTex ("Base (RGB) RefStrength (A)", 2D) = "white" {} 7 | _Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect } 8 | _BumpMap ("Normalmap", 2D) = "bump" {} 9 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 10 | } 11 | SubShader { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 500 14 | 15 | CGPROGRAM 16 | #pragma surface surf Lambert 17 | #pragma target 3.0 18 | //input limit (8) exceeded, shader uses 9 19 | #pragma exclude_renderers d3d11_9x 20 | 21 | sampler2D _MainTex; 22 | sampler2D _BumpMap; 23 | samplerCUBE _Cube; 24 | sampler2D _ParallaxMap; 25 | 26 | fixed4 _Color; 27 | fixed4 _ReflectColor; 28 | float _Parallax; 29 | 30 | struct Input { 31 | float2 uv_MainTex; 32 | float2 uv_BumpMap; 33 | float3 worldRefl; 34 | float3 viewDir; 35 | INTERNAL_DATA 36 | }; 37 | 38 | void surf (Input IN, inout SurfaceOutput o) { 39 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 40 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 41 | IN.uv_MainTex += offset; 42 | IN.uv_BumpMap += offset; 43 | 44 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 45 | fixed4 c = tex * _Color; 46 | o.Albedo = c.rgb; 47 | 48 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 49 | 50 | float3 worldRefl = WorldReflectionVector (IN, o.Normal); 51 | fixed4 reflcol = texCUBE (_Cube, worldRefl); 52 | reflcol *= tex.a; 53 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 54 | o.Alpha = reflcol.a * _ReflectColor.a; 55 | } 56 | ENDCG 57 | } 58 | 59 | FallBack "Reflective/Bumped Diffuse" 60 | } 61 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Reflect-ParallaxSpec.shader: -------------------------------------------------------------------------------- 1 | Shader "Reflective/Parallax Specular" { 2 | Properties { 3 | _Color ("Main Color", Color) = (1,1,1,1) 4 | _SpecColor ("Specular Color", Color) = (0.5,0.5,0.5,1) 5 | _Shininess ("Shininess", Range (0.01, 1)) = 0.078125 6 | _ReflectColor ("Reflection Color", Color) = (1,1,1,0.5) 7 | _Parallax ("Height", Range (0.005, 0.08)) = 0.02 8 | _MainTex ("Base (RGB) Gloss (A)", 2D) = "white" { } 9 | _Cube ("Reflection Cubemap", Cube) = "_Skybox" { TexGen CubeReflect } 10 | _BumpMap ("Normalmap", 2D) = "bump" { } 11 | _ParallaxMap ("Heightmap (A)", 2D) = "black" {} 12 | } 13 | SubShader { 14 | Tags { "RenderType"="Opaque" } 15 | LOD 600 16 | 17 | CGPROGRAM 18 | #pragma surface surf BlinnPhong 19 | #pragma target 3.0 20 | //input limit (8) exceeded, shader uses 9 21 | #pragma exclude_renderers d3d11_9x 22 | 23 | sampler2D _MainTex; 24 | sampler2D _BumpMap; 25 | samplerCUBE _Cube; 26 | sampler2D _ParallaxMap; 27 | 28 | fixed4 _Color; 29 | fixed4 _ReflectColor; 30 | half _Shininess; 31 | float _Parallax; 32 | 33 | struct Input { 34 | float2 uv_MainTex; 35 | float2 uv_BumpMap; 36 | float3 worldRefl; 37 | float3 viewDir; 38 | INTERNAL_DATA 39 | }; 40 | 41 | void surf (Input IN, inout SurfaceOutput o) { 42 | half h = tex2D (_ParallaxMap, IN.uv_BumpMap).w; 43 | float2 offset = ParallaxOffset (h, _Parallax, IN.viewDir); 44 | IN.uv_MainTex += offset; 45 | IN.uv_BumpMap += offset; 46 | 47 | fixed4 tex = tex2D(_MainTex, IN.uv_MainTex); 48 | o.Albedo = tex.rgb * _Color.rgb; 49 | o.Gloss = tex.a; 50 | o.Specular = _Shininess; 51 | 52 | o.Normal = UnpackNormal(tex2D(_BumpMap, IN.uv_BumpMap)); 53 | 54 | float3 worldRefl = WorldReflectionVector (IN, o.Normal); 55 | fixed4 reflcol = texCUBE (_Cube, worldRefl); 56 | reflcol *= tex.a; 57 | o.Emission = reflcol.rgb * _ReflectColor.rgb; 58 | o.Alpha = reflcol.a * _ReflectColor.a; 59 | } 60 | ENDCG 61 | } 62 | 63 | FallBack "Reflective/Bumped Specular" 64 | } 65 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Skybox.shader: -------------------------------------------------------------------------------- 1 | Shader "RenderFX/Skybox" { 2 | Properties { 3 | _Tint ("Tint Color", Color) = (.5, .5, .5, .5) 4 | _FrontTex ("Front (+Z)", 2D) = "white" {} 5 | _BackTex ("Back (-Z)", 2D) = "white" {} 6 | _LeftTex ("Left (+X)", 2D) = "white" {} 7 | _RightTex ("Right (-X)", 2D) = "white" {} 8 | _UpTex ("Up (+Y)", 2D) = "white" {} 9 | _DownTex ("Down (-Y)", 2D) = "white" {} 10 | } 11 | 12 | SubShader { 13 | Tags { "Queue"="Background" "RenderType"="Background" } 14 | Cull Off ZWrite Off Fog { Mode Off } 15 | 16 | CGINCLUDE 17 | #include "UnityCG.cginc" 18 | 19 | fixed4 _Tint; 20 | 21 | struct appdata_t { 22 | float4 vertex : POSITION; 23 | float2 texcoord : TEXCOORD0; 24 | }; 25 | struct v2f { 26 | float4 vertex : SV_POSITION; 27 | float2 texcoord : TEXCOORD0; 28 | }; 29 | v2f vert (appdata_t v) 30 | { 31 | v2f o; 32 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 33 | o.texcoord = v.texcoord; 34 | return o; 35 | } 36 | fixed4 skybox_frag (v2f i, sampler2D smp) 37 | { 38 | fixed4 tex = tex2D (smp, i.texcoord); 39 | fixed4 col; 40 | col.rgb = tex.rgb + _Tint.rgb - unity_ColorSpaceGrey; 41 | col.a = tex.a * _Tint.a; 42 | return col; 43 | } 44 | ENDCG 45 | 46 | Pass { 47 | CGPROGRAM 48 | #pragma vertex vert 49 | #pragma fragment frag 50 | sampler2D _FrontTex; 51 | fixed4 frag (v2f i) : SV_Target { return skybox_frag(i,_FrontTex); } 52 | ENDCG 53 | } 54 | Pass{ 55 | CGPROGRAM 56 | #pragma vertex vert 57 | #pragma fragment frag 58 | sampler2D _BackTex; 59 | fixed4 frag (v2f i) : SV_Target { return skybox_frag(i,_BackTex); } 60 | ENDCG 61 | } 62 | Pass{ 63 | CGPROGRAM 64 | #pragma vertex vert 65 | #pragma fragment frag 66 | sampler2D _LeftTex; 67 | fixed4 frag (v2f i) : SV_Target { return skybox_frag(i,_LeftTex); } 68 | ENDCG 69 | } 70 | Pass{ 71 | CGPROGRAM 72 | #pragma vertex vert 73 | #pragma fragment frag 74 | sampler2D _RightTex; 75 | fixed4 frag (v2f i) : SV_Target { return skybox_frag(i,_RightTex); } 76 | ENDCG 77 | } 78 | Pass{ 79 | CGPROGRAM 80 | #pragma vertex vert 81 | #pragma fragment frag 82 | sampler2D _UpTex; 83 | fixed4 frag (v2f i) : SV_Target { return skybox_frag(i,_UpTex); } 84 | ENDCG 85 | } 86 | Pass{ 87 | CGPROGRAM 88 | #pragma vertex vert 89 | #pragma fragment frag 90 | sampler2D _DownTex; 91 | fixed4 frag (v2f i) : SV_Target { return skybox_frag(i,_DownTex); } 92 | ENDCG 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Sprites-Diffuse.shader: -------------------------------------------------------------------------------- 1 | Shader "Sprites/Diffuse" 2 | { 3 | Properties 4 | { 5 | [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} 6 | _Color ("Tint", Color) = (1,1,1,1) 7 | [MaterialToggle] PixelSnap ("Pixel snap", Float) = 0 8 | } 9 | 10 | SubShader 11 | { 12 | Tags 13 | { 14 | "Queue"="Transparent" 15 | "IgnoreProjector"="True" 16 | "RenderType"="Transparent" 17 | "PreviewType"="Plane" 18 | "CanUseSpriteAtlas"="True" 19 | } 20 | 21 | Cull Off 22 | Lighting Off 23 | ZWrite Off 24 | Fog { Mode Off } 25 | Blend One OneMinusSrcAlpha 26 | 27 | CGPROGRAM 28 | #pragma surface surf Lambert vertex:vert 29 | #pragma multi_compile DUMMY PIXELSNAP_ON 30 | 31 | sampler2D _MainTex; 32 | fixed4 _Color; 33 | 34 | struct Input 35 | { 36 | float2 uv_MainTex; 37 | fixed4 color; 38 | }; 39 | 40 | void vert (inout appdata_full v, out Input o) 41 | { 42 | #if defined(PIXELSNAP_ON) && !defined(SHADER_API_FLASH) 43 | v.vertex = UnityPixelSnap (v.vertex); 44 | #endif 45 | v.normal = float3(0,0,-1); 46 | 47 | UNITY_INITIALIZE_OUTPUT(Input, o); 48 | o.color = v.color * _Color; 49 | } 50 | 51 | void surf (Input IN, inout SurfaceOutput o) 52 | { 53 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * IN.color; 54 | o.Albedo = c.rgb * c.a; 55 | o.Alpha = c.a; 56 | } 57 | ENDCG 58 | } 59 | 60 | Fallback "Transparent/VertexLit" 61 | } 62 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Sprites/Sprites-AlphaBlended.shader: -------------------------------------------------------------------------------- 1 | Shader "Sprites/Alpha Blended" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Sprite Texture", 2D) = "white" {} 6 | _Color ("Main Color", Color) = (1,1,1,1) 7 | } 8 | 9 | SubShader 10 | { 11 | Tags 12 | { 13 | "Queue"="Transparent" 14 | "IgnoreProjector"="True" 15 | "RenderType"="Transparent" 16 | } 17 | 18 | Cull Off 19 | Lighting Off 20 | ZWrite Off 21 | ZTest Always 22 | Fog { Mode Off } 23 | Blend SrcAlpha OneMinusSrcAlpha 24 | 25 | Pass 26 | { 27 | CGPROGRAM 28 | #pragma vertex vert 29 | #pragma fragment frag 30 | #pragma fragmentoption ARB_precision_hint_fastest 31 | #include "UnityCG.cginc" 32 | 33 | sampler2D _MainTex; 34 | float4 _MainTex_ST; 35 | fixed4 _Color; 36 | 37 | struct appdata_t 38 | { 39 | float4 vertex : POSITION; 40 | float2 texcoord : TEXCOORD0; 41 | }; 42 | 43 | struct v2f 44 | { 45 | float4 vertex : POSITION; 46 | float2 texcoord : TEXCOORD0; 47 | }; 48 | 49 | v2f vert(appdata_t IN) 50 | { 51 | v2f OUT; 52 | OUT.vertex = mul(UNITY_MATRIX_MVP, IN.vertex); 53 | OUT.texcoord = TRANSFORM_TEX(IN.texcoord, _MainTex); 54 | return OUT; 55 | } 56 | 57 | fixed4 frag(v2f IN) : COLOR 58 | { 59 | return tex2D( _MainTex, IN.texcoord) * _Color; 60 | } 61 | ENDCG 62 | } 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Sprites/Sprites-PixelSnap-AlphaBlended.shader: -------------------------------------------------------------------------------- 1 | Shader "Sprites/Pixel Snap/Alpha Blended" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Sprite Texture", 2D) = "white" {} 6 | _Color ("Main Color", Color) = (1,1,1,1) 7 | } 8 | 9 | SubShader 10 | { 11 | Tags 12 | { 13 | "Queue"="Transparent" 14 | "IgnoreProjector"="True" 15 | "RenderType"="Transparent" 16 | } 17 | 18 | Cull Off 19 | Lighting Off 20 | ZWrite Off 21 | ZTest Always 22 | Fog { Mode Off } 23 | Blend SrcAlpha OneMinusSrcAlpha 24 | 25 | Pass 26 | { 27 | CGPROGRAM 28 | #pragma vertex vert 29 | #pragma fragment frag 30 | #pragma fragmentoption ARB_precision_hint_fastest 31 | #include "UnityCG.cginc" 32 | 33 | sampler2D _MainTex; 34 | float4 _MainTex_ST; 35 | fixed4 _Color; 36 | 37 | struct appdata_t 38 | { 39 | float4 vertex : POSITION; 40 | float2 texcoord : TEXCOORD0; 41 | }; 42 | 43 | struct v2f 44 | { 45 | float4 vertex : POSITION; 46 | float2 texcoord : TEXCOORD0; 47 | }; 48 | 49 | v2f vert(appdata_t IN) 50 | { 51 | v2f OUT; 52 | OUT.vertex = mul(UNITY_MATRIX_MVP, IN.vertex); 53 | OUT.texcoord = TRANSFORM_TEX(IN.texcoord, _MainTex); 54 | 55 | // Snapping params 56 | float hpcX = _ScreenParams.x * 0.5; 57 | float hpcY = _ScreenParams.y * 0.5; 58 | #ifdef UNITY_HALF_TEXEL_OFFSET 59 | float hpcOX = -0.5; 60 | float hpcOY = 0.5; 61 | #else 62 | float hpcOX = 0; 63 | float hpcOY = 0; 64 | #endif 65 | // Snap 66 | float pos = floor((OUT.vertex.x / OUT.vertex.w) * hpcX + 0.5f) + hpcOX; 67 | OUT.vertex.x = pos / hpcX * OUT.vertex.w; 68 | 69 | pos = floor((OUT.vertex.y / OUT.vertex.w) * hpcY + 0.5f) + hpcOY; 70 | OUT.vertex.y = pos / hpcY * OUT.vertex.w; 71 | 72 | return OUT; 73 | } 74 | 75 | fixed4 frag(v2f IN) : COLOR 76 | { 77 | return tex2D( _MainTex, IN.texcoord) * _Color; 78 | } 79 | ENDCG 80 | } 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/TerrainShaders/Details/VertexLit.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/TerrainEngine/Details/Vertexlit" { 2 | Properties { 3 | _MainTex ("Main Texture", 2D) = "white" { } 4 | } 5 | SubShader { 6 | Tags { "RenderType"="Opaque" } 7 | LOD 200 8 | 9 | CGPROGRAM 10 | #pragma surface surf Lambert 11 | 12 | sampler2D _MainTex; 13 | 14 | struct Input { 15 | float2 uv_MainTex; 16 | fixed4 color : COLOR; 17 | }; 18 | 19 | void surf (Input IN, inout SurfaceOutput o) { 20 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * IN.color; 21 | o.Albedo = c.rgb; 22 | o.Alpha = c.a; 23 | } 24 | 25 | ENDCG 26 | } 27 | SubShader { 28 | Tags { "RenderType"="Opaque" } 29 | Pass { 30 | Tags { "LightMode" = "Vertex" } 31 | ColorMaterial AmbientAndDiffuse 32 | Lighting On 33 | SetTexture [_MainTex] { 34 | combine texture * primary DOUBLE, texture * primary 35 | } 36 | } 37 | Pass { 38 | Tags { "LightMode" = "VertexLMRGBM" } 39 | ColorMaterial AmbientAndDiffuse 40 | BindChannels { 41 | Bind "Vertex", vertex 42 | Bind "texcoord1", texcoord0 // lightmap uses 2nd uv 43 | Bind "texcoord", texcoord1 // main uses 1st uv 44 | } 45 | SetTexture [unity_Lightmap] { 46 | matrix [unity_LightmapMatrix] 47 | combine texture * texture alpha DOUBLE 48 | } 49 | SetTexture [_MainTex] { combine texture * previous QUAD, texture } 50 | } 51 | } 52 | 53 | Fallback "VertexLit" 54 | } 55 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/TerrainShaders/Details/WavingGrass.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/TerrainEngine/Details/WavingDoublePass" { 2 | Properties { 3 | _WavingTint ("Fade Color", Color) = (.7,.6,.5, 0) 4 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 5 | _WaveAndDistance ("Wave and distance", Vector) = (12, 3.6, 1, 1) 6 | _Cutoff ("Cutoff", float) = 0.5 7 | } 8 | 9 | SubShader { 10 | Tags { 11 | "Queue" = "Geometry+200" 12 | "IgnoreProjector"="True" 13 | "RenderType"="Grass" 14 | } 15 | Cull Off 16 | LOD 200 17 | ColorMask RGB 18 | 19 | CGPROGRAM 20 | #pragma surface surf Lambert vertex:WavingGrassVert addshadow 21 | #pragma exclude_renderers flash 22 | #include "TerrainEngine.cginc" 23 | 24 | sampler2D _MainTex; 25 | fixed _Cutoff; 26 | 27 | struct Input { 28 | float2 uv_MainTex; 29 | fixed4 color : COLOR; 30 | }; 31 | 32 | void surf (Input IN, inout SurfaceOutput o) { 33 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * IN.color; 34 | o.Albedo = c.rgb; 35 | o.Alpha = c.a; 36 | clip (o.Alpha - _Cutoff); 37 | o.Alpha *= IN.color.a; 38 | } 39 | ENDCG 40 | } 41 | 42 | SubShader { 43 | Tags { 44 | "Queue" = "Geometry+200" 45 | "IgnoreProjector"="True" 46 | "RenderType"="Grass" 47 | } 48 | Cull Off 49 | LOD 200 50 | ColorMask RGB 51 | 52 | Pass { 53 | Tags { "LightMode" = "Vertex" } 54 | Material { 55 | Diffuse (1,1,1,1) 56 | Ambient (1,1,1,1) 57 | } 58 | Lighting On 59 | ColorMaterial AmbientAndDiffuse 60 | AlphaTest Greater [_Cutoff] 61 | SetTexture [_MainTex] { combine texture * primary DOUBLE, texture } 62 | } 63 | Pass { 64 | Tags { "LightMode" = "VertexLMRGBM" } 65 | AlphaTest Greater [_Cutoff] 66 | BindChannels { 67 | Bind "Vertex", vertex 68 | Bind "texcoord1", texcoord0 // lightmap uses 2nd uv 69 | Bind "texcoord", texcoord1 // main uses 1st uv 70 | } 71 | SetTexture [unity_Lightmap] { 72 | matrix [unity_LightmapMatrix] 73 | combine texture * texture alpha DOUBLE 74 | } 75 | SetTexture [_MainTex] { combine texture * previous QUAD, texture } 76 | } 77 | } 78 | 79 | Fallback Off 80 | } 81 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/TerrainShaders/Details/WavingGrassBillboard.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/TerrainEngine/Details/BillboardWavingDoublePass" { 2 | Properties { 3 | _WavingTint ("Fade Color", Color) = (.7,.6,.5, 0) 4 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 5 | _WaveAndDistance ("Wave and distance", Vector) = (12, 3.6, 1, 1) 6 | _Cutoff ("Cutoff", float) = 0.5 7 | } 8 | 9 | CGINCLUDE 10 | #include "UnityCG.cginc" 11 | #include "TerrainEngine.cginc" 12 | #pragma glsl_no_auto_normalization 13 | 14 | struct v2f { 15 | float4 pos : SV_POSITION; 16 | fixed4 color : COLOR; 17 | float4 uv : TEXCOORD0; 18 | }; 19 | v2f BillboardVert (appdata_full v) { 20 | v2f o; 21 | WavingGrassBillboardVert (v); 22 | o.color = v.color; 23 | 24 | o.color.rgb *= ShadeVertexLights (v.vertex, v.normal); 25 | 26 | o.pos = mul (UNITY_MATRIX_MVP, v.vertex); 27 | o.uv = v.texcoord; 28 | return o; 29 | } 30 | ENDCG 31 | 32 | SubShader { 33 | Tags { 34 | "Queue" = "Geometry+200" 35 | "IgnoreProjector"="True" 36 | "RenderType"="GrassBillboard" 37 | } 38 | Cull Off 39 | LOD 200 40 | ColorMask RGB 41 | 42 | CGPROGRAM 43 | #pragma surface surf Lambert vertex:WavingGrassBillboardVert addshadow 44 | #pragma exclude_renderers flash 45 | 46 | sampler2D _MainTex; 47 | fixed _Cutoff; 48 | 49 | struct Input { 50 | float2 uv_MainTex; 51 | fixed4 color : COLOR; 52 | }; 53 | 54 | void surf (Input IN, inout SurfaceOutput o) { 55 | fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * IN.color; 56 | o.Albedo = c.rgb; 57 | o.Alpha = c.a; 58 | clip (o.Alpha - _Cutoff); 59 | o.Alpha *= IN.color.a; 60 | } 61 | 62 | ENDCG 63 | } 64 | 65 | SubShader { 66 | Tags { 67 | "Queue" = "Geometry+200" 68 | "IgnoreProjector"="True" 69 | "RenderType"="GrassBillboard" 70 | } 71 | 72 | ColorMask RGB 73 | Cull Off 74 | Lighting On 75 | 76 | Pass { 77 | CGPROGRAM 78 | #pragma vertex BillboardVert 79 | #pragma exclude_renderers shaderonly 80 | ENDCG 81 | 82 | AlphaTest Greater [_Cutoff] 83 | 84 | SetTexture [_MainTex] { combine texture * primary DOUBLE, texture * primary } 85 | } 86 | } 87 | 88 | Fallback Off 89 | } 90 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/TerrainShaders/Splats/AddPass.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/TerrainEngine/Splatmap/Lightmap-AddPass" { 2 | Properties { 3 | _Control ("Control (RGBA)", 2D) = "black" {} 4 | _Splat3 ("Layer 3 (A)", 2D) = "white" {} 5 | _Splat2 ("Layer 2 (B)", 2D) = "white" {} 6 | _Splat1 ("Layer 1 (G)", 2D) = "white" {} 7 | _Splat0 ("Layer 0 (R)", 2D) = "white" {} 8 | } 9 | 10 | SubShader { 11 | Tags { 12 | "SplatCount" = "4" 13 | "Queue" = "Geometry-99" 14 | "IgnoreProjector"="True" 15 | "RenderType" = "Opaque" 16 | } 17 | 18 | CGPROGRAM 19 | #pragma surface surf Lambert decal:add 20 | struct Input { 21 | float2 uv_Control : TEXCOORD0; 22 | float2 uv_Splat0 : TEXCOORD1; 23 | float2 uv_Splat1 : TEXCOORD2; 24 | float2 uv_Splat2 : TEXCOORD3; 25 | float2 uv_Splat3 : TEXCOORD4; 26 | }; 27 | 28 | sampler2D _Control; 29 | sampler2D _Splat0,_Splat1,_Splat2,_Splat3; 30 | 31 | void surf (Input IN, inout SurfaceOutput o) { 32 | fixed4 splat_control = tex2D (_Control, IN.uv_Control); 33 | fixed3 col; 34 | col = splat_control.r * tex2D (_Splat0, IN.uv_Splat0).rgb; 35 | col += splat_control.g * tex2D (_Splat1, IN.uv_Splat1).rgb; 36 | col += splat_control.b * tex2D (_Splat2, IN.uv_Splat2).rgb; 37 | col += splat_control.a * tex2D (_Splat3, IN.uv_Splat3).rgb; 38 | o.Albedo = col; 39 | o.Alpha = 0.0; 40 | } 41 | ENDCG 42 | } 43 | 44 | Fallback off 45 | } 46 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/TerrainShaders/Splats/FirstPass.shader: -------------------------------------------------------------------------------- 1 | Shader "Nature/Terrain/Diffuse" { 2 | Properties { 3 | [HideInInspector] _Control ("Control (RGBA)", 2D) = "red" {} 4 | [HideInInspector] _Splat3 ("Layer 3 (A)", 2D) = "white" {} 5 | [HideInInspector] _Splat2 ("Layer 2 (B)", 2D) = "white" {} 6 | [HideInInspector] _Splat1 ("Layer 1 (G)", 2D) = "white" {} 7 | [HideInInspector] _Splat0 ("Layer 0 (R)", 2D) = "white" {} 8 | // used in fallback on old cards & base map 9 | [HideInInspector] _MainTex ("BaseMap (RGB)", 2D) = "white" {} 10 | [HideInInspector] _Color ("Main Color", Color) = (1,1,1,1) 11 | } 12 | 13 | SubShader { 14 | Tags { 15 | "SplatCount" = "4" 16 | "Queue" = "Geometry-100" 17 | "RenderType" = "Opaque" 18 | } 19 | CGPROGRAM 20 | #pragma surface surf Lambert 21 | struct Input { 22 | float2 uv_Control : TEXCOORD0; 23 | float2 uv_Splat0 : TEXCOORD1; 24 | float2 uv_Splat1 : TEXCOORD2; 25 | float2 uv_Splat2 : TEXCOORD3; 26 | float2 uv_Splat3 : TEXCOORD4; 27 | }; 28 | 29 | sampler2D _Control; 30 | sampler2D _Splat0,_Splat1,_Splat2,_Splat3; 31 | 32 | void surf (Input IN, inout SurfaceOutput o) { 33 | fixed4 splat_control = tex2D (_Control, IN.uv_Control); 34 | fixed3 col; 35 | col = splat_control.r * tex2D (_Splat0, IN.uv_Splat0).rgb; 36 | col += splat_control.g * tex2D (_Splat1, IN.uv_Splat1).rgb; 37 | col += splat_control.b * tex2D (_Splat2, IN.uv_Splat2).rgb; 38 | col += splat_control.a * tex2D (_Splat3, IN.uv_Splat3).rgb; 39 | o.Albedo = col; 40 | o.Alpha = 0.0; 41 | } 42 | ENDCG 43 | } 44 | 45 | Dependency "AddPassShader" = "Hidden/TerrainEngine/Splatmap/Lightmap-AddPass" 46 | Dependency "BaseMapShader" = "Diffuse" 47 | Dependency "Details0" = "Hidden/TerrainEngine/Details/Vertexlit" 48 | Dependency "Details1" = "Hidden/TerrainEngine/Details/WavingDoublePass" 49 | Dependency "Details2" = "Hidden/TerrainEngine/Details/BillboardWavingDoublePass" 50 | Dependency "Tree0" = "Hidden/TerrainEngine/BillboardTree" 51 | 52 | // Fallback to Diffuse 53 | Fallback "Diffuse" 54 | } 55 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/TerrainShaders/Trees/BillboardTree.shader: -------------------------------------------------------------------------------- 1 | Shader "Hidden/TerrainEngine/BillboardTree" { 2 | Properties { 3 | _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} 4 | } 5 | 6 | SubShader { 7 | Tags { "Queue" = "Transparent-100" "IgnoreProjector"="True" "RenderType"="TreeBillboard" } 8 | 9 | Pass { 10 | ColorMask rgb 11 | Blend SrcAlpha OneMinusSrcAlpha 12 | ZWrite Off Cull Off 13 | 14 | CGPROGRAM 15 | #pragma vertex vert 16 | #include "UnityCG.cginc" 17 | #include "TerrainEngine.cginc" 18 | #pragma fragment frag 19 | 20 | struct v2f { 21 | float4 pos : SV_POSITION; 22 | fixed4 color : COLOR0; 23 | float2 uv : TEXCOORD0; 24 | }; 25 | 26 | v2f vert (appdata_tree_billboard v) { 27 | v2f o; 28 | TerrainBillboardTree(v.vertex, v.texcoord1.xy, v.texcoord.y); 29 | o.pos = mul (UNITY_MATRIX_MVP, v.vertex); 30 | o.uv.x = v.texcoord.x; 31 | o.uv.y = v.texcoord.y > 0; 32 | o.color = v.color; 33 | return o; 34 | } 35 | 36 | sampler2D _MainTex; 37 | fixed4 frag(v2f input) : SV_Target 38 | { 39 | fixed4 col = tex2D( _MainTex, input.uv); 40 | col.rgb *= input.color.rgb; 41 | clip(col.a); 42 | return col; 43 | } 44 | ENDCG 45 | } 46 | } 47 | 48 | Fallback Off 49 | } -------------------------------------------------------------------------------- /DefaultResourcesExtra/UI/UI-Default.shader: -------------------------------------------------------------------------------- 1 | Shader "UI/Default" 2 | { 3 | Properties 4 | { 5 | [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} 6 | _Color ("Tint", Color) = (1,1,1,1) 7 | 8 | _StencilComp ("Stencil Comparison", Float) = 8 9 | _Stencil ("Stencil ID", Float) = 0 10 | _StencilOp ("Stencil Operation", Float) = 0 11 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 12 | _StencilReadMask ("Stencil Read Mask", Float) = 255 13 | 14 | _ColorMask ("Color Mask", Float) = 15 15 | } 16 | 17 | SubShader 18 | { 19 | Tags 20 | { 21 | "Queue"="Transparent" 22 | "IgnoreProjector"="True" 23 | "RenderType"="Transparent" 24 | "PreviewType"="Plane" 25 | "CanUseSpriteAtlas"="True" 26 | } 27 | 28 | Stencil 29 | { 30 | Ref [_Stencil] 31 | Comp [_StencilComp] 32 | Pass [_StencilOp] 33 | ReadMask [_StencilReadMask] 34 | WriteMask [_StencilWriteMask] 35 | } 36 | 37 | Cull Off 38 | Lighting Off 39 | ZWrite Off 40 | ZTest [unity_GUIZTestMode] 41 | Fog { Mode Off } 42 | Blend SrcAlpha OneMinusSrcAlpha 43 | ColorMask [_ColorMask] 44 | 45 | Pass 46 | { 47 | CGPROGRAM 48 | #pragma vertex vert 49 | #pragma fragment frag 50 | #include "UnityCG.cginc" 51 | 52 | struct appdata_t 53 | { 54 | float4 vertex : POSITION; 55 | float4 color : COLOR; 56 | float2 texcoord : TEXCOORD0; 57 | }; 58 | 59 | struct v2f 60 | { 61 | float4 vertex : SV_POSITION; 62 | fixed4 color : COLOR; 63 | half2 texcoord : TEXCOORD0; 64 | }; 65 | 66 | fixed4 _Color; 67 | 68 | v2f vert(appdata_t IN) 69 | { 70 | v2f OUT; 71 | OUT.vertex = mul(UNITY_MATRIX_MVP, IN.vertex); 72 | OUT.texcoord = IN.texcoord; 73 | OUT.color = IN.color * _Color; 74 | return OUT; 75 | } 76 | 77 | sampler2D _MainTex; 78 | 79 | fixed4 frag(v2f IN) : SV_Target 80 | { 81 | half4 color = tex2D(_MainTex, IN.texcoord) * IN.color; 82 | clip (color.a - 0.01); 83 | return color; 84 | } 85 | ENDCG 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/UI/UI-DefaultFont.shader: -------------------------------------------------------------------------------- 1 | Shader "UI/Default Font" { 2 | Properties { 3 | _MainTex ("Font Texture", 2D) = "white" {} 4 | _Color ("Text Color", Color) = (1,1,1,1) 5 | 6 | _StencilComp ("Stencil Comparison", Float) = 8 7 | _Stencil ("Stencil ID", Float) = 0 8 | _StencilOp ("Stencil Operation", Float) = 0 9 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 10 | _StencilReadMask ("Stencil Read Mask", Float) = 255 11 | 12 | _ColorMask ("Color Mask", Float) = 15 13 | } 14 | 15 | SubShader { 16 | 17 | Tags 18 | { 19 | "Queue"="Transparent" 20 | "IgnoreProjector"="True" 21 | "RenderType"="Transparent" 22 | "PreviewType"="Plane" 23 | } 24 | 25 | Stencil 26 | { 27 | Ref [_Stencil] 28 | Comp [_StencilComp] 29 | Pass [_StencilOp] 30 | ReadMask [_StencilReadMask] 31 | WriteMask [_StencilWriteMask] 32 | } 33 | 34 | Lighting Off 35 | Cull Off 36 | ZTest [unity_GUIZTestMode] 37 | ZWrite Off 38 | Fog { Mode Off } 39 | Blend SrcAlpha OneMinusSrcAlpha 40 | ColorMask [_ColorMask] 41 | 42 | Pass 43 | { 44 | CGPROGRAM 45 | #pragma vertex vert 46 | #pragma fragment frag 47 | 48 | #include "UnityCG.cginc" 49 | 50 | struct appdata_t { 51 | float4 vertex : POSITION; 52 | fixed4 color : COLOR; 53 | float2 texcoord : TEXCOORD0; 54 | }; 55 | 56 | struct v2f { 57 | float4 vertex : SV_POSITION; 58 | fixed4 color : COLOR; 59 | float2 texcoord : TEXCOORD0; 60 | }; 61 | 62 | sampler2D _MainTex; 63 | uniform float4 _MainTex_ST; 64 | uniform fixed4 _Color; 65 | 66 | v2f vert (appdata_t v) 67 | { 68 | v2f o; 69 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 70 | o.color = v.color * _Color; 71 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 72 | return o; 73 | } 74 | 75 | fixed4 frag (v2f i) : SV_Target 76 | { 77 | fixed4 col = i.color; 78 | col.a *= tex2D(_MainTex, i.texcoord).a; 79 | clip (col.a - 0.01); 80 | return col; 81 | } 82 | ENDCG 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/UI/UI-Unlit-Text.shader: -------------------------------------------------------------------------------- 1 | Shader "UI/Unlit/Text" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Alpha (A)", 2D) = "white" {} 7 | 8 | _StencilComp ("Stencil Comparison", Float) = 8 9 | _Stencil ("Stencil ID", Float) = 0 10 | _StencilOp ("Stencil Operation", Float) = 0 11 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 12 | _StencilReadMask ("Stencil Read Mask", Float) = 255 13 | 14 | _ColorMask ("Color Mask", Float) = 15 15 | } 16 | 17 | SubShader 18 | { 19 | LOD 200 20 | 21 | Tags 22 | { 23 | "Queue" = "Transparent" 24 | "IgnoreProjector" = "True" 25 | "RenderType" = "Transparent" 26 | "PreviewType"="Plane" 27 | } 28 | 29 | Stencil 30 | { 31 | Ref [_Stencil] 32 | Comp [_StencilComp] 33 | Pass [_StencilOp] 34 | ReadMask [_StencilReadMask] 35 | WriteMask [_StencilWriteMask] 36 | } 37 | 38 | Cull Off 39 | Lighting Off 40 | ZWrite Off 41 | ZTest [unity_GUIZTestMode] 42 | Offset -1, -1 43 | Fog { Mode Off } 44 | Blend SrcAlpha OneMinusSrcAlpha 45 | ColorMask [_ColorMask] 46 | 47 | Pass 48 | { 49 | CGPROGRAM 50 | #pragma vertex vert 51 | #pragma fragment frag 52 | #include "UnityCG.cginc" 53 | 54 | struct appdata_t 55 | { 56 | float4 vertex : POSITION; 57 | half4 color : COLOR; 58 | float2 texcoord : TEXCOORD0; 59 | }; 60 | 61 | struct v2f 62 | { 63 | float4 vertex : POSITION; 64 | half4 color : COLOR; 65 | float2 texcoord : TEXCOORD0; 66 | }; 67 | 68 | sampler2D _MainTex; 69 | float4 _MainTex_ST; 70 | fixed4 _Color; 71 | 72 | v2f vert (appdata_t v) 73 | { 74 | v2f o; 75 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 76 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 77 | o.color = v.color; 78 | return o; 79 | } 80 | 81 | half4 frag (v2f i) : COLOR 82 | { 83 | half4 col = i.color; 84 | col.a *= tex2D(_MainTex, i.texcoord).a; 85 | col = col * _Color; 86 | clip (col.a - 0.01); 87 | return col; 88 | } 89 | ENDCG 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/UI/UI-Unlit-TextDetail.shader: -------------------------------------------------------------------------------- 1 | Shader "UI/Unlit/Text Detail" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Alpha (A)", 2D) = "white" {} 7 | _DetailTex ("Detail (RGB)", 2D) = "white" {} 8 | _Strength ("Detail Strength", Range(0.0, 1.0)) = 0.2 9 | 10 | _StencilComp ("Stencil Comparison", Float) = 8 11 | _Stencil ("Stencil ID", Float) = 0 12 | _StencilOp ("Stencil Operation", Float) = 0 13 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 14 | _StencilReadMask ("Stencil Read Mask", Float) = 255 15 | 16 | _ColorMask ("Color Mask", Float) = 15 17 | } 18 | 19 | SubShader 20 | { 21 | LOD 200 22 | 23 | Tags 24 | { 25 | "Queue" = "Transparent" 26 | "IgnoreProjector" = "True" 27 | "RenderType" = "Transparent" 28 | "PreviewType"="Plane" 29 | } 30 | 31 | Stencil 32 | { 33 | Ref [_Stencil] 34 | Comp [_StencilComp] 35 | Pass [_StencilOp] 36 | ReadMask [_StencilReadMask] 37 | WriteMask [_StencilWriteMask] 38 | } 39 | 40 | Cull Off 41 | Lighting Off 42 | ZWrite Off 43 | ZTest [unity_GUIZTestMode] 44 | Offset -1, -1 45 | Fog { Mode Off } 46 | Blend SrcAlpha OneMinusSrcAlpha 47 | ColorMask [_ColorMask] 48 | 49 | Pass 50 | { 51 | CGPROGRAM 52 | #pragma vertex vert 53 | #pragma fragment frag 54 | #include "UnityCG.cginc" 55 | 56 | struct appdata_t 57 | { 58 | float4 vertex : POSITION; 59 | float2 texcoord : TEXCOORD0; 60 | float2 texcoord2 : TEXCOORD1; 61 | fixed4 color : COLOR; 62 | }; 63 | 64 | struct v2f 65 | { 66 | float4 vertex : POSITION; 67 | float2 texcoord : TEXCOORD0; 68 | float2 texcoord2 : TEXCOORD1; 69 | fixed4 color : COLOR; 70 | }; 71 | 72 | sampler2D _MainTex; 73 | sampler2D _DetailTex; 74 | float4 _MainTex_ST; 75 | float4 _DetailTex_ST; 76 | float4 _DetailTex_TexelSize; 77 | fixed4 _Color; 78 | fixed _Strength; 79 | 80 | v2f vert (appdata_t v) 81 | { 82 | v2f o; 83 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 84 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 85 | o.texcoord2 = TRANSFORM_TEX(v.texcoord2 * _DetailTex_TexelSize.xy, _DetailTex); 86 | o.color = v.color; 87 | return o; 88 | } 89 | 90 | half4 frag (v2f i) : COLOR 91 | { 92 | half4 col = i.color; 93 | fixed4 detail = tex2D(_DetailTex, i.texcoord2); 94 | col.rgb = lerp(col.rgb, col.rgb * detail.rgb, detail.a * _Strength); 95 | col.a *= tex2D(_MainTex, i.texcoord).a; 96 | col = col * _Color; 97 | clip (col.a - 0.01); 98 | return col; 99 | } 100 | ENDCG 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/UI/UI-Unlit-Transparent.shader: -------------------------------------------------------------------------------- 1 | Shader "UI/Unlit/Transparent" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Base (RGB), Alpha (A)", 2D) = "white" {} 6 | 7 | _StencilComp ("Stencil Comparison", Float) = 8 8 | _Stencil ("Stencil ID", Float) = 0 9 | _StencilOp ("Stencil Operation", Float) = 0 10 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 11 | _StencilReadMask ("Stencil Read Mask", Float) = 255 12 | 13 | _ColorMask ("Color Mask", Float) = 15 14 | } 15 | 16 | SubShader 17 | { 18 | LOD 100 19 | 20 | Tags 21 | { 22 | "Queue" = "Transparent" 23 | "IgnoreProjector" = "True" 24 | "RenderType" = "Transparent" 25 | "PreviewType"="Plane" 26 | } 27 | 28 | Stencil 29 | { 30 | Ref [_Stencil] 31 | Comp [_StencilComp] 32 | Pass [_StencilOp] 33 | ReadMask [_StencilReadMask] 34 | WriteMask [_StencilWriteMask] 35 | } 36 | 37 | Cull Off 38 | Lighting Off 39 | ZWrite Off 40 | ZTest [unity_GUIZTestMode] 41 | Offset -1, -1 42 | Fog { Mode Off } 43 | Blend SrcAlpha OneMinusSrcAlpha 44 | ColorMask [_ColorMask] 45 | 46 | Pass 47 | { 48 | CGPROGRAM 49 | #pragma vertex vert 50 | #pragma fragment frag 51 | #include "UnityCG.cginc" 52 | 53 | struct appdata_t 54 | { 55 | float4 vertex : POSITION; 56 | float2 texcoord : TEXCOORD0; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | struct v2f 61 | { 62 | float4 vertex : SV_POSITION; 63 | half2 texcoord : TEXCOORD0; 64 | fixed4 color : COLOR; 65 | }; 66 | 67 | sampler2D _MainTex; 68 | float4 _MainTex_ST; 69 | 70 | v2f vert (appdata_t v) 71 | { 72 | v2f o; 73 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 74 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 75 | o.color = v.color; 76 | return o; 77 | } 78 | 79 | fixed4 frag (v2f i) : COLOR 80 | { 81 | fixed4 col = tex2D(_MainTex, i.texcoord) * i.color; 82 | clip (col.a - 0.01); 83 | return col; 84 | } 85 | ENDCG 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Unlit/Unlit-Alpha.shader: -------------------------------------------------------------------------------- 1 | // Unlit alpha-blended shader. 2 | // - no lighting 3 | // - no lightmap support 4 | // - no per-material color 5 | 6 | Shader "Unlit/Transparent" { 7 | Properties { 8 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 9 | } 10 | 11 | SubShader { 12 | Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"} 13 | LOD 100 14 | 15 | ZWrite Off 16 | Blend SrcAlpha OneMinusSrcAlpha 17 | 18 | Pass { 19 | CGPROGRAM 20 | #pragma vertex vert 21 | #pragma fragment frag 22 | 23 | #include "UnityCG.cginc" 24 | 25 | struct appdata_t { 26 | float4 vertex : POSITION; 27 | float2 texcoord : TEXCOORD0; 28 | }; 29 | 30 | struct v2f { 31 | float4 vertex : SV_POSITION; 32 | half2 texcoord : TEXCOORD0; 33 | }; 34 | 35 | sampler2D _MainTex; 36 | float4 _MainTex_ST; 37 | 38 | v2f vert (appdata_t v) 39 | { 40 | v2f o; 41 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 42 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 43 | return o; 44 | } 45 | 46 | fixed4 frag (v2f i) : SV_Target 47 | { 48 | fixed4 col = tex2D(_MainTex, i.texcoord); 49 | return col; 50 | } 51 | ENDCG 52 | } 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/Unlit/Unlit-AlphaTest.shader: -------------------------------------------------------------------------------- 1 | // Unlit alpha-cutout shader. 2 | // - no lighting 3 | // - no lightmap support 4 | // - no per-material color 5 | 6 | Shader "Unlit/Transparent Cutout" { 7 | Properties { 8 | _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {} 9 | _Cutoff ("Alpha cutoff", Range(0,1)) = 0.5 10 | } 11 | SubShader { 12 | Tags {"Queue"="AlphaTest" "IgnoreProjector"="True" "RenderType"="TransparentCutout"} 13 | LOD 100 14 | 15 | Lighting Off 16 | 17 | Pass { 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | 22 | #include "UnityCG.cginc" 23 | 24 | struct appdata_t { 25 | float4 vertex : POSITION; 26 | float2 texcoord : TEXCOORD0; 27 | }; 28 | 29 | struct v2f { 30 | float4 vertex : SV_POSITION; 31 | half2 texcoord : TEXCOORD0; 32 | }; 33 | 34 | sampler2D _MainTex; 35 | float4 _MainTex_ST; 36 | fixed _Cutoff; 37 | 38 | v2f vert (appdata_t v) 39 | { 40 | v2f o; 41 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 42 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 43 | return o; 44 | } 45 | 46 | fixed4 frag (v2f i) : SV_Target 47 | { 48 | fixed4 col = tex2D(_MainTex, i.texcoord); 49 | clip(col.a - _Cutoff); 50 | return col; 51 | } 52 | ENDCG 53 | } 54 | } 55 | 56 | } -------------------------------------------------------------------------------- /DefaultResourcesExtra/Unlit/Unlit-Normal.shader: -------------------------------------------------------------------------------- 1 | // Unlit shader. Simplest possible textured shader. 2 | // - no lighting 3 | // - no lightmap support 4 | // - no per-material color 5 | 6 | Shader "Unlit/Texture" { 7 | Properties { 8 | _MainTex ("Base (RGB)", 2D) = "white" {} 9 | } 10 | 11 | SubShader { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 100 14 | 15 | Pass { 16 | CGPROGRAM 17 | #pragma vertex vert 18 | #pragma fragment frag 19 | 20 | #include "UnityCG.cginc" 21 | 22 | struct appdata_t { 23 | float4 vertex : POSITION; 24 | float2 texcoord : TEXCOORD0; 25 | }; 26 | 27 | struct v2f { 28 | float4 vertex : SV_POSITION; 29 | half2 texcoord : TEXCOORD0; 30 | }; 31 | 32 | sampler2D _MainTex; 33 | float4 _MainTex_ST; 34 | 35 | v2f vert (appdata_t v) 36 | { 37 | v2f o; 38 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 39 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 40 | return o; 41 | } 42 | 43 | fixed4 frag (v2f i) : SV_Target 44 | { 45 | fixed4 col = tex2D(_MainTex, i.texcoord); 46 | return col; 47 | } 48 | ENDCG 49 | } 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/skybox cubed.shader: -------------------------------------------------------------------------------- 1 | Shader "RenderFX/Skybox Cubed" { 2 | Properties { 3 | _Tint ("Tint Color", Color) = (.5, .5, .5, .5) 4 | _Tex ("Cubemap", Cube) = "white" {} 5 | } 6 | 7 | SubShader { 8 | Tags { "Queue"="Background" "RenderType"="Background" } 9 | Cull Off ZWrite Off Fog { Mode Off } 10 | 11 | Pass { 12 | 13 | CGPROGRAM 14 | #pragma vertex vert 15 | #pragma fragment frag 16 | 17 | #include "UnityCG.cginc" 18 | 19 | samplerCUBE _Tex; 20 | fixed4 _Tint; 21 | 22 | struct appdata_t { 23 | float4 vertex : POSITION; 24 | float3 texcoord : TEXCOORD0; 25 | }; 26 | 27 | struct v2f { 28 | float4 vertex : SV_POSITION; 29 | float3 texcoord : TEXCOORD0; 30 | }; 31 | 32 | v2f vert (appdata_t v) 33 | { 34 | v2f o; 35 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 36 | o.texcoord = v.texcoord; 37 | return o; 38 | } 39 | 40 | fixed4 frag (v2f i) : SV_Target 41 | { 42 | fixed4 tex = texCUBE (_Tex, i.texcoord); 43 | fixed4 col; 44 | col.rgb = tex.rgb + _Tint.rgb - unity_ColorSpaceGrey; 45 | col.a = tex.a * _Tint.a; 46 | return col; 47 | } 48 | ENDCG 49 | } 50 | } 51 | 52 | 53 | Fallback Off 54 | 55 | } 56 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/uGUI/GUI-Default.shader: -------------------------------------------------------------------------------- 1 | Shader "uGUI/Default" 2 | { 3 | Properties 4 | { 5 | [PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {} 6 | _Color ("Tint", Color) = (1,1,1,1) 7 | 8 | _StencilComp ("Stencil Comparison", Float) = 8 9 | _Stencil ("Stencil ID", Float) = 0 10 | _StencilOp ("Stencil Operation", Float) = 0 11 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 12 | _StencilReadMask ("Stencil Read Mask", Float) = 255 13 | 14 | _ColorMask ("Color Mask", Float) = 15 15 | } 16 | 17 | SubShader 18 | { 19 | Tags 20 | { 21 | "Queue"="Transparent" 22 | "IgnoreProjector"="True" 23 | "RenderType"="Transparent" 24 | "PreviewType"="Plane" 25 | "CanUseSpriteAtlas"="True" 26 | } 27 | 28 | Stencil 29 | { 30 | Ref [_Stencil] 31 | Comp [_StencilComp] 32 | Pass [_StencilOp] 33 | ReadMask [_StencilReadMask] 34 | WriteMask [_StencilWriteMask] 35 | } 36 | 37 | Cull Off 38 | Lighting Off 39 | ZWrite Off 40 | ZTest [unity_GUIZTestMode] 41 | Fog { Mode Off } 42 | Blend SrcAlpha OneMinusSrcAlpha 43 | ColorMask [_ColorMask] 44 | 45 | Pass 46 | { 47 | CGPROGRAM 48 | #pragma vertex vert 49 | #pragma fragment frag 50 | #include "UnityCG.cginc" 51 | 52 | struct appdata_t 53 | { 54 | float4 vertex : POSITION; 55 | float4 color : COLOR; 56 | float2 texcoord : TEXCOORD0; 57 | }; 58 | 59 | struct v2f 60 | { 61 | float4 vertex : SV_POSITION; 62 | fixed4 color : COLOR; 63 | half2 texcoord : TEXCOORD0; 64 | }; 65 | 66 | fixed4 _Color; 67 | 68 | v2f vert(appdata_t IN) 69 | { 70 | v2f OUT; 71 | OUT.vertex = mul(UNITY_MATRIX_MVP, IN.vertex); 72 | OUT.texcoord = IN.texcoord; 73 | OUT.color = IN.color * _Color; 74 | return OUT; 75 | } 76 | 77 | sampler2D _MainTex; 78 | 79 | fixed4 frag(v2f IN) : SV_Target 80 | { 81 | half4 color = tex2D(_MainTex, IN.texcoord) * IN.color; 82 | clip (color.a - 0.01); 83 | return color; 84 | } 85 | ENDCG 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/uGUI/GUI-DefaultFont.shader: -------------------------------------------------------------------------------- 1 | Shader "uGUI/Default Font" { 2 | Properties { 3 | _MainTex ("Font Texture", 2D) = "white" {} 4 | _Color ("Text Color", Color) = (1,1,1,1) 5 | 6 | _StencilComp ("Stencil Comparison", Float) = 8 7 | _Stencil ("Stencil ID", Float) = 0 8 | _StencilOp ("Stencil Operation", Float) = 0 9 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 10 | _StencilReadMask ("Stencil Read Mask", Float) = 255 11 | 12 | _ColorMask ("Color Mask", Float) = 15 13 | } 14 | 15 | SubShader { 16 | 17 | Tags 18 | { 19 | "Queue"="Transparent" 20 | "IgnoreProjector"="True" 21 | "RenderType"="Transparent" 22 | "PreviewType"="Plane" 23 | } 24 | 25 | Stencil 26 | { 27 | Ref [_Stencil] 28 | Comp [_StencilComp] 29 | Pass [_StencilOp] 30 | ReadMask [_StencilReadMask] 31 | WriteMask [_StencilWriteMask] 32 | } 33 | 34 | Lighting Off 35 | Cull Off 36 | ZTest [unity_GUIZTestMode] 37 | ZWrite Off 38 | Fog { Mode Off } 39 | Blend SrcAlpha OneMinusSrcAlpha 40 | ColorMask [_ColorMask] 41 | 42 | Pass 43 | { 44 | CGPROGRAM 45 | #pragma vertex vert 46 | #pragma fragment frag 47 | 48 | #include "UnityCG.cginc" 49 | 50 | struct appdata_t { 51 | float4 vertex : POSITION; 52 | fixed4 color : COLOR; 53 | float2 texcoord : TEXCOORD0; 54 | }; 55 | 56 | struct v2f { 57 | float4 vertex : SV_POSITION; 58 | fixed4 color : COLOR; 59 | float2 texcoord : TEXCOORD0; 60 | }; 61 | 62 | sampler2D _MainTex; 63 | uniform float4 _MainTex_ST; 64 | uniform fixed4 _Color; 65 | 66 | v2f vert (appdata_t v) 67 | { 68 | v2f o; 69 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 70 | o.color = v.color * _Color; 71 | o.texcoord = TRANSFORM_TEX(v.texcoord,_MainTex); 72 | return o; 73 | } 74 | 75 | fixed4 frag (v2f i) : SV_Target 76 | { 77 | fixed4 col = i.color; 78 | col.a *= tex2D(_MainTex, i.texcoord).a; 79 | clip (col.a - 0.01); 80 | return col; 81 | } 82 | ENDCG 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/uGUI/GUI-Unlit-Text.shader: -------------------------------------------------------------------------------- 1 | Shader "uGUI/Unlit/Text" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Alpha (A)", 2D) = "white" {} 7 | 8 | _StencilComp ("Stencil Comparison", Float) = 8 9 | _Stencil ("Stencil ID", Float) = 0 10 | _StencilOp ("Stencil Operation", Float) = 0 11 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 12 | _StencilReadMask ("Stencil Read Mask", Float) = 255 13 | 14 | _ColorMask ("Color Mask", Float) = 15 15 | } 16 | 17 | SubShader 18 | { 19 | LOD 200 20 | 21 | Tags 22 | { 23 | "Queue" = "Transparent" 24 | "IgnoreProjector" = "True" 25 | "RenderType" = "Transparent" 26 | "PreviewType"="Plane" 27 | } 28 | 29 | Stencil 30 | { 31 | Ref [_Stencil] 32 | Comp [_StencilComp] 33 | Pass [_StencilOp] 34 | ReadMask [_StencilReadMask] 35 | WriteMask [_StencilWriteMask] 36 | } 37 | 38 | Cull Off 39 | Lighting Off 40 | ZWrite Off 41 | ZTest [unity_GUIZTestMode] 42 | Offset -1, -1 43 | Fog { Mode Off } 44 | Blend SrcAlpha OneMinusSrcAlpha 45 | ColorMask [_ColorMask] 46 | 47 | Pass 48 | { 49 | CGPROGRAM 50 | #pragma vertex vert 51 | #pragma fragment frag 52 | #include "UnityCG.cginc" 53 | 54 | struct appdata_t 55 | { 56 | float4 vertex : POSITION; 57 | half4 color : COLOR; 58 | float2 texcoord : TEXCOORD0; 59 | }; 60 | 61 | struct v2f 62 | { 63 | float4 vertex : POSITION; 64 | half4 color : COLOR; 65 | float2 texcoord : TEXCOORD0; 66 | }; 67 | 68 | sampler2D _MainTex; 69 | float4 _MainTex_ST; 70 | fixed4 _Color; 71 | 72 | v2f vert (appdata_t v) 73 | { 74 | v2f o; 75 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 76 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 77 | o.color = v.color; 78 | return o; 79 | } 80 | 81 | half4 frag (v2f i) : COLOR 82 | { 83 | half4 col = i.color; 84 | col.a *= tex2D(_MainTex, i.texcoord).a; 85 | col = col * _Color; 86 | clip (col.a - 0.01); 87 | return col; 88 | } 89 | ENDCG 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/uGUI/GUI-Unlit-TextDetail.shader: -------------------------------------------------------------------------------- 1 | Shader "uGUI/Unlit/Text Detail" 2 | { 3 | Properties 4 | { 5 | _Color ("Main Color", Color) = (1,1,1,1) 6 | _MainTex ("Alpha (A)", 2D) = "white" {} 7 | _DetailTex ("Detail (RGB)", 2D) = "white" {} 8 | _Strength ("Detail Strength", Range(0.0, 1.0)) = 0.2 9 | 10 | _StencilComp ("Stencil Comparison", Float) = 8 11 | _Stencil ("Stencil ID", Float) = 0 12 | _StencilOp ("Stencil Operation", Float) = 0 13 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 14 | _StencilReadMask ("Stencil Read Mask", Float) = 255 15 | 16 | _ColorMask ("Color Mask", Float) = 15 17 | } 18 | 19 | SubShader 20 | { 21 | LOD 200 22 | 23 | Tags 24 | { 25 | "Queue" = "Transparent" 26 | "IgnoreProjector" = "True" 27 | "RenderType" = "Transparent" 28 | "PreviewType"="Plane" 29 | } 30 | 31 | Stencil 32 | { 33 | Ref [_Stencil] 34 | Comp [_StencilComp] 35 | Pass [_StencilOp] 36 | ReadMask [_StencilReadMask] 37 | WriteMask [_StencilWriteMask] 38 | } 39 | 40 | Cull Off 41 | Lighting Off 42 | ZWrite Off 43 | ZTest [unity_GUIZTestMode] 44 | Offset -1, -1 45 | Fog { Mode Off } 46 | Blend SrcAlpha OneMinusSrcAlpha 47 | ColorMask [_ColorMask] 48 | 49 | Pass 50 | { 51 | CGPROGRAM 52 | #pragma vertex vert 53 | #pragma fragment frag 54 | #include "UnityCG.cginc" 55 | 56 | struct appdata_t 57 | { 58 | float4 vertex : POSITION; 59 | float2 texcoord : TEXCOORD0; 60 | float2 texcoord2 : TEXCOORD1; 61 | fixed4 color : COLOR; 62 | }; 63 | 64 | struct v2f 65 | { 66 | float4 vertex : POSITION; 67 | float2 texcoord : TEXCOORD0; 68 | float2 texcoord2 : TEXCOORD1; 69 | fixed4 color : COLOR; 70 | }; 71 | 72 | sampler2D _MainTex; 73 | sampler2D _DetailTex; 74 | float4 _MainTex_ST; 75 | float4 _DetailTex_ST; 76 | float4 _DetailTex_TexelSize; 77 | fixed4 _Color; 78 | fixed _Strength; 79 | 80 | v2f vert (appdata_t v) 81 | { 82 | v2f o; 83 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 84 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 85 | o.texcoord2 = TRANSFORM_TEX(v.texcoord2 * _DetailTex_TexelSize.xy, _DetailTex); 86 | o.color = v.color; 87 | return o; 88 | } 89 | 90 | half4 frag (v2f i) : COLOR 91 | { 92 | half4 col = i.color; 93 | fixed4 detail = tex2D(_DetailTex, i.texcoord2); 94 | col.rgb = lerp(col.rgb, col.rgb * detail.rgb, detail.a * _Strength); 95 | col.a *= tex2D(_MainTex, i.texcoord).a; 96 | col = col * _Color; 97 | clip (col.a - 0.01); 98 | return col; 99 | } 100 | ENDCG 101 | } 102 | } 103 | } 104 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/uGUI/GUI-Unlit-Transparent.shader: -------------------------------------------------------------------------------- 1 | Shader "uGUI/Unlit/Transparent" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Base (RGB), Alpha (A)", 2D) = "white" {} 6 | 7 | _StencilComp ("Stencil Comparison", Float) = 8 8 | _Stencil ("Stencil ID", Float) = 0 9 | _StencilOp ("Stencil Operation", Float) = 0 10 | _StencilWriteMask ("Stencil Write Mask", Float) = 255 11 | _StencilReadMask ("Stencil Read Mask", Float) = 255 12 | 13 | _ColorMask ("Color Mask", Float) = 15 14 | } 15 | 16 | SubShader 17 | { 18 | LOD 100 19 | 20 | Tags 21 | { 22 | "Queue" = "Transparent" 23 | "IgnoreProjector" = "True" 24 | "RenderType" = "Transparent" 25 | "PreviewType"="Plane" 26 | } 27 | 28 | Stencil 29 | { 30 | Ref [_Stencil] 31 | Comp [_StencilComp] 32 | Pass [_StencilOp] 33 | ReadMask [_StencilReadMask] 34 | WriteMask [_StencilWriteMask] 35 | } 36 | 37 | Cull Off 38 | Lighting Off 39 | ZWrite Off 40 | ZTest [unity_GUIZTestMode] 41 | Offset -1, -1 42 | Fog { Mode Off } 43 | Blend SrcAlpha OneMinusSrcAlpha 44 | ColorMask [_ColorMask] 45 | 46 | Pass 47 | { 48 | CGPROGRAM 49 | #pragma vertex vert 50 | #pragma fragment frag 51 | #include "UnityCG.cginc" 52 | 53 | struct appdata_t 54 | { 55 | float4 vertex : POSITION; 56 | float2 texcoord : TEXCOORD0; 57 | fixed4 color : COLOR; 58 | }; 59 | 60 | struct v2f 61 | { 62 | float4 vertex : SV_POSITION; 63 | half2 texcoord : TEXCOORD0; 64 | fixed4 color : COLOR; 65 | }; 66 | 67 | sampler2D _MainTex; 68 | float4 _MainTex_ST; 69 | 70 | v2f vert (appdata_t v) 71 | { 72 | v2f o; 73 | o.vertex = mul(UNITY_MATRIX_MVP, v.vertex); 74 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 75 | o.color = v.color; 76 | return o; 77 | } 78 | 79 | fixed4 frag (v2f i) : COLOR 80 | { 81 | fixed4 col = tex2D(_MainTex, i.texcoord) * i.color; 82 | clip (col.a - 0.01); 83 | return col; 84 | } 85 | ENDCG 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /DefaultResourcesExtra/uGUI/StencilMask.shader: -------------------------------------------------------------------------------- 1 | Shader "uGUI/Stencil Mask" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Diffuse (RGB), Alpha (A)", 2D) = "white" {} 6 | _Cutoff ("Cutoff", Range(0.01, 1.0)) = 0.2 7 | 8 | _StencilOp ("Stencil Operation", Float) = 2 9 | } 10 | 11 | SubShader 12 | { 13 | Tags { "RenderType"="Opaque" "Queue"="Transparent"} 14 | ColorMask 0 15 | ZWrite off 16 | 17 | Stencil 18 | { 19 | Comp always 20 | Pass [_StencilOp] 21 | } 22 | 23 | Pass 24 | { 25 | CGPROGRAM 26 | #pragma vertex vert 27 | #pragma fragment frag 28 | 29 | #include "UnityCG.cginc" 30 | 31 | sampler2D _MainTex; 32 | float4 _MainTex_ST; 33 | float _Cutoff; 34 | 35 | struct appdata 36 | { 37 | float4 vertex : POSITION; 38 | half4 texcoord : TEXCOORD0; 39 | }; 40 | 41 | struct v2f 42 | { 43 | float4 pos : SV_POSITION; 44 | half2 texcoord : TEXCOORD0; 45 | }; 46 | 47 | v2f vert(appdata v) 48 | { 49 | v2f o; 50 | o.pos = mul(UNITY_MATRIX_MVP, v.vertex); 51 | o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex); 52 | return o; 53 | } 54 | 55 | half4 frag(v2f i) : COLOR 56 | { 57 | half4 col = tex2D(_MainTex, i.texcoord); 58 | clip(col.a - _Cutoff); 59 | return half4(1,1,1,1); 60 | } 61 | ENDCG 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | UnityBuiltinShaders 2 | =================== 3 | 4 | github collection of unity built-in shaders (easier to see what has been changed) 5 | 6 | built-in shaders are available here: 7 | http://unity3d.com/unity/download/archive 8 | --------------------------------------------------------------------------------