Skip to content

Commit a16b133

Browse files
committed
TransparentDiffuse Shader
- Added modified Nature/Terrain/Diffuse shader to allow transparency to be set.
1 parent b0563bf commit a16b133

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

Assets/Resources/Shaders.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
2+
3+
Shader "Nature/Terrain/Diffuse" {
4+
Properties {
5+
_Color ("Main Color", Color) = (1,1,1,1)
6+
_MainTex ("Base (RGB)", 2D) = "white" {}
7+
[HideInInspector] _TerrainHolesTexture("Holes Map (RGB)", 2D) = "white" {}
8+
}
9+
SubShader {
10+
Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent"}
11+
LOD 200
12+
13+
CGPROGRAM
14+
#pragma surface surf Lambert vertex:SplatmapVert addshadow fullforwardshadows alpha:fade
15+
#pragma instancing_options assumeuniformscaling nomatrices nolightprobe nolightmap forwardadd
16+
#pragma multi_compile_local __ _ALPHATEST_ON
17+
18+
#define TERRAIN_BASE_PASS
19+
#include "TerrainSplatmapCommon.cginc"
20+
21+
sampler2D _MainTex;
22+
fixed4 _Color;
23+
24+
void surf (Input IN, inout SurfaceOutput o) {
25+
#ifdef _ALPHATEST_ON
26+
ClipHoles(IN.tc.xy);
27+
#endif
28+
fixed4 c = tex2D(_MainTex, IN.tc.xy) * _Color;
29+
o.Albedo = c.rgb;
30+
o.Alpha = c.a;
31+
}
32+
ENDCG
33+
34+
UsePass "Hidden/Nature/Terrain/Utilities/PICKING"
35+
UsePass "Hidden/Nature/Terrain/Utilities/SELECTION"
36+
}
37+
38+
Fallback "Legacy Shaders/VertexLit"
39+
}

Assets/Resources/Shaders/TransparentDiffuseBase.shader.meta

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)