Skip to content

Commit

Permalink
Merge pull request #10263 from CesiumGS/lambert-test-fix
Browse files Browse the repository at this point in the history
Adds lighting to lambertDiffuseMultiplier spec
  • Loading branch information
lilleyse authored Apr 1, 2022
2 parents 6bd7a3b + 02eab72 commit 836a1d0
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions Specs/Scene/GlobeSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { Color } from "../../Source/Cesium.js";
import { Cartesian3 } from "../../Source/Cesium.js";
import { HeadingPitchRoll } from "../../Source/Cesium.js";
import { NearFarScalar } from "../../Source/Cesium.js";
import { JulianDate } from "../../Source/Cesium.js";
import createScene from "../createScene.js";
import pollToPromise from "../pollToPromise.js";

Expand Down Expand Up @@ -265,6 +266,10 @@ describe(
});

it("renders terrain with enableLighting", function () {
const renderOptions = {
scene: scene,
time: new JulianDate(2557522.0),
};
globe.enableLighting = true;

const layerCollection = globe.imageryLayers;
Expand Down Expand Up @@ -306,15 +311,19 @@ describe(
});

return updateUntilDone(globe).then(function () {
expect(scene).notToRender([0, 0, 0, 255]);
expect(renderOptions).notToRender([0, 0, 0, 255]);

scene.globe.show = false;
expect(scene).toRender([0, 0, 0, 255]);
expect(renderOptions).toRender([0, 0, 0, 255]);
});
});
});

it("renders terrain with lambertDiffuseMultiplier", function () {
const renderOptions = {
scene: scene,
time: new JulianDate(2557522.0),
};
globe.enableLighting = true;

const layerCollection = globe.imageryLayers;
Expand Down Expand Up @@ -357,14 +366,12 @@ describe(

return updateUntilDone(globe).then(function () {
let initialRgba;
expect(scene).toRenderAndCall(function (rgba) {
expect(renderOptions).toRenderAndCall(function (rgba) {
initialRgba = rgba;
expect(initialRgba).not.toEqual([0, 0, 0, 255]);
expect(renderOptions).notToRender([0, 0, 0, 255]);
});
globe.lambertDiffuseMultiplier = 10.0;
expect(scene).toRenderAndCall(function (rgba) {
expect(rgba).not.toEqual(initialRgba);
});
expect(renderOptions).notToRender(initialRgba);
});
});
});
Expand Down

0 comments on commit 836a1d0

Please sign in to comment.