diff --git a/modules/core/src/passes/layers-pass.ts b/modules/core/src/passes/layers-pass.ts index 635995e3c59..ba6b4c05f26 100644 --- a/modules/core/src/passes/layers-pass.ts +++ b/modules/core/src/passes/layers-pass.ts @@ -369,7 +369,7 @@ export default class LayersPass extends Pass { modelMatrix: layerProps.modelMatrix, coordinateSystem: layerProps.coordinateSystem, coordinateOrigin: layerProps.coordinateOrigin, - autoWrapLongitude: layerProps.wrapLongitude + autoWrapLongitude: layer.wrapLongitude } satisfies ProjectProps }; diff --git a/modules/core/src/passes/shadow-pass.ts b/modules/core/src/passes/shadow-pass.ts index d7857bbb101..20ca3a7d4fb 100644 --- a/modules/core/src/passes/shadow-pass.ts +++ b/modules/core/src/passes/shadow-pass.ts @@ -88,7 +88,7 @@ export default class ShadowPass extends LayersPass { getModuleParameters(layer: Layer) { return { shadow: { - viewport: layer.context.viewport, + viewport: null, // will be populated by LayersPass at render time drawToShadowMap: true } }; diff --git a/test/modules/core/effects/lighting-effect.spec.ts b/test/modules/core/effects/lighting-effect.spec.ts index 1dc9c0db671..bd689404293 100644 --- a/test/modules/core/effects/lighting-effect.spec.ts +++ b/test/modules/core/effects/lighting-effect.spec.ts @@ -62,16 +62,16 @@ test('LightingEffect#getModuleParameters', t => { pixelRatio: 1 }); - const {lightSources} = lightingEffect.getModuleParameters(layer); - t.is(lightSources.pointLights.length, 2, 'Lights are exported'); + const {lighting} = lightingEffect.getModuleParameters(layer); + t.is(lighting.pointLights.length, 2, 'Lights are exported'); t.ok( - equals(lightSources.pointLights[0].position, [0, 0, 0.018310546875]), + equals(lighting.pointLights[0].position, [0, 0, 0.018310546875]), 'Camera light projection is ok' ); - t.deepEqual(lightSources.pointLights[1].color, [255, 0, 0], 'point light color is ok'); + t.deepEqual(lighting.pointLights[1].color, [255, 0, 0], 'point light color is ok'); - t.equal(lightSources.ambientLight, undefined, 'Lighting effect getGLParameters is ok'); - t.deepEqual(lightSources.directionalLights, [], 'Lighting effect getGLParameters is ok'); + t.equal(lighting.ambientLight, undefined, 'Lighting effect getGLParameters is ok'); + t.deepEqual(lighting.directionalLights, [], 'Lighting effect getGLParameters is ok'); lightingEffect.cleanup(effectContext); layerManager.finalize(); diff --git a/test/modules/core/passes/layers-pass.spec.ts b/test/modules/core/passes/layers-pass.spec.ts index ce6c19e175b..171f91ad6cd 100644 --- a/test/modules/core/passes/layers-pass.spec.ts +++ b/test/modules/core/passes/layers-pass.spec.ts @@ -308,7 +308,9 @@ test('LayersPass#GLViewport', t => { target: framebuffer, viewport: {}, moduleParameters: { - devicePixelRatio: 2 + project: { + devicePixelRatio: 2 + } }, expectedGLViewport: [0, 98, 2, 2] }, @@ -329,7 +331,9 @@ test('LayersPass#GLViewport', t => { target: framebuffer, viewport: {x: 5, y: 10, width: 30, height: 30}, moduleParameters: { - devicePixelRatio: 2 + project: { + devicePixelRatio: 2 + } }, expectedGLViewport: [10, 20, 60, 60] } diff --git a/test/modules/core/passes/shadow-pass.spec.ts b/test/modules/core/passes/shadow-pass.spec.ts index e648e23c588..0bd5444fcab 100644 --- a/test/modules/core/passes/shadow-pass.spec.ts +++ b/test/modules/core/passes/shadow-pass.spec.ts @@ -66,7 +66,7 @@ test('ShadowPass#getModuleParameters', t => { const shadowPass = new ShadowPass(device, {pixelRatio: 1.0}); const moduleParameters = shadowPass.getModuleParameters(layer); - t.equal(moduleParameters.drawToShadowMap, true, `ShadowPass has module parameters`); + t.equal(moduleParameters.shadow.drawToShadowMap, true, `ShadowPass has module parameters`); shadowPass.delete(); t.end(); }); diff --git a/test/modules/extensions/collision-filter/collision-filter-effect.spec.ts b/test/modules/extensions/collision-filter/collision-filter-effect.spec.ts index 3635178d6d6..e1cd9c70312 100644 --- a/test/modules/extensions/collision-filter/collision-filter-effect.spec.ts +++ b/test/modules/extensions/collision-filter/collision-filter-effect.spec.ts @@ -117,20 +117,20 @@ test('CollisionFilterEffect#update', t => { }; preRenderWithLayers([TEST_LAYER], 'Initial render'); - let parameters = collisionFilterEffect.getModuleParameters(TEST_LAYER); + let parameters = collisionFilterEffect.getModuleParameters(TEST_LAYER).collision; t.ok(parameters.collisionFBO, 'collision map is in parameters'); t.ok(parameters.dummyCollisionMap, 'dummy collision map is in parameters'); preRenderWithLayers([TEST_LAYER, TEST_LAYER_2], 'Add second collision layer'); - parameters = collisionFilterEffect.getModuleParameters(TEST_LAYER); + parameters = collisionFilterEffect.getModuleParameters(TEST_LAYER).collision; t.ok(parameters.collisionFBO, 'collision map is in parameters'); t.ok(parameters.dummyCollisionMap, 'dummy collision map is in parameters'); - parameters = collisionFilterEffect.getModuleParameters(TEST_LAYER_2); + parameters = collisionFilterEffect.getModuleParameters(TEST_LAYER_2).collision; t.ok(parameters.collisionFBO, 'collision map is in parameters'); t.ok(parameters.dummyCollisionMap, 'dummy collision map is in parameters'); preRenderWithLayers([TEST_LAYER_2], 'Remove first layer'); - parameters = collisionFilterEffect.getModuleParameters(TEST_LAYER_2); + parameters = collisionFilterEffect.getModuleParameters(TEST_LAYER_2).collision; t.ok(parameters.collisionFBO, 'collision map is in parameters'); t.ok(parameters.dummyCollisionMap, 'dummy collision map is in parameters'); @@ -138,10 +138,10 @@ test('CollisionFilterEffect#update', t => { [TEST_LAYER_2, TEST_LAYER_DIFFERENT_GROUP], 'Add layer with different collision group' ); - parameters = collisionFilterEffect.getModuleParameters(TEST_LAYER_2); + parameters = collisionFilterEffect.getModuleParameters(TEST_LAYER_2).collision; t.ok(parameters.collisionFBO, 'collision map is in parameters'); t.ok(parameters.dummyCollisionMap, 'dummy collision map is in parameters'); - parameters = collisionFilterEffect.getModuleParameters(TEST_LAYER_DIFFERENT_GROUP); + parameters = collisionFilterEffect.getModuleParameters(TEST_LAYER_DIFFERENT_GROUP).collision; t.ok(parameters.collisionFBO, 'collision map is in parameters'); t.ok(parameters.dummyCollisionMap, 'dummy collision map is in parameters'); diff --git a/test/modules/extensions/collision-filter/collision-filter-pass.spec.ts b/test/modules/extensions/collision-filter/collision-filter-pass.spec.ts index 5eb25354b36..1ddae91767b 100644 --- a/test/modules/extensions/collision-filter/collision-filter-pass.spec.ts +++ b/test/modules/extensions/collision-filter/collision-filter-pass.spec.ts @@ -12,7 +12,7 @@ test('CollisionFilterPass#getModuleParameters', t => { const moduleParameters = collisionFilterPass.getModuleParameters(); t.equal( - moduleParameters.drawToCollisionMap, + moduleParameters.collision.drawToCollisionMap, true, `CollisionFilterPass has drawToCollisionMap module parameter` ); @@ -27,7 +27,7 @@ test('CollisionFilterPass#getModuleParameters', t => { `CollisionFilterPass has picking.isAttribute module parameter` ); t.deepEqual( - moduleParameters.lightSources, + moduleParameters.lighting, {enabled: false}, `CollisionFilterPass disables lighting module` ); diff --git a/test/modules/extensions/mask/mask-effect.spec.ts b/test/modules/extensions/mask/mask-effect.spec.ts index 0a2ee55673b..3e898166319 100644 --- a/test/modules/extensions/mask/mask-effect.spec.ts +++ b/test/modules/extensions/mask/mask-effect.spec.ts @@ -95,7 +95,7 @@ test('MaskEffect#update', t => { preRenderWithLayers([TEST_MASK_LAYER, TEST_LAYER], 'Initial render'); - let parameters = maskEffect.getModuleParameters(TEST_LAYER); + let parameters = maskEffect.getModuleParameters(TEST_LAYER).mask; t.is(parameters.maskMap, maskEffect.maskMap, 'Mask map is in parameters'); let mask = parameters.maskChannels['test-mask-layer']; t.is(mask?.index, 0, 'Mask is rendered in channel 0'); @@ -104,7 +104,7 @@ test('MaskEffect#update', t => { preRenderWithLayers([TEST_MASK_LAYER, TEST_LAYER, TEST_MASK_LAYER2], 'Add second mask'); - parameters = maskEffect.getModuleParameters(TEST_LAYER); + parameters = maskEffect.getModuleParameters(TEST_LAYER).mask; mask = parameters.maskChannels['test-mask-layer']; t.is(mask?.index, 0, 'Mask is rendered in channel 0'); t.is(mask?.bounds, bounds, 'Using cached mask bounds'); @@ -115,7 +115,7 @@ test('MaskEffect#update', t => { preRenderWithLayers([TEST_LAYER, TEST_MASK_LAYER2], 'Remove first mask'); - parameters = maskEffect.getModuleParameters(TEST_LAYER); + parameters = maskEffect.getModuleParameters(TEST_LAYER).mask; mask = parameters.maskChannels['test-mask-layer']; t.notOk(mask, 'Mask is removed'); mask = parameters.maskChannels['test-mask-layer-2']; @@ -127,7 +127,7 @@ test('MaskEffect#update', t => { 'Update second mask, add third' ); - parameters = maskEffect.getModuleParameters(TEST_LAYER); + parameters = maskEffect.getModuleParameters(TEST_LAYER).mask; mask = parameters.maskChannels['test-mask-layer-2']; t.is(mask?.index, 1, 'Second mask is rendered in channel 1'); t.not(mask?.bounds, bounds, 'Second mask is updated');