From 8ae817f2339bfac5bf5f557362cac42e68559ff8 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 19 Feb 2021 13:48:23 +0100 Subject: [PATCH] Fix coding style issues --- .../shaders/advanced_rings_fs.glsl | 3 ++- modules/globebrowsing/shaders/rings_fs.glsl | 2 +- modules/globebrowsing/shaders/rings_vs.glsl | 2 +- modules/globebrowsing/src/ringscomponent.cpp | 20 ++++++++++--------- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/modules/globebrowsing/shaders/advanced_rings_fs.glsl b/modules/globebrowsing/shaders/advanced_rings_fs.glsl index 6f5b0ca005..e6ddd8bd7b 100644 --- a/modules/globebrowsing/shaders/advanced_rings_fs.glsl +++ b/modules/globebrowsing/shaders/advanced_rings_fs.glsl @@ -85,8 +85,9 @@ Fragment getFragment() { vec4 diffuse = mix(colorFwrd * colorMult, colorBckwrd * colorMult, lerpFactor); diffuse.a = colorFilterValue * transparency.a; float colorValue = length(diffuse.rgb) / 0.57735026919; - if (colorValue < 0.1) + if (colorValue < 0.1) { discard; + } // shadow == 1.0 means it is not in shadow float shadow = 1.0; diff --git a/modules/globebrowsing/shaders/rings_fs.glsl b/modules/globebrowsing/shaders/rings_fs.glsl index d30125c3c9..d3fb2bc9e4 100644 --- a/modules/globebrowsing/shaders/rings_fs.glsl +++ b/modules/globebrowsing/shaders/rings_fs.glsl @@ -125,4 +125,4 @@ Fragment getFragment() { frag.gNormal = vec4(normal, 1.0); return frag; -} \ No newline at end of file +} diff --git a/modules/globebrowsing/shaders/rings_vs.glsl b/modules/globebrowsing/shaders/rings_vs.glsl index a810f4fa2b..8b43a60571 100644 --- a/modules/globebrowsing/shaders/rings_vs.glsl +++ b/modules/globebrowsing/shaders/rings_vs.glsl @@ -50,4 +50,4 @@ void main() { shadowCoords = vec4(shadowMatrix * dvec4(in_position, 0.0, 1.0)); vs_screenSpaceDepth = positionClipSpaceZNorm.w; gl_Position = positionClipSpaceZNorm; -} \ No newline at end of file +} diff --git a/modules/globebrowsing/src/ringscomponent.cpp b/modules/globebrowsing/src/ringscomponent.cpp index c9d11c4483..418a96461b 100644 --- a/modules/globebrowsing/src/ringscomponent.cpp +++ b/modules/globebrowsing/src/ringscomponent.cpp @@ -562,7 +562,8 @@ void RingsComponent::draw(const RenderData& data, glEnablei(GL_BLEND, 0); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - } else { + } + else { _shader->setUniform( _uniformCache.modelViewProjectionMatrix, modelViewProjectionTransform @@ -880,14 +881,14 @@ void RingsComponent::compileShadowShader() { try { global::renderEngine->removeRenderProgram(_shader.get()); - /* _shader = global::renderEngine->buildRenderProgram( - "RingsProgram", - absPath("${MODULE_GLOBEBROWSING}/shaders/rings_vs.glsl"), - absPath("${MODULE_GLOBEBROWSING}/shaders/rings_fs.glsl"), - dict - ); + // _shader = global::renderEngine->buildRenderProgram( + // "RingsProgram", + // absPath("${MODULE_GLOBEBROWSING}/shaders/rings_vs.glsl"), + // absPath("${MODULE_GLOBEBROWSING}/shaders/rings_fs.glsl"), + // dict + // ); - ghoul::opengl::updateUniformLocations(*_shader, _uniformCache, UniformNames);*/ + // ghoul::opengl::updateUniformLocations(*_shader, _uniformCache, UniformNames); // Uses multiple textures for the Rings // See https://bjj.mmedia.is/data/s_rings/index.html for theory behind it @@ -905,7 +906,8 @@ void RingsComponent::compileShadowShader() { UniformNamesAdvancedRings ); } - else { // Uses simple texture for the Rings + else { + // Uses simple texture for the Rings _shader = global::renderEngine->buildRenderProgram( "RingsProgram", absPath("${MODULE_GLOBEBROWSING}/shaders/rings_vs.glsl"),