COMP: Clean up unused shaders

This commit is contained in:
David Allemang
2023-02-05 21:46:29 -05:00
parent 676e98bb87
commit 9dd634481c
8 changed files with 13 additions and 146 deletions

View File

@@ -1,9 +1,4 @@
add_embed_library(shaders add_embed_library(shaders
curve-ortho.gm.glsl
curve-stereo.gm.glsl
diffuse.fs.glsl
direct-ortho.vs.glsl
direct-stereo.vs.glsl
solid.fs.glsl solid.fs.glsl
deferred.vs.glsl deferred.vs.glsl
slice.gm.glsl slice.gm.glsl

View File

@@ -1,38 +0,0 @@
#version 430
#define SUBS 20
layout(lines) in;
layout(line_strip, max_vertices = SUBS) out;
layout(std430, binding=1) buffer Positions {
vec4 verts[];
};
layout(std140, binding=1) uniform Matrices {
mat4 proj;
mat4 view;
};
out gl_PerVertex {
vec4 gl_Position;
float gl_PointSize;
};
in vec4 gpos[];
out vec4 vpos;
vec4 stereo(vec4 v) {
return vec4(v.xyz, 1);
}
void main() {
for (int i = 0; i < SUBS; i++) {
vpos = mix(gpos[0], gpos[1], i * 1.0f / (SUBS - 1));
vpos = normalize(vpos);
gl_Position = proj * stereo(vpos);
EmitVertex();
}
EndPrimitive();
}

View File

@@ -1,39 +0,0 @@
#version 430
#define SUBS 20
layout(lines) in;
layout(line_strip, max_vertices = SUBS) out;
layout(std430, binding=1) buffer Positions {
vec4 verts[];
};
layout(std140, binding=1) uniform Matrices {
mat4 proj;
mat4 view;
};
out gl_PerVertex {
vec4 gl_Position;
float gl_PointSize;
};
in vec4 gpos[];
out vec4 vpos;
vec4 stereo(vec4 v) {
return vec4(v.xyz / (1 - v.w), 1);
}
void main() {
for (int i = 0; i < SUBS; i++) {
vpos = mix(gpos[0], gpos[1], i * 1.0f / (SUBS - 1));
vpos = normalize(vpos);
gl_Position = proj * stereo(vpos);
EmitVertex();
}
EndPrimitive();
}

View File

@@ -9,6 +9,11 @@ layout(std140, binding=1) uniform Matrices {
mat4 view; mat4 view;
}; };
layout(std140, binding=2) uniform ModelMatrices {
mat4 linear;
vec4 translation;
};
layout(location=0) in ivec4 inds; layout(location=0) in ivec4 inds;
layout(location=1) in vec4 col; layout(location=1) in vec4 col;
@@ -24,7 +29,7 @@ void main() {
vInds = inds; vInds = inds;
vCol = col; vCol = col;
vec4 pos = view * verts[vInds.x]; vec4 pos = linear * verts[vInds.x] + translation;
gl_Position = proj * vec4(pos.xyz, 1); gl_Position = proj * vec4(pos.xyz, 1);
gl_PointSize = 5; gl_PointSize = 5;
} }

View File

@@ -1,14 +0,0 @@
#version 430
layout(location=1) in vec4 col;
layout(location=2) in vec3 normal;
out vec4 color;
void main() {
float bright = dot(normal, normalize(vec3(-0.6, 1, 2)));
bright = .6 + .3 * bright;
color = col;
color.xyz *= bright;
}

View File

@@ -1,24 +0,0 @@
#version 430
layout(std430, binding=1) buffer Positions {
vec4 verts[];
};
layout(std140, binding=1) uniform Matrices {
mat4 proj;
mat4 view;
};
out gl_PerVertex {
vec4 gl_Position;
float gl_PointSize;
};
out vec4 vpos;
void main() {
vec4 pos = verts[gl_VertexID];
vpos = view * pos;
gl_Position = proj * vec4(vpos.xyz / (1), 1);
gl_PointSize = 5;
}

View File

@@ -1,24 +0,0 @@
#version 430
layout(std430, binding=1) buffer Positions {
vec4 verts[];
};
layout(std140, binding=1) uniform Matrices {
mat4 proj;
mat4 view;
};
out gl_PerVertex {
vec4 gl_Position;
float gl_PointSize;
};
out vec4 vpos;
void main() {
vec4 pos = verts[gl_VertexID];
vpos = view * pos;
gl_Position = proj * vec4(vpos.xyz / (1 - vpos.w), 1);
gl_PointSize = 5;
}

View File

@@ -12,6 +12,11 @@ layout(std140, binding=1) uniform Matrices {
mat4 view; mat4 view;
}; };
layout(std140, binding=2) uniform ModelMatrices {
mat4 linear;
vec4 translation;
};
in ivec4 vInds[]; in ivec4 vInds[];
in vec4 vCol[]; in vec4 vCol[];
@@ -36,7 +41,8 @@ void emit(vec4 v) {
void main() { void main() {
vec4 pos4[4]; vec4 pos4[4];
for (int i = 0; i < 4; ++i) pos4[i] = view * verts[vInds[0][i]]; for (int i = 0; i < 4; ++i)
pos4[i] = view * (linear * verts[vInds[0][i]] + translation);
int lo[4], L = 0; int lo[4], L = 0;
int hi[4], H = 0; int hi[4], H = 0;