simplify template
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
#version 440
|
||||
|
||||
#define PI 3.14159
|
||||
|
||||
in vec4 pos;
|
||||
in vec4 pos4;
|
||||
in vec4 pos3;
|
||||
|
||||
out vec4 color;
|
||||
|
||||
void main() {
|
||||
float light = -pos3.y / 10 + .5;
|
||||
|
||||
vec3 col = vec3(1);
|
||||
|
||||
color = vec4(col * light, 1);
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
#version 440
|
||||
|
||||
#define CIRCLE_RES 64
|
||||
#define PI 3.14159
|
||||
|
||||
layout(points) in;
|
||||
layout(line_strip, max_vertices=CIRCLE_RES) out;
|
||||
|
||||
layout(binding=1) uniform Matrices {
|
||||
mat4 proj;
|
||||
mat4 model;
|
||||
};
|
||||
|
||||
in float xi_[];
|
||||
in float eta_[];
|
||||
|
||||
out vec4 pos;
|
||||
out vec4 pos4;
|
||||
out vec4 pos3;
|
||||
|
||||
void main(){
|
||||
for(int k = 0; k <= CIRCLE_RES; k++) {
|
||||
vec2 xi = vec2(xi_[0], 4 * PI * k / (CIRCLE_RES - 1));
|
||||
float eta = eta_[0];
|
||||
|
||||
// todo parameterize the projected circle so there aren't jagged edges.
|
||||
// should be smooth at <=32 segments, not just 128+
|
||||
float x = cos((xi.y + xi.x) / 2) * sin(eta);
|
||||
float y = sin((xi.y + xi.x) / 2) * sin(eta);
|
||||
float z = cos((xi.y - xi.x) / 2) * cos(eta);
|
||||
float w = sin((xi.y - xi.x) / 2) * cos(eta);
|
||||
|
||||
pos = vec4(x, y, z, w);
|
||||
pos4 = model * pos;
|
||||
pos3 = vec4(pos4.xyz / (1 - pos4.w), 1);
|
||||
gl_Position = proj * pos3;
|
||||
|
||||
if (length(gl_Position) > 4) {
|
||||
EndPrimitive();
|
||||
continue;
|
||||
}
|
||||
|
||||
EmitVertex();
|
||||
}
|
||||
|
||||
EndPrimitive();
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
#version 440
|
||||
|
||||
layout(location=0) in float xi;
|
||||
layout(location=1) in float eta;
|
||||
|
||||
out float xi_;
|
||||
out float eta_;
|
||||
|
||||
void main(){
|
||||
xi_ = xi;
|
||||
eta_ = eta;
|
||||
}
|
||||
Reference in New Issue
Block a user