Skip to content

Commit

Permalink
Add small tolerance to rendering specs
Browse files Browse the repository at this point in the history
  • Loading branch information
ggetz committed Sep 3, 2024
1 parent 90917e5 commit a108a5a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion packages/engine/Specs/Scene/PostProcessStageCollectionSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,20 @@ describe(
scene.primitives.add(new ViewportPrimitive(fs));

// validate we start by rendering the expected color
expect(scene).withContext(`without HDR`).toRender(inputColorRgb);
expect(scene)
.withContext(`without HDR`)
.toRenderAndCall((rgba) => {
expect(rgba[0])
.withContext("r")
.toEqualEpsilon(inputColorRgb[0], 1);
expect(rgba[1])
.withContext("g")
.toEqualEpsilon(inputColorRgb[1], 1);
expect(rgba[2])
.withContext("b")
.toEqualEpsilon(inputColorRgb[2], 1);
expect(rgba[3]).withContext("a").toEqual(inputColorRgb[3]);
});
// toggle HDR on
scene.highDynamicRange = true;
// validate we render a DIFFERENT color, not black, and that it matches the expected color
Expand Down

0 comments on commit a108a5a

Please sign in to comment.