From 3051d71fea98591bf26eeae27b4564402da7e112 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Tue, 17 Dec 2019 11:05:14 +0100 Subject: [PATCH] Small code cleanup --- .../digitaluniverse/shaders/billboard_fs.glsl | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/modules/digitaluniverse/shaders/billboard_fs.glsl b/modules/digitaluniverse/shaders/billboard_fs.glsl index 0db1fa3fe4..90fe9d0696 100644 --- a/modules/digitaluniverse/shaders/billboard_fs.glsl +++ b/modules/digitaluniverse/shaders/billboard_fs.glsl @@ -35,12 +35,11 @@ uniform sampler2D spriteTexture; uniform bool hasColorMap; uniform float fadeInValue; -Fragment getFragment() { - +Fragment getFragment() { vec4 textureColor = texture(spriteTexture, texCoord); - if (textureColor.a == 0.f || gs_colorMap.a == 0.f || - ta == 0.f || fadeInValue == 0.f) { + if (textureColor.a == 0.f || gs_colorMap.a == 0.f || ta == 0.f || fadeInValue == 0.f) + { discard; } @@ -48,10 +47,11 @@ Fragment getFragment() { if (hasColorMap) { fullColor = vec4( - gs_colorMap.rgb * textureColor.rgb, + gs_colorMap.rgb * textureColor.rgb, gs_colorMap.a * textureColor.a * alphaValue - ); - } else { + ); + } + else { fullColor = vec4(color.rgb * textureColor.rgb, textureColor.a * alphaValue); } @@ -63,14 +63,13 @@ Fragment getFragment() { } Fragment frag; - frag.color = fullColor; - frag.depth = vs_screenSpaceDepth; + 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); + frag.gPosition = vec4(-1e32, -1e32, -1e32, 1.0); + frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0); //frag.disableLDR2HDR = true; - return frag; -} \ No newline at end of file +}