Skip to content

Commit fb26d55

Browse files
committed
extra-animations: burn: Improve sides of burn
This fixes surfaces that have no shadows or decorations by only sampling the surface texture in the range of 0 - 1. It also expands the flames on the sides of the surface to fully engulf these edge cases.
1 parent c66cd43 commit fb26d55

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/extra-animations/burn.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,15 @@ void main()
147147
148148
float a = clamp(c * (1.0 - pow(uvpos.y, 10.0)), 0.0, 1.0);
149149
vec4 wfrag = get_pixel(uvpos);
150-
if (uvpos.y < progress)
150+
if (uvpos.x < 0.0 || uvpos.x > 1.0 ||
151+
uvpos.y < 0.0 || uvpos.y > 1.0 ||
152+
uvpos.y < progress)
151153
{
152154
wfrag = vec4(0.0);
153155
}
154156
a *= clamp(progress * 10.0, 0.0, 1.0);
155-
a *= clamp(uvpos.x * (width / 30.0), 0.0, 1.0);
156-
a *= clamp((1.0 - uvpos.x) * (width / 30.0), 0.0, 1.0);
157+
a *= 1.0 - pow(clamp(-uvpos.x * (width * 0.05), 0.0, 1.0), 0.7);
158+
a *= 1.0 - pow(clamp((1.0 - (2.0 - uvpos.x)) * (width * 0.05), 0.0, 1.0), 0.7);
157159
vec4 color = vec4(col * a, a);
158160
gl_FragColor = color + wfrag * (1.0 - a);
159161
}

0 commit comments

Comments
 (0)