diff --git a/data/assets/scene/solarsystem/planets/saturn/saturn.asset b/data/assets/scene/solarsystem/planets/saturn/saturn.asset index 5b92978410..7a7ee11ee4 100644 --- a/data/assets/scene/solarsystem/planets/saturn/saturn.asset +++ b/data/assets/scene/solarsystem/planets/saturn/saturn.asset @@ -41,7 +41,7 @@ local Saturn = { TextureUnlit = texturesPath .. "unlit_original_single.png", TextureColor = texturesPath .. "color_original_single.png", TextureTransparency = texturesPath .. "trans_original_single.png", - ColorFilter = 0.8, + ColorFilter = 0.9, NightFactor = 1.0, Size = 140445000, diff --git a/modules/globebrowsing/shaders/advanced_rings_fs.glsl b/modules/globebrowsing/shaders/advanced_rings_fs.glsl index c5fc9617db..c77c489c12 100644 --- a/modules/globebrowsing/shaders/advanced_rings_fs.glsl +++ b/modules/globebrowsing/shaders/advanced_rings_fs.glsl @@ -73,14 +73,14 @@ Fragment getFragment() { vec4 colorBckwrd = texture(ringTextureBckwrd, texCoord); vec4 colorFwrd = texture(ringTextureFwrd, texCoord); vec4 colorMult = texture(ringTextureColor, texCoord); - vec4 transparency = texture(ringTextureTransparency, texCoord); + float transparency = 1.0 - texture(ringTextureTransparency, texCoord).r; float lerpFactor = dot(camPositionObj, sunPositionObj); // Jon Colors: //vec4 diffuse = mix(colorFwrd * vec4(1, 0.88, 0.82, 1.0), colorBckwrd * vec4(1, 0.88, 0.82, 1.0), lerpFactor); vec4 diffuse = mix(colorFwrd, colorBckwrd, lerpFactor) * colorMult; - diffuse.a = colorFilterValue * transparency.a; + diffuse.a = colorFilterValue * transparency; float colorValue = length(diffuse.rgb) / 0.57735026919; if (colorValue < 0.001) { discard; @@ -106,7 +106,7 @@ Fragment getFragment() { sum += textureProjOffset(shadowMapTexture, normalizedShadowCoords, ivec2( NSSamples - #{i}, NSSamples - #{i})); #endfor sum += textureProjOffset(shadowMapTexture, normalizedShadowCoords, ivec2(0, 0)); - shadow = clamp(sum / (8.0 * NSSamples + 1.f), 0.35, 1.0); + shadow = clamp(sum / (8.0 * NSSamples + 1.f), 0.05, 1.0); } // The normal for the one plane depends on whether we are dealing @@ -126,6 +126,7 @@ Fragment getFragment() { frag.color = diffuse * shadow; frag.color.a *= opacity; + frag.color.a += (1.0 - shadow) * 0.5; frag.depth = vs_screenSpaceDepth; frag.gPosition = vec4(1e30, 1e30, 1e30, 1.0); frag.gNormal = vec4(normal, 1.0); diff --git a/modules/globebrowsing/shaders/renderer_fs.glsl b/modules/globebrowsing/shaders/renderer_fs.glsl index d19ba775e0..02fb64c6a3 100644 --- a/modules/globebrowsing/shaders/renderer_fs.glsl +++ b/modules/globebrowsing/shaders/renderer_fs.glsl @@ -329,6 +329,8 @@ Fragment getFragment() { } #endif // USE_RING_SHADOWS + + // Blend the light color passing thru the rings with the pre-shaded color frag.color.rgb = mix(preShadedColor * lightColor * ambientIntensity, frag.color.rgb, shadow); #endif // SHADOW_MAPPING_ENABLED diff --git a/modules/globebrowsing/src/renderableglobe.cpp b/modules/globebrowsing/src/renderableglobe.cpp index 61555fd112..5b0729e123 100644 --- a/modules/globebrowsing/src/renderableglobe.cpp +++ b/modules/globebrowsing/src/renderableglobe.cpp @@ -1232,8 +1232,8 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&, _globalRenderer.program->setIgnoreUniformLocationError(IgnoreError::No); } - glm::mat4 modelViewTransform = glm::mat4(viewTransform * _cachedModelTransform); - glm::mat4 modelViewProjectionTransform = + const glm::mat4 modelViewTransform = glm::mat4(viewTransform * _cachedModelTransform); + const glm::mat4 modelViewProjectionTransform = data.camera.sgctInternal.projectionMatrix() * modelViewTransform; // Upload the uniform variables @@ -1283,18 +1283,6 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&, ); } - modelViewTransform = glm::mat4(viewTransform * _cachedModelTransform); - modelViewProjectionTransform = - data.camera.sgctInternal.projectionMatrix() * modelViewTransform; - - // Upload the uniform variables - _localRenderer.program->setUniform( - "modelViewProjectionTransform", - modelViewProjectionTransform - ); - - _localRenderer.program->setUniform("modelViewTransform", modelViewTransform); - if (_useAccurateNormals && hasHeightLayer) { // Apply an extra scaling to the height if the object is scaled _localRenderer.program->setUniform(