mirror of
https://github.com/drewcassidy/KSP-Conformal-Decals.git
synced 2024-09-01 18:23:54 +00:00
Fix ForwardAdd overlap in shader
This requires some code change to actually work (the material Queue also needs to be updated dynamically)
This commit is contained in:
parent
9a8a347cc7
commit
6e07433eed
@ -17,17 +17,16 @@ Shader "ConformalDecals/Feature/Bumped"
|
||||
}
|
||||
SubShader
|
||||
{
|
||||
Tags { "Queue" = "Geometry+400" }
|
||||
ZWrite On
|
||||
Tags { "Queue" = "Geometry+100" }
|
||||
Cull Off
|
||||
ZTest LEqual
|
||||
Offset -1, -1
|
||||
|
||||
Pass
|
||||
{
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardBase" }
|
||||
Blend SrcAlpha OneMinusSrcAlpha
|
||||
ZWrite Off
|
||||
ZTest LEqual
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_forward
|
||||
@ -60,7 +59,7 @@ Shader "ConformalDecals/Feature/Bumped"
|
||||
float3 normal = UnpackNormal(tex2D(_BumpMap, IN.uv_bump));
|
||||
|
||||
// clip alpha
|
||||
clip(color.a - _Cutoff);
|
||||
clip(color.a - saturate(_Cutoff + 0.01));
|
||||
|
||||
half rim = 1.0 - saturate(dot (normalize(IN.viewDir), normal));
|
||||
float3 emission = (_RimColor.rgb * pow(rim, _RimFalloff)) * _RimColor.a;
|
||||
@ -79,6 +78,9 @@ Shader "ConformalDecals/Feature/Bumped"
|
||||
Name "FORWARD"
|
||||
Tags { "LightMode" = "ForwardAdd" }
|
||||
Blend One One
|
||||
ZWrite On
|
||||
ZTest Less
|
||||
Offset -1, -1
|
||||
|
||||
CGPROGRAM
|
||||
#pragma vertex vert_forward
|
||||
@ -111,7 +113,7 @@ Shader "ConformalDecals/Feature/Bumped"
|
||||
float3 normal = UnpackNormal(tex2D(_BumpMap, IN.uv_bump));
|
||||
|
||||
// clip alpha
|
||||
clip(color.a - _Cutoff);
|
||||
clip(color.a - saturate(_Cutoff + 0.01));
|
||||
|
||||
half rim = 1.0 - saturate(dot (normalize(IN.viewDir), normal));
|
||||
float3 emission = (_RimColor.rgb * pow(rim, _RimFalloff)) * _RimColor.a;
|
||||
|
@ -1,3 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c5c6eac6b56d72887c678fd14aa4f5596e2e3c1ba0da2dcf0e8d9c84789bb5f0
|
||||
size 98741
|
||||
oid sha256:d1ffb743f95c6917c013dcd9cfd2205c769c2aa550191f17f43cb373b1bec195
|
||||
size 98979
|
||||
|
Loading…
Reference in New Issue
Block a user