noise, but noghint working

This commit is contained in:
2025-08-03 21:40:35 +03:00
parent 761a1b63f4
commit 62a680e260
7 changed files with 106 additions and 62 deletions

View File

@@ -1,20 +1,21 @@
shader_type canvas_item;
uniform sampler2D sim_texture;
uniform sampler2D trail_texture;
uniform float decay_factor;
void fragment() {
vec3 orig = texture(sim_texture, UV).rgb;
float trail = texture(sim_texture, UV).g;
vec3 orig = texture(trail_texture, UV).rgb;
float trail = orig.r;
float sum = 0.0;
for(int i=-1;i<=1;i++) {
for(int j=-1;j<=1;j++) {
sum += texture(sim_texture, UV).g;
for(float i=-1.0;i<=1.5;i++) {
for(float j=-1.0;j<=1.5;j++) {
vec2 offset = vec2(i,j);
sum += texture(trail_texture, UV + vec2(i,j)).g;
}
}
trail = sum / 9.0;
trail = trail * decay_factor;
COLOR = vec4(orig.r, trail, orig.b, 1.0);
COLOR = vec4(trail, orig.g, orig.b, 1.0);
}