Tech ENABLE_GL_CORE_PROFILE - Use thick_lines shader where needed
Fixed conflicts during rebase with master
This commit is contained in:
parent
389dc36053
commit
017784c38e
14 changed files with 142 additions and 20 deletions
|
@ -2,7 +2,7 @@
|
|||
|
||||
// see as reference: https://github.com/mhalber/Lines/blob/master/geometry_shader_lines.h
|
||||
|
||||
const vec2 aa_radius = vec2(1.5);
|
||||
const vec2 aa_radius = vec2(1.0);
|
||||
|
||||
uniform vec4 uniform_color;
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
layout(lines) in;
|
||||
layout(triangle_strip, max_vertices = 4) out;
|
||||
|
||||
const vec2 aa_radius = vec2(1.5);
|
||||
const vec2 aa_radius = vec2(1.0);
|
||||
|
||||
uniform vec2 viewport_size;
|
||||
uniform float width;
|
||||
|
@ -20,10 +20,10 @@ void main()
|
|||
float u_height = viewport_size[1];
|
||||
float u_aspect_ratio = u_height / u_width;
|
||||
|
||||
vec2 ndc_a = gl_in[0].gl_Position.xy / gl_in[0].gl_Position.w;
|
||||
vec2 ndc_b = gl_in[1].gl_Position.xy / gl_in[1].gl_Position.w;
|
||||
vec2 ndc_0 = gl_in[0].gl_Position.xy / gl_in[0].gl_Position.w;
|
||||
vec2 ndc_1 = gl_in[1].gl_Position.xy / gl_in[1].gl_Position.w;
|
||||
|
||||
vec2 line_vector = ndc_b - ndc_a;
|
||||
vec2 line_vector = ndc_1 - ndc_0;
|
||||
vec2 viewport_line_vector = line_vector * viewport_size;
|
||||
vec2 dir = normalize(viewport_line_vector);
|
||||
vec2 normal_dir = vec2(-dir.y, dir.x);
|
||||
|
@ -38,19 +38,19 @@ void main()
|
|||
float half_line_length = line_length * 0.5;
|
||||
|
||||
uv = vec2(-half_line_width, half_line_length);
|
||||
gl_Position = vec4((ndc_a + normal - extension) * gl_in[0].gl_Position.w, gl_in[0].gl_Position.zw);
|
||||
gl_Position = vec4((ndc_0 + normal - extension) * gl_in[0].gl_Position.w, gl_in[0].gl_Position.zw);
|
||||
EmitVertex();
|
||||
|
||||
uv = vec2(-half_line_width, -half_line_length);
|
||||
gl_Position = vec4((ndc_a - normal - extension) * gl_in[0].gl_Position.w, gl_in[0].gl_Position.zw);
|
||||
gl_Position = vec4((ndc_0 - normal - extension) * gl_in[0].gl_Position.w, gl_in[0].gl_Position.zw);
|
||||
EmitVertex();
|
||||
|
||||
uv = vec2(half_line_width, half_line_length);
|
||||
gl_Position = vec4((ndc_b + normal + extension) * gl_in[1].gl_Position.w, gl_in[1].gl_Position.zw);
|
||||
gl_Position = vec4((ndc_1 + normal + extension) * gl_in[1].gl_Position.w, gl_in[1].gl_Position.zw);
|
||||
EmitVertex();
|
||||
|
||||
uv = vec2(half_line_width, -half_line_length);
|
||||
gl_Position = vec4((ndc_b - normal + extension) * gl_in[1].gl_Position.w, gl_in[1].gl_Position.zw);
|
||||
gl_Position = vec4((ndc_1 - normal + extension) * gl_in[1].gl_Position.w, gl_in[1].gl_Position.zw);
|
||||
EmitVertex();
|
||||
|
||||
EndPrimitive();
|
Loading…
Add table
Add a link
Reference in a new issue