Add tests for god rays source mask calculation
This commit is contained in:
@@ -157,9 +157,11 @@ import {
|
|||||||
resolveDistanceFogParameters
|
resolveDistanceFogParameters
|
||||||
} from "../../src/rendering/distance-fog-pass";
|
} from "../../src/rendering/distance-fog-pass";
|
||||||
import {
|
import {
|
||||||
|
GOD_RAYS_SOURCE_MASK_RADII,
|
||||||
createScreenSpaceGodRaysLightSource,
|
createScreenSpaceGodRaysLightSource,
|
||||||
projectScreenSpaceGodRaysLight,
|
projectScreenSpaceGodRaysLight,
|
||||||
resolveGodRaysParameters,
|
resolveGodRaysParameters,
|
||||||
|
resolveGodRaysSourceMask,
|
||||||
syncScreenSpaceGodRaysLightSource
|
syncScreenSpaceGodRaysLightSource
|
||||||
} from "../../src/rendering/screen-space-god-rays";
|
} from "../../src/rendering/screen-space-god-rays";
|
||||||
import { resolveDynamicGlobalIlluminationParameters } from "../../src/rendering/screen-space-global-illumination";
|
import { resolveDynamicGlobalIlluminationParameters } from "../../src/rendering/screen-space-global-illumination";
|
||||||
@@ -434,6 +436,17 @@ describe("god rays parameters", () => {
|
|||||||
})
|
})
|
||||||
).toBeNull();
|
).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("keeps the source mask compact around the celestial disc", () => {
|
||||||
|
expect(resolveGodRaysSourceMask(0)).toBe(1);
|
||||||
|
expect(
|
||||||
|
resolveGodRaysSourceMask(GOD_RAYS_SOURCE_MASK_RADII.coreOuter)
|
||||||
|
).toBeGreaterThan(0.5);
|
||||||
|
expect(resolveGodRaysSourceMask(0.035)).toBeLessThan(0.5);
|
||||||
|
expect(
|
||||||
|
resolveGodRaysSourceMask(GOD_RAYS_SOURCE_MASK_RADII.haloOuter)
|
||||||
|
).toBe(0);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("createAdvancedRenderingComposer", () => {
|
describe("createAdvancedRenderingComposer", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user