did stuff
This commit is contained in:
parent
dbc1ad5b4b
commit
7b6224ec15
34 changed files with 1558 additions and 4 deletions
38
Shaders/Link.vsh
Normal file
38
Shaders/Link.vsh
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#version 460
|
||||
uniform vec3 position[2];
|
||||
uniform vec2 width;
|
||||
|
||||
|
||||
out float depth;
|
||||
|
||||
|
||||
|
||||
void main(){
|
||||
vec2 direction = normalize(position[1].xy - position[0].xy);
|
||||
|
||||
vec2 leftdir = vec2(direction.y,-direction.x);
|
||||
vec2 rightdir = vec2(-direction.y,direction.x);
|
||||
|
||||
|
||||
|
||||
switch(gl_VertexID){
|
||||
case 0:
|
||||
gl_Position = vec4(position[0].xy + leftdir * width, 0.0f, 1.0f);
|
||||
depth = position[0].z;
|
||||
break;
|
||||
case 1:
|
||||
case 3:
|
||||
gl_Position = vec4(position[0].xy + rightdir * width, 0.0f, 1.0f);
|
||||
depth = position[0].z;
|
||||
break;
|
||||
case 2:
|
||||
case 5:
|
||||
gl_Position = vec4(position[1].xy + leftdir * width, 0.0f, 1.0f);
|
||||
depth = position[1].z;
|
||||
break;
|
||||
case 4:
|
||||
gl_Position = vec4(position[1].xy + rightdir * width, 0.0f, 1.0f);
|
||||
depth = position[1].z;
|
||||
break;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue