mirror of
https://github.com/allemangD/toddcox-visualize.git
synced 2026-01-11 18:34:07 -05:00
load shaders from files.
This commit is contained in:
12
vis/shaders/one-color.fs.glsl
Normal file
12
vis/shaders/one-color.fs.glsl
Normal file
@@ -0,0 +1,12 @@
|
||||
#version 430
|
||||
|
||||
layout(location=2) uniform vec3 c;
|
||||
|
||||
in vec4 vpos;
|
||||
|
||||
out vec4 color;
|
||||
|
||||
void main() {
|
||||
float d = smoothstep(-2, 2, vpos.z);
|
||||
color = vec4(c * d, 1);
|
||||
}
|
||||
15
vis/shaders/ortho.vs.glsl
Normal file
15
vis/shaders/ortho.vs.glsl
Normal file
@@ -0,0 +1,15 @@
|
||||
#version 430
|
||||
|
||||
layout(location=0) uniform mat4 proj;
|
||||
layout(location=1) uniform mat4 view;
|
||||
|
||||
layout(location=0) in vec4 pos;
|
||||
|
||||
out vec4 vpos;
|
||||
|
||||
void main() {
|
||||
int i = gl_VertexID;
|
||||
vpos = view * pos;
|
||||
gl_Position = proj * vec4(vpos.xyz / (1), 1);
|
||||
gl_PointSize = 5;
|
||||
}
|
||||
15
vis/shaders/stereo.vs.glsl
Normal file
15
vis/shaders/stereo.vs.glsl
Normal file
@@ -0,0 +1,15 @@
|
||||
#version 430
|
||||
|
||||
layout(location=0) uniform mat4 proj;
|
||||
layout(location=1) uniform mat4 view;
|
||||
|
||||
layout(location=0) in vec4 pos;
|
||||
|
||||
out vec4 vpos;
|
||||
|
||||
void main() {
|
||||
int i = gl_VertexID;
|
||||
vpos = view * pos;
|
||||
gl_Position = proj * vec4(vpos.xyz / (1 - vpos.w), 1);
|
||||
gl_PointSize = 5;
|
||||
}
|
||||
11
vis/shaders/w-axis-hue.fs.glsl
Normal file
11
vis/shaders/w-axis-hue.fs.glsl
Normal file
@@ -0,0 +1,11 @@
|
||||
#version 430
|
||||
|
||||
in vec4 vpos;
|
||||
|
||||
out vec4 color;
|
||||
|
||||
void main() {
|
||||
float d = smoothstep(-2, 2, vpos.z);
|
||||
vec3 off = 1.04 * vec3(0, 2, 4) + 2 * vec3(vpos.w);
|
||||
color = vec4(d * cos(off), 1);
|
||||
}
|
||||
Reference in New Issue
Block a user