some diffuse added for funzies

This commit is contained in:
2025-08-03 02:24:32 +03:00
parent b10deff5e0
commit 761a1b63f4
4 changed files with 32 additions and 14 deletions

View File

@@ -5,7 +5,16 @@ uniform sampler2D sim_texture;
uniform float decay_factor;
void fragment() {
float c = texture(sim_texture, UV).r;
c = c * decay_factor;
COLOR = vec4(c, c, c, 1.0);
vec3 orig = texture(sim_texture, UV).rgb;
float trail = texture(sim_texture, UV).g;
float sum = 0.0;
for(int i=-1;i<=1;i++) {
for(int j=-1;j<=1;j++) {
sum += texture(sim_texture, UV).g;
}
}
trail = sum / 9.0;
trail = trail * decay_factor;
COLOR = vec4(orig.r, trail, orig.b, 1.0);
}