PluginProbe
Code Block Pro – Beautiful Syntax Highlighting / 1.27.3
Code Block Pro – Beautiful Syntax Highlighting v1.27.3
1.27.1 1.27.2 1.27.3 1.27.4 1.27.5 1.27.6 1.27.7 1.28.0 1.3.0 1.4.0 1.5.0 1.5.1 1.5.2 1.6.0 1.7.0 1.8.0 1.9.0 1.9.1 1.9.2 1.9.3 trunk 1.1.0 1.10.0 1.11.0 1.11.1 All 63 releases
code-block-pro / build / shiki / samples / shaderlab.sample

shaderlab.sample in Code Block Pro – Beautiful Syntax Highlighting 1.27.3, at build/shiki/samples/shaderlab.sample

61 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 Shader "Unlit/NewUnlitShader"
2 {
3 Properties
4 {
5 _MainTex ("Texture", 2D) = "white" {}
6 }
7 SubShader
8 {
9 Tags { "RenderType"="Opaque" }
10 LOD 100
11
12 Pass
13 {
14 CGPROGRAM
15 #pragma vertex vert
16 #pragma fragment frag
17 // make fog work
18 #pragma multi_compile_fog
19
20 #include "UnityCG.cginc"
21
22 struct appdata
23 {
24 float4 vertex : POSITION;
25 float2 uv : TEXCOORD0;
26 };
27
28 struct v2f
29 {
30 float2 uv : TEXCOORD0;
31 UNITY_FOG_COORDS(1)
32 float4 vertex : SV_POSITION;
33 };
34
35 sampler2D _MainTex;
36 float4 _MainTex_ST;
37
38 v2f vert (appdata v)
39 {
40 v2f o;
41 o.vertex = UnityObjectToClipPos(v.vertex);
42 o.uv = TRANSFORM_TEX(v.uv, _MainTex);
43 UNITY_TRANSFER_FOG(o,o.vertex);
44 return o;
45 }
46
47 fixed4 frag (v2f i) : SV_Target
48 {
49 // sample the texture
50 fixed4 col = tex2D(_MainTex, i.uv);
51 // apply fog
52 UNITY_APPLY_FOG(i.fogCoord, col);
53 return col;
54 }
55 ENDCG
56 }
57 }
58 }
59
60 // From https://docs.unity3d.com/Manual/SL-VertexFragmentShaderExamples.html
61