slowly descending into madness
This commit is contained in:
25
shaders/point_draw_shader.gdshader
Normal file
25
shaders/point_draw_shader.gdshader
Normal file
@@ -0,0 +1,25 @@
|
||||
shader_type canvas_item;
|
||||
//render_mode skip_vertex_transform;
|
||||
|
||||
uniform sampler2D point_texture;
|
||||
|
||||
uniform ivec2 point_texture_size;
|
||||
uniform ivec2 canvas_size;
|
||||
|
||||
void vertex() {
|
||||
int id = INSTANCE_ID;
|
||||
int x = id % point_texture_size.x;
|
||||
int y = id / point_texture_size.x;
|
||||
// This feels dumb
|
||||
vec2 uv = vec2(float(x), float(y));
|
||||
vec4 point_data = texture(point_texture, uv);
|
||||
|
||||
vec2 pos = point_data.xy;
|
||||
float angle = point_data.z;
|
||||
|
||||
VERTEX=pos;
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
COLOR=vec4(1, 1, 1, 1);
|
||||
}
|
||||
1
shaders/point_draw_shader.gdshader.uid
Normal file
1
shaders/point_draw_shader.gdshader.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bq044vr2240p4
|
||||
@@ -7,6 +7,8 @@ uniform ivec2 point_texture_size;
|
||||
uniform ivec2 canvas_size;
|
||||
uniform float point_speed;
|
||||
|
||||
varying vec4 data;
|
||||
|
||||
// Snippets of code drawn from https://gist.github.com/Bleuje/1e497df4505ca24c39ab3930a95700b3
|
||||
float gn(in vec2 coordinate, in float seed){
|
||||
return fract(tan(distance(coordinate*(seed+0.118446744073709551614), vec2(0.118446744073709551614, 0.314159265358979323846264)))*0.141421356237309504880169);
|
||||
@@ -17,7 +19,7 @@ float trail_at_pos(vec2 uv) {
|
||||
}
|
||||
|
||||
void vertex() {
|
||||
int id = VERTEX_ID;
|
||||
int id = INSTANCE_ID;
|
||||
int x = id % point_texture_size.x;
|
||||
int y = id / point_texture_size.x;
|
||||
// This feels dumb
|
||||
@@ -25,14 +27,12 @@ void vertex() {
|
||||
vec4 point_data = texture(point_texture, uv);
|
||||
|
||||
vec2 pos = point_data.xy;
|
||||
pos += vec2(5000.0, 5000.0);
|
||||
float angle = point_data.z;
|
||||
|
||||
|
||||
VERTEX = pos/vec2(canvas_size);
|
||||
//COLOR = vec4(pos, angle, point_data.z)
|
||||
COLOR=vec4(1, 1, 1, 1);
|
||||
//COLOR = vec4(0.2, 0.0, 0.0, 1.0)
|
||||
data=vec4(pos, angle, point_data.z);
|
||||
}
|
||||
|
||||
void fragment() {
|
||||
}
|
||||
COLOR=data;
|
||||
}
|
||||
Reference in New Issue
Block a user