some diffuse added for funzies
This commit is contained in:
@@ -1,8 +1,17 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
// Snippets of code drawn from https://gist.github.com/Bleuje/1e497df4505ca24c39ab3930a95700b3
|
||||
|
||||
uniform sampler2D sim_texture;
|
||||
|
||||
void fragment() {
|
||||
vec3 c = texture(sim_texture, UV).rgb;
|
||||
COLOR = vec4(c, 1.0);
|
||||
float gn(in vec2 coordinate, in float seed){
|
||||
return fract(tan(distance(coordinate*(seed+0.118446744073709551614), vec2(0.118446744073709551614, 0.314159265358979323846264)))*0.141421356237309504880169);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
vec3 orig = texture(sim_texture, UV).rgb;
|
||||
float agent = orig.r;
|
||||
float trail = orig.g;
|
||||
|
||||
COLOR = vec4(agent, trail, orig.b, 1.0);
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user