New fast AA for lines is working.

This commit is contained in:
Jonathas Costa
2019-08-23 16:56:30 -04:00
parent ac24a1bb56
commit 5708bf8416
2 changed files with 5 additions and 9 deletions

View File

@@ -178,7 +178,7 @@ RenderableTrail::Appearance::Appearance()
, lineColor(LineColorInfo, glm::vec3(1.0f, 1.0f, 0.f), glm::vec3(0.f), glm::vec3(1.f))
, useLineFade(EnableFadeInfo, true)
, lineFade(FadeInfo, 1.f, 0.f, 30.f)
, lineWidth(LineWidthInfo, 2.f, 1.f, 20.f)
, lineWidth(LineWidthInfo, 10.f, 1.f, 20.f)
, pointSize(PointSizeInfo, 1, 1, 64)
, renderingModes(
RenderingModeInfo,

View File

@@ -27,7 +27,7 @@
in float vs_positionDepth;
in vec4 vs_gPosition;
in float fade;
in vec2 mathLine;
noperspective in vec2 mathLine;
uniform vec3 color;
uniform int renderPhase;
@@ -63,18 +63,14 @@ Fragment getFragment() {
double distanceCenter = length(mathLine - vec2(gl_FragCoord.xy));
double dLW = double(lineWidth);
float blendFactor = 1.5;
float blendFactor = 20;
if (distanceCenter > dLW) {
frag.color = vec4(1.0, 0.0, 0.0, 1.0);
//frag.color.a = 0;
frag.color.a = 0.0;
} else {
frag.color.a *= pow(float((dLW - distanceCenter) / dLW), blendFactor);
//frag.color.a = 1.0;
}
// if (distanceCenter > 3.0)
// frag.color = vec4(0.0, 1.0, 0.0, 1.0);
frag.gPosition = vs_gPosition;
// There is no normal here