diff --git a/modules/digitaluniverse/shaders/billboard_fs.glsl b/modules/digitaluniverse/shaders/billboard_fs.glsl index ccc7e29982..8772121d17 100644 --- a/modules/digitaluniverse/shaders/billboard_fs.glsl +++ b/modules/digitaluniverse/shaders/billboard_fs.glsl @@ -62,6 +62,8 @@ Fragment getFragment() { Fragment frag; frag.color = fullColor; frag.depth = vs_screenSpaceDepth; + // Setting the position of the billboards to not interact + // with the ATM. frag.gPosition = vec4(-1e32, -1e32, -1e32, 1.0); frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0); diff --git a/modules/digitaluniverse/shaders/billboard_gs.glsl b/modules/digitaluniverse/shaders/billboard_gs.glsl index 0b0dd8a514..a252051069 100644 --- a/modules/digitaluniverse/shaders/billboard_gs.glsl +++ b/modules/digitaluniverse/shaders/billboard_gs.glsl @@ -30,7 +30,7 @@ layout(points) in; layout(triangle_strip, max_vertices = 4) out; uniform float scaleFactor; -uniform dvec3 up; +uniform dvec3 up; uniform dvec3 right; uniform dvec3 cameraPosition; // in world space (no SGCT View was considered) uniform dvec3 cameraLookUp; // in world space (no SGCT View was considered) @@ -83,6 +83,7 @@ void main() { } else if (pos.w == 5.f) { unit = 1E9 * PARSEC; } else if (pos.w == 6.f) { + // Convertion factor from Parsecs to GigalightYears unit = 306391534.73091 * PARSEC; } @@ -152,6 +153,7 @@ void main() { initialPosition = z_normalization(vec4(cameraViewProjectionMatrix * dvec4(dpos.xyz - scaledRight - scaledUp, dpos.w))); + vs_screenSpaceDepth = initialPosition.w; secondPosition = z_normalization(vec4(cameraViewProjectionMatrix * dvec4(dpos.xyz + scaledRight - scaledUp, dpos.w))); crossCorner = z_normalization(vec4(cameraViewProjectionMatrix * @@ -173,6 +175,5 @@ void main() { texCoord = corners[1]; gl_Position = secondPosition; EmitVertex(); - EndPrimitive(); - + EndPrimitive(); } \ No newline at end of file