Skip to content

Commit

Permalink
Update unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrgags committed Jan 18, 2024
1 parent 3a25627 commit ab97280
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 75 deletions.
2 changes: 1 addition & 1 deletion packages/engine/Source/Shaders/SkyAtmosphereFS.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void main (void)
#endif

#ifdef COLOR_CORRECT
const float ignoreBlackPixels = true;
const bool ignoreBlackPixels = true;
color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels);
#endif

Expand Down
73 changes: 0 additions & 73 deletions packages/engine/Specs/Scene/AtmosphereSpec.js

This file was deleted.

23 changes: 22 additions & 1 deletion packages/engine/Specs/Scene/SceneSpec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
Atmosphere,
BoundingSphere,
Cartesian2,
Cartesian3,
Expand Down Expand Up @@ -577,7 +578,7 @@ describe(
});
});

it("renders sky atmopshere without a globe", function () {
it("renders sky atmosphere without a globe", function () {
s.globe = new Globe(Ellipsoid.UNIT_SPHERE);
s.globe.show = false;
s.camera.position = new Cartesian3(1.02, 0.0, 0.0);
Expand Down Expand Up @@ -2471,6 +2472,26 @@ describe(
scene.destroyForSpecs();
});
});

it("updates frameState.atmosphere", function () {
const scene = createScene();
const frameState = scene.frameState;

// Before the first render, the atmosphere has not yet been set
expect(frameState.atmosphere).toBeUndefined();

// On the first render, the atmosphere settings are propagated to the
// frame state
const originalAtmosphere = scene.atmosphere;
scene.renderForSpecs();
expect(frameState.atmosphere).toBe(originalAtmosphere);

// If we change the atmosphere to a new object
const anotherAtmosphere = new Atmosphere();
scene.atmosphere = anotherAtmosphere;
scene.renderForSpecs();
expect(frameState.atmosphere).toBe(anotherAtmosphere);
});
},

"WebGL"
Expand Down

0 comments on commit ab97280

Please sign in to comment.