summaryrefslogtreecommitdiffstats
path: root/Shaders
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2023-01-25 22:30:49 -0800
committeryum <yum.food.vr@gmail.com>2023-01-25 22:40:22 -0800
commit6de4a8cf572120799e08e77126bff832e5f5668f (patch)
tree9722e72747cd0dadad9207fe986dcea6db7813c2 /Shaders
parente5da172a85368551954332836e52d2c98b37edec (diff)
Update Unity materials
* Render at 3k render queue to avoid clashing with avatar meshes * Set reasonable shader defaults * Remove unused material
Diffstat (limited to 'Shaders')
-rw-r--r--Shaders/TaSTT_lighting_template.cginc7
-rw-r--r--Shaders/TaSTT_template.shader7
2 files changed, 8 insertions, 6 deletions
diff --git a/Shaders/TaSTT_lighting_template.cginc b/Shaders/TaSTT_lighting_template.cginc
index 1161264..13729bd 100644
--- a/Shaders/TaSTT_lighting_template.cginc
+++ b/Shaders/TaSTT_lighting_template.cginc
@@ -93,6 +93,9 @@ void getVertexLightColor(inout v2f i)
float3 light_vec = light_pos - i.worldPos;
float3 light_dir = normalize(light_vec);
float ndotl = DotClamped(i.normal, light_dir);
+ // Light fills an expanding sphere with surface area 4 * pi * r^2.
+ // By conservation of energy, this means that at distance r, light intensity
+ // is proportional to 1/(r^2).
float attenuation = 1 / (1 + dot(light_vec, light_vec) * unity_4LightAtten0.x);
i.vertexLightColor = unity_LightColor[0].rgb * ndotl * attenuation;
@@ -366,9 +369,6 @@ fixed4 margin_effect(v2f i)
UnityLight GetLight(v2f i)
{
- // Light fills an expanding sphere with surface area 4 * pi * r^2.
- // By conservation of energy, this means that at distance r, light intensity
- // is proportional to 1/(r^2).
UNITY_LIGHT_ATTENUATION(attenuation, 0, i.worldPos);
float3 light_color = _LightColor0.rgb * attenuation;
@@ -530,3 +530,4 @@ fixed4 frag (v2f i) : SV_Target
}
#endif // TASTT_LIGHTING
+
diff --git a/Shaders/TaSTT_template.shader b/Shaders/TaSTT_template.shader
index 44c8a17..f30fc44 100644
--- a/Shaders/TaSTT_template.shader
+++ b/Shaders/TaSTT_template.shader
@@ -59,9 +59,9 @@
}
Pass {
Tags {
- "RenderType"="Opaque"
- "Queue"="AlphaTest+499"
- "LightMode" = "ForwardAdd"
+ "RenderType" = "Opaque"
+ "LightMode" = "ForwardAdd"
+ "Queue"="AlphaTest+499"
}
Blend One One
ZWrite Off
@@ -79,3 +79,4 @@
}
}
}
+