-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTextFile1.txt
More file actions
47 lines (43 loc) · 1021 Bytes
/
TextFile1.txt
File metadata and controls
47 lines (43 loc) · 1021 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Shader "Effects/LightMesh" {
Properties{
_Opacity("Opacity", Range(0, 1)) = .5
_Emission("Emission", Range(0, 1)) = .5
_Numerator("Numerator", Float) = 3
}
SubShader
{
Tags{ "RenderType" = "Transparent" "Queue" = "Transparent" }
LOD 200
Pass{
ColorMask 0
}
// Render normally
ZWrite Off
BlendOp Add
ColorMask RGB
CGPROGRAM
#pragma fragment frag Standard fullforwardshadows alpha:fade
#pragma target 3.0
struct Input {
float2 uv_MainTex;
float3 worldPos;
};
float _Opacity;
float _Emission;
float _Numerator;
#include "UnityBuiltin2xTreeLibrary.cginc"
void surf(Input IN, inout SurfaceOutputStandard o) {
float3 localPosition = IN.worldPos - mul(unity_ObjectToWorld, float4(0, 0, 0, 1)).xyz;
float opacity = _Numerator/(localPosition.x+ localPosition.z);
// float opacity = _Numerator/localPosition.y;
o.Alpha = _Opacity * opacity;
o.Emission = _Emission* opacity;
}
fixed4 frag(v2f i) : SV_Target
{
return float4(1, 1, 1, 1);
}
ENDCG
}
Fallback "Diffuse"
}