mirror of
https://github.com/openglobus/openglobus.git
synced 2025-12-08 19:25:27 +00:00
926 wip. semitransparent atmosphere
This commit is contained in:
parent
c02247c954
commit
2a4add16da
@ -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() {
|
||||
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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++) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user