Skip to content

Commit 67e3397

Browse files
committed
Improve emmision animation
1 parent 866661e commit 67e3397

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Assets/Demo/World.shader

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ float4 _FloorSpecular;
112112

113113
inline void PostEffect(RaymarchInfo ray, inout PostEffectOutput o)
114114
{
115-
o.emission = half4(2.0, 2.0, 5.0, 1.0) * abs(sin(PI * 12.0 * _Time.x)) * step(frac(ray.endPos.y - 4.0 * _Time.x), 0.02);
115+
float a = frac(4.0 * ray.endPos.y - 2.0 * _Time.x - 0.5);
116+
float width = 0.02;
117+
o.emission = half4(2.0, 2.0, 5.0, 1.0) * abs(sin(PI * 12.0 * _Time.x)) * step(a, width) * ((a + 0.5 * width) / width);
116118

117119
if (abs(dInnerPillar(ray.endPos)) < ray.minDistance)
118120
{

0 commit comments

Comments
 (0)