Skip to content
Snippets Groups Projects
Commit 74360184 authored by Rico Possienka's avatar Rico Possienka
Browse files

workaround to make lines stick to ground, avoid artifacts

parent 35f53f4e
No related branches found
No related tags found
No related merge requests found
......@@ -40,6 +40,7 @@
{
v2f o;
o.vertex = UnityObjectToClipPos(v.vertex);
o.vertex.z = 0; //HACK: Make lines stick to ground without weird artifacts.
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
o.color = v.color;
UNITY_TRANSFER_FOG(o,o.vertex);
......@@ -54,7 +55,7 @@
{
// sample the texture
//fixed4 col = tex2D(_MainTex, i.uv);
float t = _Time.b;
float t = _Time.r;
t = t % 1.0;
float x = i.color.r + t;
x = x % 2 - 1; //[-1..1]
......@@ -63,6 +64,9 @@
float4 red = _Color;
fixed4 col = red * clamp(f(x+t, 20), 0, 1);
//TEST
//col = _Color;
// apply fog
UNITY_APPLY_FOG(i.fogCoord, col);
return col;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment