mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-07 04:00:37 -06:00
back to padd-triangles. don't fade line during rendering
This commit is contained in:
@@ -25,15 +25,9 @@
|
||||
#include "fragment.glsl"
|
||||
|
||||
uniform vec3 color;
|
||||
uniform vec2 viewport;
|
||||
uniform float lineWidth;
|
||||
|
||||
in vec2 center;
|
||||
|
||||
Fragment getFragment() {
|
||||
float dist = 1.0 - 2 * length(gl_FragCoord.xy - center) / lineWidth;
|
||||
float alpha = smoothstep(0, 1, dist);
|
||||
Fragment frag;
|
||||
frag.color = vec4(vec3(color), alpha);
|
||||
frag.color = vec4(vec3(color), 1);
|
||||
return frag;
|
||||
}
|
||||
|
||||
@@ -30,8 +30,6 @@ layout (triangle_strip, max_vertices = 6) out;
|
||||
uniform vec2 viewport;
|
||||
uniform float lineWidth;
|
||||
|
||||
out vec2 center;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 p0 = gl_in[0].gl_Position;
|
||||
@@ -66,32 +64,42 @@ void main()
|
||||
vec4 pos;
|
||||
|
||||
pos = p1;
|
||||
pos.xy += m1 * lineWidth * 0.5;
|
||||
center = p1.xy;
|
||||
pos.xy += np * lineWidth * 0.5;
|
||||
pos.xy = 2 * pos.xy / viewport - 1;
|
||||
pos.xyz *= pos.w;
|
||||
gl_Position = pos;
|
||||
EmitVertex();
|
||||
|
||||
pos = p1;
|
||||
pos.xy -= m1 * lineWidth * 0.5;
|
||||
center = p1.xy;
|
||||
pos.xy += nl * lineWidth * 0.5;
|
||||
pos.xy = 2 * pos.xy / viewport - 1;
|
||||
pos.xyz *= pos.w;
|
||||
gl_Position = pos;
|
||||
EmitVertex();
|
||||
|
||||
pos = p1;
|
||||
pos.xy -= nl * lineWidth * 0.5;
|
||||
pos.xy = 2 * pos.xy / viewport - 1;
|
||||
pos.xyz *= pos.w;
|
||||
gl_Position = pos;
|
||||
EmitVertex();
|
||||
|
||||
pos = p2;
|
||||
pos.xy += m2 * lineWidth * 0.5;
|
||||
center = p2.xy;
|
||||
pos.xy += nl * lineWidth * 0.5;
|
||||
pos.xy = 2 * pos.xy / viewport - 1;
|
||||
pos.xyz *= pos.w;
|
||||
gl_Position = pos;
|
||||
EmitVertex();
|
||||
|
||||
pos = p2;
|
||||
pos.xy -= m2 * lineWidth * 0.5;
|
||||
center = p2.xy;
|
||||
pos.xy -= nl * lineWidth * 0.5;
|
||||
pos.xy = 2 * pos.xy / viewport - 1;
|
||||
pos.xyz *= pos.w;
|
||||
gl_Position = pos;
|
||||
EmitVertex();
|
||||
|
||||
pos = p2;
|
||||
pos.xy -= nn * lineWidth * 0.5;
|
||||
pos.xy = 2 * pos.xy / viewport - 1;
|
||||
pos.xyz *= pos.w;
|
||||
gl_Position = pos;
|
||||
|
||||
@@ -138,7 +138,7 @@ AsdfTileProvider::AsdfTileProvider(const ghoul::Dictionary& dictionary) :
|
||||
_startTime(StartTimeInfo),
|
||||
_resolution(ResolutionInfo, 4096, 256, OpenGLCap.max2DTextureSize()),
|
||||
_color(ColorInfo, glm::vec3(1.f), glm::vec3(1.f), glm::vec3(1.f)),
|
||||
_lineWidth(LineWidthInfo, 10.f, 1.f, 250.f),
|
||||
_lineWidth(LineWidthInfo, 10.f, 1.f, 1000.f),
|
||||
_renderFullAsdf(RenderFullAsdfInfo, false),
|
||||
_renderingMode(RenderingModeInfo,
|
||||
openspace::properties::OptionProperty::DisplayType::Dropdown),
|
||||
|
||||
Reference in New Issue
Block a user