diff --git a/src/control/SimpleSkyBackground.ts b/src/control/SimpleSkyBackground.ts index a62d326e..f9983dae 100644 --- a/src/control/SimpleSkyBackground.ts +++ b/src/control/SimpleSkyBackground.ts @@ -55,12 +55,12 @@ export class SimpleSkyBackground extends Control { public override onactivate() { super.onactivate(); - this.planet!.events.on("draw", this._drawBackground, this); + //this.planet!.events.on("draw", this._drawBackground, this); } public override ondeactivate() { super.ondeactivate(); - this.planet!.events.off("draw", this._drawBackground); + //this.planet!.events.off("draw", this._drawBackground); } protected _drawBackground() { diff --git a/src/control/atmosphere/Atmosphere.ts b/src/control/atmosphere/Atmosphere.ts index 7e16c0a8..e2aae9a5 100644 --- a/src/control/atmosphere/Atmosphere.ts +++ b/src/control/atmosphere/Atmosphere.ts @@ -253,6 +253,8 @@ export class Atmosphere extends Control { gl.disable(gl.DEPTH_TEST); + r.enableBlendOneSrcAlpha(); + sh.activate(); gl.bindBuffer(gl.ARRAY_BUFFER, r.screenFramePositionBuffer!); gl.vertexAttribPointer(p.attributes.corners, 2, gl.FLOAT, false, 0, 0); @@ -277,6 +279,8 @@ export class Atmosphere extends Control { gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4); gl.enable(gl.DEPTH_TEST); + + r.enableBlendDefault(); } } diff --git a/src/control/atmosphere/atmosphere.frag.glsl b/src/control/atmosphere/atmosphere.frag.glsl index d6d0d89b..75976997 100644 --- a/src/control/atmosphere/atmosphere.frag.glsl +++ b/src/control/atmosphere/atmosphere.frag.glsl @@ -180,7 +180,7 @@ void mainImage(out vec4 fragColor) light += sunLum * SUN_INTENSITY * transmittanceFromCameraToSpace; } - fragColor = vec4(pow(light * 8.0, vec3(1.0 / 2.2)), clamp(opacity, 0.0, 1.0)); + fragColor = vec4(pow(light * 8.0, vec3(1.0 / 2.2)), length(light) * clamp(opacity, 0.0, 1.0)); } void main(void) diff --git a/src/scene/Planet.ts b/src/scene/Planet.ts index eb43b488..da311b89 100644 --- a/src/scene/Planet.ts +++ b/src/scene/Planet.ts @@ -1571,7 +1571,7 @@ export class Planet extends RenderNode { } // Here is set blending for transparent overlays - renderer.enableBlendDefault(); + //renderer.enableBlendDefault(); gl.enable(gl.POLYGON_OFFSET_FILL); for (let j = 1, len = sl.length; j < len; j++) {