diff --git a/docs/api-reference/core/project.md b/docs/api-reference/core/project.md index a577862ebdb..12fa7fe486e 100644 --- a/docs/api-reference/core/project.md +++ b/docs/api-reference/core/project.md @@ -151,6 +151,6 @@ Returns a matrix that rotates any vector defined in the default common space to ## Remarks -* For consistent results, the screen space pixels are logical pixels, not device pixels, i.e. functions in the project module multiply `pixels` with `project_uDevicePixelRatio`. +* For consistent results, the screen space pixels are logical pixels, not device pixels, i.e. functions in the project module multiply `pixels` with `project.devicePixelRatio`. * The pixels offsets will be divided by the `w` coordinate of `gl_Position`. This is simply the GPUs standard treatment of any coordinate. This means that there will be more pixels closer to the camera and less pixels further away from the camer. Setting the `focalDistance` uniform controls this. * To avoid pixel sizes scaling with distance from camera, simply set `focalDistance` to 1 and multiply clipspace offset with `gl_Position.w` diff --git a/docs/api-reference/core/project64.md b/docs/api-reference/core/project64.md index cacac9427c9..b6db4da5e39 100644 --- a/docs/api-reference/core/project64.md +++ b/docs/api-reference/core/project64.md @@ -5,7 +5,7 @@ The `project64` shader module is an extension of the [project](./project.md) sha ## getUniforms -The uniforms needed by `project64` are extracted from the `project` module uniforms `project_uViewProjectionMatrix` and `project_uScale`. +The uniforms needed by `project64` are extracted from the `project` module uniforms `project.viewProjectionMatrix` and `project.scale`. ## GLSL Uniforms diff --git a/docs/developer-guide/custom-layers/subclassed-layers.md b/docs/developer-guide/custom-layers/subclassed-layers.md index 0e41e77b8d3..c904e67e510 100644 --- a/docs/developer-guide/custom-layers/subclassed-layers.md +++ b/docs/developer-guide/custom-layers/subclassed-layers.md @@ -225,7 +225,7 @@ void main(void) { /* replaced uniform 'radiusPixels' with 'instanceRadiusPixels' */ gl_Position.xy += project_pixel_size_to_clipspace(positions.xy * instanceRadiusPixels); - vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, position_commonspace.xyz, project_normal(instanceNormals)); + vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project.cameraPosition, position_commonspace.xyz, project_normal(instanceNormals)); vColor = vec4(lightColor, instanceColors.a * opacity) / 255.0; diff --git a/examples/experimental/bezier/src/bezier-curve-layer/bezier-curve-layer-vertex.glsl.js b/examples/experimental/bezier/src/bezier-curve-layer/bezier-curve-layer-vertex.glsl.js index 752b9c023cc..8833963311c 100644 --- a/examples/experimental/bezier/src/bezier-curve-layer/bezier-curve-layer-vertex.glsl.js +++ b/examples/experimental/bezier/src/bezier-curve-layer/bezier-curve-layer-vertex.glsl.js @@ -39,7 +39,7 @@ out vec4 vColor; // offset_direction is -1 (left) or 1 (right) vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction) { // normalized direction of the line - vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize); + vec2 dir_screenspace = normalize(line_clipspace * project.viewportSize); // rotate by 90 degrees dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x); diff --git a/examples/website/plot/plot-layer/grid-vertex.glsl.ts b/examples/website/plot/plot-layer/grid-vertex.glsl.ts index 0157906e837..6ab93932dae 100644 --- a/examples/website/plot/plot-layer/grid-vertex.glsl.ts +++ b/examples/website/plot/plot-layer/grid-vertex.glsl.ts @@ -38,7 +38,7 @@ out float shouldDiscard; // determines if the grid line is behind or in front of the center float frontFacing(vec3 v) { - vec4 v_clipspace = project_uViewProjectionMatrix * project_uModelMatrix * vec4(v, 0.0); + vec4 v_clipspace = project.viewProjectionMatrix * project.modelMatrix * vec4(v, 0.0); return step(v_clipspace.z, 0.0); } diff --git a/examples/website/plot/plot-layer/label-vertex.glsl.ts b/examples/website/plot/plot-layer/label-vertex.glsl.ts index b5b8610f3b7..b19ab0a166d 100644 --- a/examples/website/plot/plot-layer/label-vertex.glsl.ts +++ b/examples/website/plot/plot-layer/label-vertex.glsl.ts @@ -50,7 +50,7 @@ float sum3(vec3 v) { // determines if the grid line is behind or in front of the center float frontFacing(vec3 v) { - vec4 v_clipspace = project_uViewProjectionMatrix * project_uModelMatrix * vec4(v, 0.0); + vec4 v_clipspace = project.viewProjectionMatrix * project.modelMatrix * vec4(v, 0.0); return step(v_clipspace.z, 0.0); } diff --git a/modules/aggregation-layers/package.json b/modules/aggregation-layers/package.json index ac39858eb1d..4148bff5edc 100644 --- a/modules/aggregation-layers/package.json +++ b/modules/aggregation-layers/package.json @@ -38,8 +38,8 @@ "prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev" }, "dependencies": { - "@luma.gl/constants": "^9.0.11", - "@luma.gl/shadertools": "^9.0.11", + "@luma.gl/constants": "^9.0.12", + "@luma.gl/shadertools": "^9.0.12", "@math.gl/web-mercator": "^4.0.0", "d3-hexbin": "^0.2.1" }, diff --git a/modules/aggregation-layers/src/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.ts b/modules/aggregation-layers/src/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.ts index ce26a2dff65..b23943364df 100644 --- a/modules/aggregation-layers/src/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.ts +++ b/modules/aggregation-layers/src/gpu-grid-layer/gpu-grid-cell-layer-vertex.glsl.ts @@ -134,7 +134,7 @@ void main(void) { vec3 normals_commonspace = project_normal(normals); if (extruded) { - vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, normals_commonspace); + vec3 lightColor = lighting_getLightColor(color.rgb, project.cameraPosition, geometry.position.xyz, normals_commonspace); vColor = vec4(lightColor, color.a * opacity) / 255.; } else { vColor = vec4(color.rgb, color.a * opacity) / 255.; diff --git a/modules/aggregation-layers/src/screen-grid-layer/screen-grid-cell-layer.ts b/modules/aggregation-layers/src/screen-grid-layer/screen-grid-cell-layer.ts index 658ec782188..9789a67cac7 100644 --- a/modules/aggregation-layers/src/screen-grid-layer/screen-grid-cell-layer.ts +++ b/modules/aggregation-layers/src/screen-grid-layer/screen-grid-cell-layer.ts @@ -20,7 +20,15 @@ import {Texture} from '@luma.gl/core'; import {Model, Geometry} from '@luma.gl/engine'; -import {Layer, LayerProps, log, picking, UpdateParameters, DefaultProps} from '@deck.gl/core'; +import { + Layer, + LayerProps, + log, + project32, + picking, + UpdateParameters, + DefaultProps +} from '@deck.gl/core'; import {defaultColorRange, colorRangeToFlatArray} from '../utils/color-utils'; import vs from './screen-grid-layer-vertex.glsl'; import fs from './screen-grid-layer-fragment.glsl'; @@ -59,7 +67,7 @@ export default class ScreenGridCellLayer extends Component< // TODO/ib - hack move to luma Model.draw if (moduleParameters) { const {isActive, isAttribute} = moduleParameters.picking; + const {viewport, devicePixelRatio, coordinateSystem, coordinateOrigin} = moduleParameters; + const {modelMatrix} = this.props; this.setModuleParameters(moduleParameters); - this.setShaderModuleProps({picking: {isActive, isAttribute}}); + this.setShaderModuleProps({ + picking: {isActive, isAttribute}, + project: {viewport, devicePixelRatio, modelMatrix, coordinateSystem, coordinateOrigin} + }); } // Apply polygon offset to avoid z-fighting diff --git a/modules/core/src/shaderlib/index.ts b/modules/core/src/shaderlib/index.ts index 06933b06bab..4569388156e 100644 --- a/modules/core/src/shaderlib/index.ts +++ b/modules/core/src/shaderlib/index.ts @@ -21,12 +21,13 @@ import {ShaderAssembler} from '@luma.gl/shadertools'; import {gouraudLighting, phongLighting} from '@luma.gl/shadertools'; +import geometry from './misc/geometry'; import project from './project/project'; import project32 from './project32/project32'; import shadow from './shadow/shadow'; import picking from './picking/picking'; -const DEFAULT_MODULES = [project]; +const DEFAULT_MODULES = [geometry]; const SHADER_HOOKS = [ 'vs:DECKGL_FILTER_SIZE(inout vec3 size, VertexGeometry geometry)', diff --git a/modules/core/src/shaderlib/project/project.glsl.ts b/modules/core/src/shaderlib/project/project.glsl.ts index 43a4bb047e6..08101286032 100644 --- a/modules/core/src/shaderlib/project/project.glsl.ts +++ b/modules/core/src/shaderlib/project/project.glsl.ts @@ -36,23 +36,26 @@ ${COORDINATE_SYSTEM_GLSL_CONSTANTS} ${PROJECTION_MODE_GLSL_CONSTANTS} ${UNIT_GLSL_CONSTANTS} -uniform int project_uCoordinateSystem; -uniform int project_uProjectionMode; -uniform float project_uScale; -uniform bool project_uWrapLongitude; -uniform vec3 project_uCommonUnitsPerMeter; -uniform vec3 project_uCommonUnitsPerWorldUnit; -uniform vec3 project_uCommonUnitsPerWorldUnit2; -uniform vec4 project_uCenter; -uniform mat4 project_uModelMatrix; -uniform mat4 project_uViewProjectionMatrix; -uniform vec2 project_uViewportSize; -uniform float project_uDevicePixelRatio; -uniform float project_uFocalDistance; -uniform vec3 project_uCameraPosition; -uniform vec3 project_uCoordinateOrigin; -uniform vec3 project_uCommonOrigin; -uniform bool project_uPseudoMeters; +uniform projectUniforms { + bool wrapLongitude; + int coordinateSystem; + vec3 commonUnitsPerMeter; + int projectionMode; + float scale; + vec3 commonUnitsPerWorldUnit; + vec3 commonUnitsPerWorldUnit2; + vec4 center; + mat4 modelMatrix; + mat4 viewProjectionMatrix; + vec2 viewportSize; + float devicePixelRatio; + float focalDistance; + vec3 cameraPosition; + vec3 coordinateOrigin; + vec3 commonOrigin; + bool pseudoMeters; +} project; + const float TILE_SIZE = 512.0; const float PI = 3.1415926536; @@ -68,9 +71,9 @@ float project_size_at_latitude(float lat) { } float project_size() { - if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR && - project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT && - project_uPseudoMeters == false) { + if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR && + project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT && + project.pseudoMeters == false) { // uCommonUnitsPerMeter in low-zoom Web Mercator is non-linear // Adjust by 1 / cos(latitude) @@ -95,7 +98,7 @@ float project_size() { } float project_size_at_latitude(float meters, float lat) { - return meters * project_uCommonUnitsPerMeter.z * project_size_at_latitude(lat); + return meters * project.commonUnitsPerMeter.z * project_size_at_latitude(lat); } // @@ -103,19 +106,20 @@ float project_size_at_latitude(float meters, float lat) { // Note the scalar version of project_size is for scaling the z component only // float project_size(float meters) { - return meters * project_uCommonUnitsPerMeter.z * project_size(); + // For scatter relevant + return meters * project.commonUnitsPerMeter.z * project_size(); } vec2 project_size(vec2 meters) { - return meters * project_uCommonUnitsPerMeter.xy * project_size(); + return meters * project.commonUnitsPerMeter.xy * project_size(); } vec3 project_size(vec3 meters) { - return meters * project_uCommonUnitsPerMeter * project_size(); + return meters * project.commonUnitsPerMeter * project_size(); } vec4 project_size(vec4 meters) { - return vec4(meters.xyz * project_uCommonUnitsPerMeter, meters.w); + return vec4(meters.xyz * project.commonUnitsPerMeter, meters.w); } // Get rotation matrix that aligns the z axis with the given up vector @@ -129,7 +133,7 @@ mat3 project_get_orientation_matrix(vec3 up) { } bool project_needs_rotation(vec3 commonPosition, out mat3 transform) { - if (project_uProjectionMode == PROJECTION_MODE_GLOBE) { + if (project.projectionMode == PROJECTION_MODE_GLOBE) { transform = project_get_orientation_matrix(commonPosition); return true; } @@ -142,8 +146,8 @@ bool project_needs_rotation(vec3 commonPosition, out mat3 transform) { // vec3 project_normal(vec3 vector) { // Apply model matrix - vec4 normal_modelspace = project_uModelMatrix * vec4(vector, 0.0); - vec3 n = normalize(normal_modelspace.xyz * project_uCommonUnitsPerMeter); + vec4 normal_modelspace = project.modelMatrix * vec4(vector, 0.0); + vec3 n = normalize(normal_modelspace.xyz * project.commonUnitsPerMeter); mat3 rotation; if (project_needs_rotation(geometry.position.xyz, rotation)) { n = rotation * n; @@ -153,7 +157,7 @@ vec3 project_normal(vec3 vector) { vec4 project_offset_(vec4 offset) { float dy = offset.y; - vec3 commonUnitsPerWorldUnit = project_uCommonUnitsPerWorldUnit + project_uCommonUnitsPerWorldUnit2 * dy; + vec3 commonUnitsPerWorldUnit = project.commonUnitsPerWorldUnit + project.commonUnitsPerWorldUnit2 * dy; return vec4(offset.xyz * commonUnitsPerWorldUnit, offset.w); } @@ -162,7 +166,7 @@ vec4 project_offset_(vec4 offset) { // vec2 project_mercator_(vec2 lnglat) { float x = lnglat.x; - if (project_uWrapLongitude) { + if (project.wrapLongitude) { x = mod(x + 180., 360.0) - 180.; } float y = clamp(lnglat.y, -89.9, 89.9); @@ -186,55 +190,55 @@ vec3 project_globe_(vec3 lnglatz) { } // -// Projects positions (defined by project_uCoordinateSystem) to common space (defined by project_uProjectionMode) +// Projects positions (defined by project.coordinateSystem) to common space (defined by project.projectionMode) // vec4 project_position(vec4 position, vec3 position64Low) { - vec4 position_world = project_uModelMatrix * position; + vec4 position_world = project.modelMatrix * position; // Work around for a Mac+NVIDIA bug https://github.com/visgl/deck.gl/issues/4145 - if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR) { - if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) { + if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR) { + if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { return vec4( project_mercator_(position_world.xy), project_size_at_latitude(position_world.z, position_world.y), position_world.w ); } - if (project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN) { - position_world.xyz += project_uCoordinateOrigin; + if (project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN) { + position_world.xyz += project.coordinateOrigin; } } - if (project_uProjectionMode == PROJECTION_MODE_GLOBE) { - if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) { + if (project.projectionMode == PROJECTION_MODE_GLOBE) { + if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { return vec4( project_globe_(position_world.xyz), position_world.w ); } } - if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) { - if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) { - if (abs(position_world.y - project_uCoordinateOrigin.y) > 0.25) { + if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) { + if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { + if (abs(position_world.y - project.coordinateOrigin.y) > 0.25) { // Too far from the projection center for offset mode to be accurate // Only use high parts return vec4( - project_mercator_(position_world.xy) - project_uCommonOrigin.xy, + project_mercator_(position_world.xy) - project.commonOrigin.xy, project_size(position_world.z), position_world.w ); } } } - if (project_uProjectionMode == PROJECTION_MODE_IDENTITY || - (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET && - (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT || - project_uCoordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) { + if (project.projectionMode == PROJECTION_MODE_IDENTITY || + (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET && + (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT || + project.coordinateSystem == COORDINATE_SYSTEM_CARTESIAN))) { // Subtract high part of 64 bit value. Convert remainder to float32, preserving precision. - position_world.xyz -= project_uCoordinateOrigin; + position_world.xyz -= project.coordinateOrigin; } // Translation is already added to the high parts - return project_offset_(position_world) + project_offset_(project_uModelMatrix * vec4(position64Low, 0.0)); + return project_offset_(position_world) + project_offset_(project.modelMatrix * vec4(position64Low, 0.0)); } vec4 project_position(vec4 position) { @@ -262,31 +266,31 @@ vec4 project_common_position_to_clipspace(vec4 position, mat4 viewProjectionMatr // // Projects from common space coordinates to clip space. -// Uses project_uViewProjectionMatrix +// Uses project.viewProjectionMatrix // vec4 project_common_position_to_clipspace(vec4 position) { - return project_common_position_to_clipspace(position, project_uViewProjectionMatrix, project_uCenter); + return project_common_position_to_clipspace(position, project.viewProjectionMatrix, project.center); } // Returns a clip space offset that corresponds to a given number of screen pixels vec2 project_pixel_size_to_clipspace(vec2 pixels) { - vec2 offset = pixels / project_uViewportSize * project_uDevicePixelRatio * 2.0; - return offset * project_uFocalDistance; + vec2 offset = pixels / project.viewportSize * project.devicePixelRatio * 2.0; + return offset * project.focalDistance; } float project_size_to_pixel(float meters) { - return project_size(meters) * project_uScale; + return project_size(meters) * project.scale; } float project_size_to_pixel(float size, int unit) { if (unit == UNIT_METERS) return project_size_to_pixel(size); - if (unit == UNIT_COMMON) return size * project_uScale; + if (unit == UNIT_COMMON) return size * project.scale; // UNIT_PIXELS return size; } float project_pixel_size(float pixels) { - return pixels / project_uScale; + return pixels / project.scale; } vec2 project_pixel_size(vec2 pixels) { - return pixels / project_uScale; + return pixels / project.scale; } `; diff --git a/modules/core/src/shaderlib/project/project.ts b/modules/core/src/shaderlib/project/project.ts index c665d840990..ba85e136ee5 100644 --- a/modules/core/src/shaderlib/project/project.ts +++ b/modules/core/src/shaderlib/project/project.ts @@ -38,5 +38,25 @@ export default { name: 'project', dependencies: [fp32, geometry], vs: projectShader, - getUniforms -} as ShaderModule; + getUniforms, + uniformTypes: { + wrapLongitude: 'f32', + coordinateSystem: 'i32', + commonUnitsPerMeter: 'vec3', + projectionMode: 'i32', + scale: 'f32', + + commonUnitsPerWorldUnit: 'vec3', + commonUnitsPerWorldUnit2: 'vec3', + center: 'vec4', + modelMatrix: 'mat4x4', + viewProjectionMatrix: 'mat4x4', + viewportSize: 'vec2', + devicePixelRatio: 'f32', + focalDistance: 'f32', + cameraPosition: 'vec3', + coordinateOrigin: 'vec3', + commonOrigin: 'vec3', + pseudoMeters: 'f32' + } +} as const satisfies ShaderModule; diff --git a/modules/core/src/shaderlib/project/viewport-uniforms.ts b/modules/core/src/shaderlib/project/viewport-uniforms.ts index bf4c3f212ff..b97ef1c4ffb 100644 --- a/modules/core/src/shaderlib/project/viewport-uniforms.ts +++ b/modules/core/src/shaderlib/project/viewport-uniforms.ts @@ -188,32 +188,32 @@ function calculateMatrixAndOffset( } export type ProjectUniforms = { - project_uCoordinateSystem: number; - project_uProjectionMode: number; - project_uCoordinateOrigin: Vec3; - project_uCommonOrigin: Vec3; - project_uCenter: Vec4; + coordinateSystem: number; + projectionMode: number; + coordinateOrigin: Vec3; + commonOrigin: Vec3; + center: Vec4; // Backward compatibility // TODO: remove in v9 - project_uPseudoMeters: boolean; + pseudoMeters: boolean; // Screen size - project_uViewportSize: [number, number]; - project_uDevicePixelRatio: number; + viewportSize: [number, number]; + devicePixelRatio: number; - project_uFocalDistance: number; - project_uCommonUnitsPerMeter: Vec3; - project_uCommonUnitsPerWorldUnit: Vec3; - project_uCommonUnitsPerWorldUnit2: Vec3; + focalDistance: number; + commonUnitsPerMeter: Vec3; + commonUnitsPerWorldUnit: Vec3; + commonUnitsPerWorldUnit2: Vec3; /** 2^zoom */ - project_uScale: number; - project_uWrapLongitude: boolean; + scale: number; + wrapLongitude: boolean; - project_uViewProjectionMatrix: NumericArray; - project_uModelMatrix: NumericArray; + viewProjectionMatrix: NumericArray; + modelMatrix: NumericArray; // This is for lighting calculations - project_uCameraPosition: Vec3; + cameraPosition: Vec3; }; export type ProjectModuleSettings = { @@ -256,8 +256,8 @@ export function getUniformsFromViewport({ coordinateOrigin }); - uniforms.project_uWrapLongitude = autoWrapLongitude; - uniforms.project_uModelMatrix = modelMatrix || IDENTITY_MATRIX; + uniforms.wrapLongitude = autoWrapLongitude; + uniforms.modelMatrix = modelMatrix || IDENTITY_MATRIX; return uniforms; } @@ -299,33 +299,33 @@ function calculateViewportUniforms({ const uniforms: ProjectUniforms = { // Projection mode values - project_uCoordinateSystem: coordinateSystem, - project_uProjectionMode: viewport.projectionMode, - project_uCoordinateOrigin: shaderCoordinateOrigin, - project_uCommonOrigin: originCommon.slice(0, 3) as Vec3, - project_uCenter: projectionCenter, + coordinateSystem, + projectionMode: viewport.projectionMode, + coordinateOrigin: shaderCoordinateOrigin, + commonOrigin: originCommon.slice(0, 3) as Vec3, + center: projectionCenter, // Backward compatibility // TODO: remove in v9 // @ts-expect-error _pseudoMeters is only defined on WebMercator viewport - project_uPseudoMeters: Boolean(viewport._pseudoMeters), + pseudoMeters: Boolean(viewport._pseudoMeters), // Screen size - project_uViewportSize: viewportSize, - project_uDevicePixelRatio: devicePixelRatio, + viewportSize, + devicePixelRatio, - project_uFocalDistance: focalDistance, - project_uCommonUnitsPerMeter: distanceScales.unitsPerMeter as Vec3, - project_uCommonUnitsPerWorldUnit: distanceScales.unitsPerMeter as Vec3, - project_uCommonUnitsPerWorldUnit2: DEFAULT_PIXELS_PER_UNIT2, - project_uScale: viewport.scale, // This is the mercator scale (2 ** zoom) - project_uWrapLongitude: false, + focalDistance, + commonUnitsPerMeter: distanceScales.unitsPerMeter as Vec3, + commonUnitsPerWorldUnit: distanceScales.unitsPerMeter as Vec3, + commonUnitsPerWorldUnit2: DEFAULT_PIXELS_PER_UNIT2, + scale: viewport.scale, // This is the mercator scale (2 ** zoom) + wrapLongitude: false, - project_uViewProjectionMatrix: viewProjectionMatrix, - project_uModelMatrix: IDENTITY_MATRIX, + viewProjectionMatrix, + modelMatrix: IDENTITY_MATRIX, // This is for lighting calculations - project_uCameraPosition: cameraPosCommon + cameraPosition: cameraPosCommon }; if (geospatialOrigin) { @@ -341,28 +341,24 @@ function calculateViewportUniforms({ }; switch (coordinateSystem) { case COORDINATE_SYSTEM.METER_OFFSETS: - uniforms.project_uCommonUnitsPerWorldUnit = distanceScalesAtOrigin.unitsPerMeter; - uniforms.project_uCommonUnitsPerWorldUnit2 = distanceScalesAtOrigin.unitsPerMeter2; + uniforms.commonUnitsPerWorldUnit = distanceScalesAtOrigin.unitsPerMeter; + uniforms.commonUnitsPerWorldUnit2 = distanceScalesAtOrigin.unitsPerMeter2; break; case COORDINATE_SYSTEM.LNGLAT: case COORDINATE_SYSTEM.LNGLAT_OFFSETS: // @ts-expect-error _pseudoMeters only exists on WebMercatorView if (!viewport._pseudoMeters) { - uniforms.project_uCommonUnitsPerMeter = distanceScalesAtOrigin.unitsPerMeter; + uniforms.commonUnitsPerMeter = distanceScalesAtOrigin.unitsPerMeter; } - uniforms.project_uCommonUnitsPerWorldUnit = distanceScalesAtOrigin.unitsPerDegree; - uniforms.project_uCommonUnitsPerWorldUnit2 = distanceScalesAtOrigin.unitsPerDegree2; + uniforms.commonUnitsPerWorldUnit = distanceScalesAtOrigin.unitsPerDegree; + uniforms.commonUnitsPerWorldUnit2 = distanceScalesAtOrigin.unitsPerDegree2; break; // a.k.a "preprojected" positions case COORDINATE_SYSTEM.CARTESIAN: - uniforms.project_uCommonUnitsPerWorldUnit = [1, 1, distanceScalesAtOrigin.unitsPerMeter[2]]; - uniforms.project_uCommonUnitsPerWorldUnit2 = [ - 0, - 0, - distanceScalesAtOrigin.unitsPerMeter2[2] - ]; + uniforms.commonUnitsPerWorldUnit = [1, 1, distanceScalesAtOrigin.unitsPerMeter[2]]; + uniforms.commonUnitsPerWorldUnit2 = [0, 0, distanceScalesAtOrigin.unitsPerMeter2[2]]; break; default: diff --git a/modules/core/src/shaderlib/shadow/shadow.ts b/modules/core/src/shaderlib/shadow/shadow.ts index c92710e4802..9cd98596edb 100644 --- a/modules/core/src/shaderlib/shadow/shadow.ts +++ b/modules/core/src/shaderlib/shadow/shadow.ts @@ -205,7 +205,7 @@ function createShadowUniforms( const center = getMemoizedViewportCenterPosition({ viewport: opts.viewport, - center: context.project_uCenter + center: context.center }); const projectCenters: NumericArray[] = []; @@ -221,8 +221,8 @@ function createShadowUniforms( .translate(new Vector3(opts.viewport.center).negate()); if ( - context.project_uCoordinateSystem === COORDINATE_SYSTEM.LNGLAT && - context.project_uProjectionMode === PROJECTION_MODE.WEB_MERCATOR + context.coordinateSystem === COORDINATE_SYSTEM.LNGLAT && + context.projectionMode === PROJECTION_MODE.WEB_MERCATOR ) { viewProjectionMatrices[i] = viewProjectionMatrixCentered; projectCenters[i] = center; diff --git a/modules/core/src/transitions/gpu-interpolation-transition.ts b/modules/core/src/transitions/gpu-interpolation-transition.ts index 5238801f8dd..23b7ed10ab8 100644 --- a/modules/core/src/transitions/gpu-interpolation-transition.ts +++ b/modules/core/src/transitions/gpu-interpolation-transition.ts @@ -204,6 +204,8 @@ function getTransform(device: Device, attribute: Attribute): BufferTransform { ATTRIBUTE_TYPE: attributeType }, varyings: ['vCurrent'], + + // TODO investigate why this is needed disableWarnings: true }); } diff --git a/modules/extensions/package.json b/modules/extensions/package.json index c13870060fd..6325eda075f 100644 --- a/modules/extensions/package.json +++ b/modules/extensions/package.json @@ -38,8 +38,8 @@ "prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev" }, "dependencies": { - "@luma.gl/constants": "^9.0.11", - "@luma.gl/shadertools": "^9.0.11", + "@luma.gl/constants": "^9.0.12", + "@luma.gl/shadertools": "^9.0.12", "@math.gl/core": "^4.0.0" }, "peerDependencies": { diff --git a/modules/extensions/src/brushing/shader-module.ts b/modules/extensions/src/brushing/shader-module.ts index 2e7368c7510..07ff10b2132 100644 --- a/modules/extensions/src/brushing/shader-module.ts +++ b/modules/extensions/src/brushing/shader-module.ts @@ -47,7 +47,7 @@ const vs = glsl` } vec2 source_commonspace = project_position(position); vec2 target_commonspace = project_position(brushing_mousePos); - float distance = length((target_commonspace - source_commonspace) / project_uCommonUnitsPerMeter.xy); + float distance = length((target_commonspace - source_commonspace) / project.commonUnitsPerMeter.xy); return distance <= brushing_radius; } diff --git a/modules/extensions/src/collision-filter/shader-module.ts b/modules/extensions/src/collision-filter/shader-module.ts index eead389c0a3..4aaf5196449 100644 --- a/modules/extensions/src/collision-filter/shader-module.ts +++ b/modules/extensions/src/collision-filter/shader-module.ts @@ -32,7 +32,7 @@ float collision_isVisible(vec2 texCoords, vec3 pickingColor) { // This reduces the flicker present when objects are shown/hidden const int N = 2; float accumulator = 0.0; - vec2 step = vec2(1.0 / project_uViewportSize); + vec2 step = vec2(1.0 / project.viewportSize); const float floatN = float(N); vec2 delta = -floatN * step; diff --git a/modules/extensions/src/fill-style/shader-module.ts b/modules/extensions/src/fill-style/shader-module.ts index 607f9288711..f90a90ec34c 100644 --- a/modules/extensions/src/fill-style/shader-module.ts +++ b/modules/extensions/src/fill-style/shader-module.ts @@ -92,7 +92,7 @@ function getPatternUniforms( } if ('viewport' in opts) { const {fillPatternMask = true, fillPatternEnabled = true} = opts; - const {project_uCommonOrigin: coordinateOriginCommon} = uniforms as ProjectUniforms; + const {commonOrigin: coordinateOriginCommon} = uniforms as ProjectUniforms; const coordinateOriginCommon64Low = [ fp64LowPart(coordinateOriginCommon[0]), diff --git a/modules/extensions/src/fp64/fp64-extension.ts b/modules/extensions/src/fp64/fp64-extension.ts index 928524cc154..9912758d9dd 100644 --- a/modules/extensions/src/fp64/fp64-extension.ts +++ b/modules/extensions/src/fp64/fp64-extension.ts @@ -40,4 +40,12 @@ export default class Fp64Extension extends LayerExtension { modules: [project64] }; } + + draw(this: Layer, params: any, extension: this): void { + const {moduleParameters} = params; + if (moduleParameters) { + const {viewport} = moduleParameters; + this.setShaderModuleProps({project64: {viewport}}); + } + } } diff --git a/modules/extensions/src/fp64/project64.glsl.ts b/modules/extensions/src/fp64/project64.glsl.ts index e5dc331c308..5dcca1de299 100644 --- a/modules/extensions/src/fp64/project64.glsl.ts +++ b/modules/extensions/src/fp64/project64.glsl.ts @@ -22,7 +22,11 @@ export default `\ const vec2 WORLD_SCALE_FP64 = vec2(81.4873275756836, 0.0000032873668232014097); -uniform vec2 project_uViewProjectionMatrixFP64[16]; +uniform project64Uniforms { + vec2 scale; + mat4 viewProjectionMatrix; + mat4 viewProjectionMatrix64Low; +} project64; // longitude: lnglat_fp64.xy; latitude: lnglat_fp64.zw void mercatorProject_fp64(vec4 lnglat_fp64, out vec2 out_val[2]) { @@ -56,7 +60,16 @@ void project_position_fp64(vec2 position, vec2 position64xyLow, out vec2 out_val vec4 project_common_position_to_clipspace_fp64(vec2 vertex_pos_modelspace[4]) { vec2 vertex_pos_clipspace[4]; - mat4_vec4_mul_fp64(project_uViewProjectionMatrixFP64, vertex_pos_modelspace, + vec2 viewProjectionMatrixFP64[16]; + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + viewProjectionMatrixFP64[4 * i + j] = vec2( + project64.viewProjectionMatrix[j][i], + project64.viewProjectionMatrix64Low[j][i] + ); + } + } + mat4_vec4_mul_fp64(viewProjectionMatrixFP64, vertex_pos_modelspace, vertex_pos_clipspace); return vec4( vertex_pos_clipspace[0].x, diff --git a/modules/extensions/src/fp64/project64.ts b/modules/extensions/src/fp64/project64.ts index 238f838cec0..ae44356bb44 100644 --- a/modules/extensions/src/fp64/project64.ts +++ b/modules/extensions/src/fp64/project64.ts @@ -35,7 +35,13 @@ export default { name: 'project64', dependencies: [project, fp64], vs: project64Shader, - getUniforms + getUniforms, + uniformTypes: { + scale: 'vec2', + // Cannot pass as vec2[16], so instead split into 2 mat4x4 + viewProjectionMatrix: 'mat4x4', + viewProjectionMatrix64Low: 'mat4x4' + } } as ShaderModule; // TODO - this module should calculate the 64 bit uniforms @@ -60,11 +66,20 @@ function calculateUniforms({ scale: number; }) { const glViewProjectionMatrixFP64 = fp64ifyMatrix4(viewProjectionMatrix); - const scaleFP64 = fp64ify(scale); - + const viewProjectionMatrix64High = new Float32Array(16); + const viewProjectionMatrix64Low = new Float32Array(16); + for (let i = 0; i < 4; i++) { + for (let j = 0; j < 4; j++) { + // Match order used in project.viewProjectionMatrix + const from = 4 * i + j; + const to = 4 * j + i; + viewProjectionMatrix64High[to] = glViewProjectionMatrixFP64[2 * from]; + viewProjectionMatrix64Low[to] = glViewProjectionMatrixFP64[2 * from + 1]; + } + } return { - project_uViewProjectionMatrixFP64: glViewProjectionMatrixFP64, - project64_uViewProjectionMatrix: glViewProjectionMatrixFP64, - project64_uScale: scaleFP64 + scale: fp64ify(scale), + viewProjectionMatrix: [...viewProjectionMatrix64High], + viewProjectionMatrix64Low: [...viewProjectionMatrix64Low] }; } diff --git a/modules/extensions/src/terrain/shader-module.ts b/modules/extensions/src/terrain/shader-module.ts index 5a444f1782b..0adc82aa551 100644 --- a/modules/extensions/src/terrain/shader-module.ts +++ b/modules/extensions/src/terrain/shader-module.ts @@ -62,7 +62,7 @@ commonPos = geometry.position.xyz; if (terrain_mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) { vec2 texCoords = (commonPos.xy - terrain_bounds.xy) / terrain_bounds.zw; position = vec4(texCoords * 2.0 - 1.0, 0.0, 1.0); - commonPos.z += project_uCommonOrigin.z; + commonPos.z += project.commonOrigin.z; } if (terrain_mode == TERRAIN_MODE_USE_HEIGHT_MAP) { vec3 anchor = geometry.worldPosition; @@ -115,7 +115,7 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US useTerrainHeightMap, terrainSkipRender } = opts; - const {project_uCommonOrigin} = uniforms; + const {commonOrigin} = uniforms; let mode: number = terrainSkipRender ? TERRAIN_MODE.SKIP : TERRAIN_MODE.NONE; // height map if case USE_HEIGHT_MAP, terrain cover if USE_COVER, otherwise empty @@ -155,8 +155,8 @@ if ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_US // Convert bounds to the common space, as [minX, minY, width, height] terrain_bounds: bounds ? [ - bounds[0] - project_uCommonOrigin[0], - bounds[1] - project_uCommonOrigin[1], + bounds[0] - commonOrigin[0], + bounds[1] - commonOrigin[1], bounds[2] - bounds[0], bounds[3] - bounds[1] ] diff --git a/modules/geo-layers/package.json b/modules/geo-layers/package.json index 341773fb7b9..2421cbd570c 100644 --- a/modules/geo-layers/package.json +++ b/modules/geo-layers/package.json @@ -46,8 +46,8 @@ "@loaders.gl/terrain": "^4.2.0", "@loaders.gl/tiles": "^4.2.0", "@loaders.gl/wms": "^4.2.0", - "@luma.gl/gltf": "^9.0.11", - "@luma.gl/shadertools": "^9.0.11", + "@luma.gl/gltf": "^9.0.12", + "@luma.gl/shadertools": "^9.0.12", "@math.gl/core": "^4.0.0", "@math.gl/culling": "^4.0.0", "@math.gl/web-mercator": "^4.0.0", diff --git a/modules/geo-layers/src/mesh-layer/mesh-layer-vertex.glsl.ts b/modules/geo-layers/src/mesh-layer/mesh-layer-vertex.glsl.ts index 5b8c6b533b0..24afc94cd7a 100644 --- a/modules/geo-layers/src/mesh-layer/mesh-layer-vertex.glsl.ts +++ b/modules/geo-layers/src/mesh-layer/mesh-layer-vertex.glsl.ts @@ -50,7 +50,7 @@ void main(void) { mat3 instanceModelMatrix = mat3(instanceModelMatrixCol0, instanceModelMatrixCol1, instanceModelMatrixCol2); vTexCoord = uv; - cameraPosition = project_uCameraPosition; + cameraPosition = project.cameraPosition; vColor = vec4(colors * instanceColors.rgb, instanceColors.a); vec3 pos = (instanceModelMatrix * positions) * sizeScale; diff --git a/modules/geo-layers/src/mesh-layer/mesh-layer.ts b/modules/geo-layers/src/mesh-layer/mesh-layer.ts index 0d7b52063c4..052de171dab 100644 --- a/modules/geo-layers/src/mesh-layer/mesh-layer.ts +++ b/modules/geo-layers/src/mesh-layer/mesh-layer.ts @@ -97,8 +97,7 @@ export default class MeshLayer extends } this.state.model.setUniforms({ // Needed for PBR (TODO: find better way to get it) - // eslint-disable-next-line camelcase - u_Camera: this.state.model.uniforms.project_uCameraPosition, + u_Camera: this.state.model.uniforms.cameraPosition, pickFeatureIds: Boolean(featureIds) }); diff --git a/modules/google-maps/package.json b/modules/google-maps/package.json index a967f0a15c8..2173957957f 100644 --- a/modules/google-maps/package.json +++ b/modules/google-maps/package.json @@ -38,7 +38,7 @@ "prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev" }, "dependencies": { - "@luma.gl/constants": "^9.0.11", + "@luma.gl/constants": "^9.0.12", "@math.gl/core": "^4.0.0", "@types/google.maps": "^3.48.6" }, diff --git a/modules/jupyter-widget/package.json b/modules/jupyter-widget/package.json index bfaf4313675..7b13a5dd930 100644 --- a/modules/jupyter-widget/package.json +++ b/modules/jupyter-widget/package.json @@ -39,7 +39,7 @@ "@loaders.gl/3d-tiles": "^4.2.0", "@loaders.gl/core": "^4.2.0", "@loaders.gl/csv": "^4.2.0", - "@luma.gl/core": "^9.0.11", + "@luma.gl/core": "^9.0.12", "d3-dsv": "^1.0.8", "mapbox-gl": "^1.13.2" }, diff --git a/modules/layers/src/arc-layer/arc-layer-vertex.glsl.ts b/modules/layers/src/arc-layer/arc-layer-vertex.glsl.ts index f666ea49e30..8407fab5974 100644 --- a/modules/layers/src/arc-layer/arc-layer-vertex.glsl.ts +++ b/modules/layers/src/arc-layer/arc-layer-vertex.glsl.ts @@ -74,7 +74,7 @@ float paraboloid(float distance, float sourceZ, float targetZ, float ratio) { // offset_direction is -1 (left) or 1 (right) vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) { // normalized direction of the line - vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize); + vec2 dir_screenspace = normalize(line_clipspace * project.viewportSize); // rotate by 90 degrees dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x); @@ -163,7 +163,7 @@ void main(void) { vec3 source; vec3 target; - if ((greatCircle || project_uProjectionMode == PROJECTION_MODE_GLOBE) && project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT) { + if ((greatCircle || project.projectionMode == PROJECTION_MODE_GLOBE) && project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT) { source = project_globe_(vec3(instanceSourcePositions.xy, 0.0)); target = project_globe_(vec3(instanceTargetPositions.xy, 0.0)); float angularDist = getAngularDist(instanceSourcePositions.xy, instanceTargetPositions.xy); @@ -214,8 +214,8 @@ void main(void) { float antiMeridianX = 0.0; if (useShortestPath) { - if (project_uProjectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) { - antiMeridianX = -(project_uCoordinateOrigin.x + 180.) / 360. * TILE_SIZE; + if (project.projectionMode == PROJECTION_MODE_WEB_MERCATOR_AUTO_OFFSET) { + antiMeridianX = -(project.coordinateOrigin.x + 180.) / 360. * TILE_SIZE; } float thresholdRatio = (antiMeridianX - source.x) / (target.x - source.x); diff --git a/modules/layers/src/bitmap-layer/bitmap-layer-vertex.ts b/modules/layers/src/bitmap-layer/bitmap-layer-vertex.ts index a8dca452354..1289adb3a3f 100644 --- a/modules/layers/src/bitmap-layer/bitmap-layer-vertex.ts +++ b/modules/layers/src/bitmap-layer/bitmap-layer-vertex.ts @@ -24,7 +24,7 @@ void main(void) { vTexCoord = texCoords; if (coordinateConversion < -0.5) { - vTexPos = geometry.position.xy + project_uCommonOrigin.xy; + vTexPos = geometry.position.xy + project.commonOrigin.xy; } else if (coordinateConversion > 0.5) { vTexPos = geometry.worldPosition.xy; } diff --git a/modules/layers/src/column-layer/column-layer-fragment.glsl.ts b/modules/layers/src/column-layer/column-layer-fragment.glsl.ts index bb45f68f173..7d8119532c5 100644 --- a/modules/layers/src/column-layer/column-layer-fragment.glsl.ts +++ b/modules/layers/src/column-layer/column-layer-fragment.glsl.ts @@ -23,7 +23,6 @@ export default `#version 300 es precision highp float; -uniform vec3 project_uCameraPosition; uniform bool extruded; uniform bool isStroke; @@ -31,6 +30,7 @@ out vec4 fragColor; in vec4 vColor; #ifdef FLAT_SHADING +in vec3 cameraPosition; in vec4 position_commonspace; #endif @@ -41,7 +41,7 @@ void main(void) { #ifdef FLAT_SHADING if (extruded && !isStroke && !bool(picking.isActive)) { vec3 normal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz))); - fragColor.rgb = lighting_getLightColor(vColor.rgb, project_uCameraPosition, position_commonspace.xyz, normal); + fragColor.rgb = lighting_getLightColor(vColor.rgb, cameraPosition, position_commonspace.xyz, normal); } #endif DECKGL_FILTER_COLOR(fragColor, geometry); diff --git a/modules/layers/src/column-layer/column-layer-vertex.glsl.ts b/modules/layers/src/column-layer/column-layer-vertex.glsl.ts index 5cac89f7e8d..552ca4b6049 100644 --- a/modules/layers/src/column-layer/column-layer-vertex.glsl.ts +++ b/modules/layers/src/column-layer/column-layer-vertex.glsl.ts @@ -54,6 +54,7 @@ uniform int widthUnits; // Result out vec4 vColor; #ifdef FLAT_SHADING +out vec3 cameraPosition; out vec4 position_commonspace; #endif @@ -107,10 +108,11 @@ void main(void) { // Light calculations if (extruded && !isStroke) { #ifdef FLAT_SHADING + cameraPosition = project.cameraPosition; position_commonspace = geometry.position; vColor = vec4(color.rgb, color.a * opacity); #else - vec3 lightColor = lighting_getLightColor(color.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal); + vec3 lightColor = lighting_getLightColor(color.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal); vColor = vec4(lightColor, color.a * opacity); #endif } else { diff --git a/modules/layers/src/line-layer/line-layer-vertex.glsl.ts b/modules/layers/src/line-layer/line-layer-vertex.glsl.ts index f0567d4db18..5a4707fac40 100644 --- a/modules/layers/src/line-layer/line-layer-vertex.glsl.ts +++ b/modules/layers/src/line-layer/line-layer-vertex.glsl.ts @@ -45,7 +45,7 @@ out vec2 uv; // offset_direction is -1 (left) or 1 (right) vec2 getExtrusionOffset(vec2 line_clipspace, float offset_direction, float width) { // normalized direction of the line - vec2 dir_screenspace = normalize(line_clipspace * project_uViewportSize); + vec2 dir_screenspace = normalize(line_clipspace * project.viewportSize); // rotate by 90 degrees dir_screenspace = vec2(-dir_screenspace.y, dir_screenspace.x); diff --git a/modules/layers/src/point-cloud-layer/point-cloud-layer-vertex.glsl.ts b/modules/layers/src/point-cloud-layer/point-cloud-layer-vertex.glsl.ts index aa6fafdc29d..83e88d28fb5 100644 --- a/modules/layers/src/point-cloud-layer/point-cloud-layer-vertex.glsl.ts +++ b/modules/layers/src/point-cloud-layer/point-cloud-layer-vertex.glsl.ts @@ -54,7 +54,7 @@ void main(void) { gl_Position.xy += project_pixel_size_to_clipspace(offset.xy); // Apply lighting - vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal); + vec3 lightColor = lighting_getLightColor(instanceColors.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal); // Apply opacity to instance color, or return instance picking color vColor = vec4(lightColor, instanceColors.a * opacity); diff --git a/modules/layers/src/solid-polygon-layer/solid-polygon-layer-vertex-main.glsl.ts b/modules/layers/src/solid-polygon-layer/solid-polygon-layer-vertex-main.glsl.ts index f5077d2288a..826386d4620 100644 --- a/modules/layers/src/solid-polygon-layer/solid-polygon-layer-vertex-main.glsl.ts +++ b/modules/layers/src/solid-polygon-layer/solid-polygon-layer-vertex-main.glsl.ts @@ -39,10 +39,10 @@ struct PolygonProps { }; vec3 project_offset_normal(vec3 vector) { - if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT || - project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) { + if (project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT || + project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS) { // normals generated by the polygon tesselator are in lnglat offsets instead of meters - return normalize(vector * project_uCommonUnitsPerWorldUnit); + return normalize(vector * project.commonUnitsPerWorldUnit); } return project_normal(vector); } @@ -70,7 +70,7 @@ void calculatePosition(PolygonProps props) { normal = project_normal(normal); #endif geometry.normal = normal; - vec3 lightColor = lighting_getLightColor(colors.rgb, project_uCameraPosition, geometry.position.xyz, geometry.normal); + vec3 lightColor = lighting_getLightColor(colors.rgb, project.cameraPosition, geometry.position.xyz, geometry.normal); vColor = vec4(lightColor, colors.a * opacity); } else { vColor = vec4(colors.rgb, colors.a * opacity); diff --git a/modules/main/package.json b/modules/main/package.json index 84f6d079057..b6767ec7ce0 100644 --- a/modules/main/package.json +++ b/modules/main/package.json @@ -50,8 +50,8 @@ "@deck.gl/react": "9.0.0-beta.11", "@deck.gl/widgets": "9.0.0-beta.11", "@loaders.gl/core": "^4.2.0", - "@luma.gl/core": "^9.0.9", - "@luma.gl/engine": "^9.0.9" + "@luma.gl/core": "^9.0.12", + "@luma.gl/engine": "^9.0.12" }, "peerDependencies": { "@arcgis/core": "^4.0.0", diff --git a/modules/mapbox/package.json b/modules/mapbox/package.json index 99d38345f27..44605e4cf8f 100644 --- a/modules/mapbox/package.json +++ b/modules/mapbox/package.json @@ -38,7 +38,7 @@ "prepublishOnly": "npm run build-bundle && npm run build-bundle -- --env=dev" }, "dependencies": { - "@luma.gl/constants": "^9.0.11", + "@luma.gl/constants": "^9.0.12", "@math.gl/web-mercator": "^4.0.0" }, "peerDependencies": { diff --git a/modules/mesh-layers/package.json b/modules/mesh-layers/package.json index 98e9f733cc4..e66bee4a4db 100644 --- a/modules/mesh-layers/package.json +++ b/modules/mesh-layers/package.json @@ -39,8 +39,8 @@ }, "dependencies": { "@loaders.gl/gltf": "^4.2.0", - "@luma.gl/gltf": "^9.0.11", - "@luma.gl/shadertools": "^9.0.11" + "@luma.gl/gltf": "^9.0.12", + "@luma.gl/shadertools": "^9.0.12" }, "peerDependencies": { "@deck.gl/core": "^9.0.0-beta", diff --git a/modules/mesh-layers/src/scenegraph-layer/scenegraph-layer.ts b/modules/mesh-layers/src/scenegraph-layer/scenegraph-layer.ts index 5b5d8cf66d5..0570772cdb4 100644 --- a/modules/mesh-layers/src/scenegraph-layer/scenegraph-layer.ts +++ b/modules/mesh-layers/src/scenegraph-layer/scenegraph-layer.ts @@ -376,7 +376,7 @@ export default class ScenegraphLayer e sceneModelMatrix: worldMatrix, // Needed for PBR (TODO: find better way to get it) // eslint-disable-next-line camelcase - u_Camera: model.uniforms.project_uCameraPosition + u_Camera: model.uniforms.cameraPosition }); model.draw(renderPass); diff --git a/modules/mesh-layers/src/simple-mesh-layer/simple-mesh-layer-vertex.glsl.ts b/modules/mesh-layers/src/simple-mesh-layer/simple-mesh-layer-vertex.glsl.ts index ec48651fd91..da734aace17 100644 --- a/modules/mesh-layers/src/simple-mesh-layer/simple-mesh-layer-vertex.glsl.ts +++ b/modules/mesh-layers/src/simple-mesh-layer/simple-mesh-layer-vertex.glsl.ts @@ -34,7 +34,7 @@ void main(void) { geometry.pickingColor = instancePickingColors; vTexCoord = texCoords; - cameraPosition = project_uCameraPosition; + cameraPosition = project.cameraPosition; vColor = vec4(colors * instanceColors.rgb, instanceColors.a); mat3 instanceModelMatrix = mat3(instanceModelMatrixCol0, instanceModelMatrixCol1, instanceModelMatrixCol2); diff --git a/modules/test-utils/package.json b/modules/test-utils/package.json index c93120d6f6a..5de882916a3 100644 --- a/modules/test-utils/package.json +++ b/modules/test-utils/package.json @@ -32,7 +32,7 @@ "src" ], "dependencies": { - "@luma.gl/test-utils": "^9.0.11" + "@luma.gl/test-utils": "^9.0.12" }, "peerDependencies": { "@deck.gl/core": "^9.0.0-beta", diff --git a/package.json b/package.json index 8f66edf765a..b0e547cd465 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "devDependencies": { "@loaders.gl/csv": "^4.2.0", "@loaders.gl/polyfills": "^4.2.0", - "@luma.gl/webgpu": "^9.0.11", + "@luma.gl/webgpu": "^9.0.12", "@math.gl/proj4": "^4.0.0", "@probe.gl/bench": "^4.0.9", "jsdom": "^20.0.0", diff --git a/test/apps/wboit/wboit-layer/wboit-layer-vertex-main.glsl.js b/test/apps/wboit/wboit-layer/wboit-layer-vertex-main.glsl.js index 18218c40abb..d561c85eb7f 100644 --- a/test/apps/wboit/wboit-layer/wboit-layer-vertex-main.glsl.js +++ b/test/apps/wboit/wboit-layer/wboit-layer-vertex-main.glsl.js @@ -43,11 +43,11 @@ struct PolygonProps { }; vec3 project_offset_normal(vec3 vector) { - if (project_uCoordinateSystem == COORDINATE_SYSTEM_LNG_LAT || - project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS || - project_uCoordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) { + if (project.coordinateSystem == COORDINATE_SYSTEM_LNG_LAT || + project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT_OFFSETS || + project.coordinateSystem == COORDINATE_SYSTEM_LNGLAT_AUTO_OFFSET) { // normals generated by the polygon tesselator are in lnglat offsets instead of meters - return normalize(vector * project_uCommonUnitsPerWorldUnit); + return normalize(vector * project.commonUnitsPerWorldUnit); } return project_normal(vector); } @@ -87,7 +87,7 @@ void calculatePosition(PolygonProps props) { DECKGL_FILTER_GL_POSITION(gl_Position, geometry); if (extruded) { - vec3 lightColor = lighting_getLightColor(colors.rgb, project_uCameraPosition, geometry.position.xyz, normal); + vec3 lightColor = lighting_getLightColor(colors.rgb, project.cameraPosition, geometry.position.xyz, normal); vColor = vec4(lightColor, colors.a * opacity); } else { vColor = vec4(colors.rgb, colors.a * opacity); diff --git a/test/modules/core/shaderlib/project/project-32-64-glsl.spec.ts b/test/modules/core/shaderlib/project/project-32-64-glsl.spec.ts index 65503af3185..1892134e5b5 100644 --- a/test/modules/core/shaderlib/project/project-32-64-glsl.spec.ts +++ b/test/modules/core/shaderlib/project/project-32-64-glsl.spec.ts @@ -65,8 +65,8 @@ void main() vec4 glPos = project_position_to_clipspace(uPos, uPos64Low, vec3(0, 0, 0)); outValue = glPos.xyz / glPos.w; outValue = vec3( - (1.0 + outValue.x) / 2.0 * project_uViewportSize.x, - (1.0 - outValue.y) / 2.0 * project_uViewportSize.y, + (1.0 + outValue.x) / 2.0 * project.viewportSize.x, + (1.0 - outValue.y) / 2.0 * project.viewportSize.y, outValue.z ); } @@ -182,14 +182,10 @@ test('project32&64#vs', async t => { t.comment(`${testCase.title}: ${usefp64 ? 'fp64' : 'fp32'}`); - let uniforms = project.getUniforms(testCase.params); + let uniforms = {}; if (usefp64) { - uniforms = { - ...uniforms, - ...project64.getUniforms(testCase.params, uniforms), - // fp64arithmetic uniform - ONE: 1.0 - }; + // fp64arithmetic uniform + uniforms = {...uniforms, ONE: 1.0}; } for (const c of testCase.tests) { @@ -199,6 +195,7 @@ test('project32&64#vs', async t => { modules: usefp64 ? [project64] : [project32], varying: 'outValue', vertexCount: 1, + shaderInputProps: {project: testCase.params, project64: testCase.params}, uniforms: { ...uniforms, uPos: c.input, diff --git a/test/modules/core/shaderlib/project/project-functions.spec.ts b/test/modules/core/shaderlib/project/project-functions.spec.ts index 22cf552b5ac..bec8e85fe3d 100644 --- a/test/modules/core/shaderlib/project/project-functions.spec.ts +++ b/test/modules/core/shaderlib/project/project-functions.spec.ts @@ -170,16 +170,14 @@ void main() for (const {title, position, params} of TEST_CASES.filter( testCase => !testCase.params.fromCoordinateSystem )) { - const uniforms = project.getUniforms(params); - const cpuResult = projectPosition(position, params); const shaderResult = await runOnGPU({ vs, varying: 'outValue', modules: [project], vertexCount: 1, + shaderInputProps: {project: params}, uniforms: { - ...uniforms, uPos: position, uPos64Low: position.map(fp64LowPart) } diff --git a/test/modules/core/shaderlib/project/project-glsl-test-utils.ts b/test/modules/core/shaderlib/project/project-glsl-test-utils.ts index a52e56303ab..547b9f5c8ae 100644 --- a/test/modules/core/shaderlib/project/project-glsl-test-utils.ts +++ b/test/modules/core/shaderlib/project/project-glsl-test-utils.ts @@ -30,10 +30,12 @@ export function getPixelOffset(p1, p2) { const OUT_BUFFER = device.createBuffer({byteLength: 4 * 16}); export async function runOnGPU({ + shaderInputProps, uniforms, varying, ...transformProps }: BufferTransformProps & { + shaderInputProps: Record>; uniforms: Record; varying: string; }): Promise { @@ -43,6 +45,7 @@ export async function runOnGPU({ varyings: [varying] }); transform.model.setUniforms(uniforms); + transform.model.shaderInputs.setProps(shaderInputProps); transform.run({ discard: true }); diff --git a/test/modules/core/shaderlib/project/project-glsl.spec.ts b/test/modules/core/shaderlib/project/project-glsl.spec.ts index 2a8ee2fcf54..8d82f9f274a 100644 --- a/test/modules/core/shaderlib/project/project-glsl.spec.ts +++ b/test/modules/core/shaderlib/project/project-glsl.spec.ts @@ -26,6 +26,7 @@ import {fp64} from '@luma.gl/shadertools'; const {fp64LowPart} = fp64; import {getPixelOffset, runOnGPU, verifyGPUResult} from './project-glsl-test-utils'; +import {UniformValue} from '@luma.gl/shadertools/dist/lib/shader-module/shader-module'; const PIXEL_TOLERANCE = 1e-4; const TEST_VIEWPORT = new WebMercatorViewport({ @@ -98,14 +99,26 @@ void main() vec4 glPos = project_common_position_to_clipspace(pos); outValue = glPos.xyz / glPos.w; outValue = vec3( - (1.0 + outValue.x) / 2.0 * project_uViewportSize.x, - (1.0 - outValue.y) / 2.0 * project_uViewportSize.y, + (1.0 + outValue.x) / 2.0 * project.viewportSize.x, + (1.0 - outValue.y) / 2.0 * project.viewportSize.y, outValue.z ); } ` }; -const TEST_CASES = [ + +type TestCase = { + title: string; + params: Record; + tests: { + name: string; + vs: string; + precision?: number; + input: Record; + output: any; + }[]; +}; +const TEST_CASES: TestCase[] = [ { title: 'LNGLAT mode', params: { @@ -328,8 +341,6 @@ test('project#vs', async t => { for (const testCase of TEST_CASES) { t.comment(testCase.title); - const uniforms = project.getUniforms(testCase.params); - for (const {name, vs, input, output, precision = 1e-7} of testCase.tests) { config.EPSILON = precision; let actual: NumericArray = await runOnGPU({ @@ -337,7 +348,8 @@ test('project#vs', async t => { varying: 'outValue', modules: [project], vertexCount: 1, - uniforms: {...uniforms, ...input} + shaderInputProps: {project: testCase.params}, + uniforms: input }); t.is(verifyGPUResult(actual, output), true, name); @@ -361,10 +373,12 @@ void main() { outValue = transform * uInput; } `; - const uniforms = project.getUniforms({ - viewport: TEST_VIEWPORT, - coordinateSystem: COORDINATE_SYSTEM.LNGLAT - }); + const shaderInputProps = { + project: { + viewport: TEST_VIEWPORT, + coordinateSystem: COORDINATE_SYSTEM.LNGLAT + } + }; const runTransform = async (up: NumericArray, v: NumericArray): Promise => { const result = await runOnGPU({ @@ -372,7 +386,8 @@ void main() { varying: 'outValue', modules: [project], vertexCount: 1, - uniforms: {...uniforms, uDirUp: up, uInput: v} + shaderInputProps, + uniforms: {uDirUp: up, uInput: v} }); return new Vector3(result.slice(0, 3)); }; diff --git a/test/modules/core/shaderlib/project/viewport-uniforms.spec.ts b/test/modules/core/shaderlib/project/viewport-uniforms.spec.ts index 7709f8cbbaa..16166e07c6f 100644 --- a/test/modules/core/shaderlib/project/viewport-uniforms.spec.ts +++ b/test/modules/core/shaderlib/project/viewport-uniforms.spec.ts @@ -54,23 +54,23 @@ const TEST_VIEWPORTS = { const UNIFORMS = { // Projection mode values - project_uCoordinateSystem: Number, - project_uCenter: Array, + coordinateSystem: Number, + center: Array, // Screen size - project_uViewportSize: Array, - project_uDevicePixelRatio: Number, + viewportSize: Array, + devicePixelRatio: Number, // Distance at which screen pixels are projected - project_uFocalDistance: Number, - project_uCommonUnitsPerWorldUnit: Array, - project_uScale: Number, // This is the mercator scale (2 ** zoom) + focalDistance: Number, + commonUnitsPerWorldUnit: Array, + scale: Number, // This is the mercator scale (2 ** zoom) - project_uModelMatrix: Array, - project_uViewProjectionMatrix: Array, + modelMatrix: Array, + viewProjectionMatrix: Array, // This is for lighting calculations - project_uCameraPosition: Array + cameraPosition: Array }; // 64 bit support @@ -99,33 +99,32 @@ function getUniformsError(uniforms, formats) { test('project#getUniforms', t => { let uniforms = project.getUniforms({viewport: TEST_VIEWPORTS.map}); t.notOk(getUniformsError(uniforms, UNIFORMS), 'Uniforms validated'); - t.deepEqual(uniforms.project_uCenter, [0, 0, 0, 0], 'Returned zero projection center'); + t.deepEqual(uniforms.center, [0, 0, 0, 0], 'Returned zero projection center'); uniforms = project.getUniforms({ viewport: TEST_VIEWPORTS.map, coordinateSystem: COORDINATE_SYSTEM.CARTESIAN }); t.notOk(getUniformsError(uniforms, UNIFORMS), 'Uniforms validated'); - t.deepEqual(uniforms.project_uCenter, [0, 0, 0, 0], 'Returned zero projection center'); + t.deepEqual(uniforms.center, [0, 0, 0, 0], 'Returned zero projection center'); uniforms = project.getUniforms({viewport: TEST_VIEWPORTS.mapHighZoom}); t.notOk(getUniformsError(uniforms, UNIFORMS), 'Uniforms validated'); t.ok( - uniforms.project_uCenter.some(x => x), + uniforms.center.some(x => x), 'Returned non-trivial projection center' ); t.ok( - Math.abs(uniforms.project_uCenter[0]) < EPSILON && - Math.abs(uniforms.project_uCenter[1]) < EPSILON, + Math.abs(uniforms.center[0]) < EPSILON && Math.abs(uniforms.center[1]) < EPSILON, 'project center at center of clipspace' ); t.deepEqual( - uniforms.project_uCoordinateOrigin, + uniforms.coordinateOrigin, [-122.42694091796875, 37.75153732299805, 0], 'Returned shader coordinate origin' ); t.ok( - uniforms.project_uCenter.some(x => x), + uniforms.center.some(x => x), 'Returned non-trivial projection center' ); @@ -136,7 +135,7 @@ test('project#getUniforms', t => { }); t.notOk(getUniformsError(uniforms, UNIFORMS), 'Uniforms validated'); t.ok( - uniforms.project_uCenter.some(x => x), + uniforms.center.some(x => x), 'Returned non-trivial projection center' ); @@ -146,18 +145,16 @@ test('project#getUniforms', t => { }); t.notOk(getUniformsError(uniforms, UNIFORMS), 'Uniforms validated'); t.ok( - uniforms.project_uCenter.some(x => x), + uniforms.center.some(x => x), 'Returned non-trivial projection center' ); // CARTESIAN + WEB_MERCATOR_AUTO_OFFSET is rounded in the common space t.ok( - Math.abs(uniforms.project_uCenter[0]) < EPSILON * 10 && - Math.abs(uniforms.project_uCenter[1]) < EPSILON * 10, + Math.abs(uniforms.center[0]) < EPSILON * 10 && Math.abs(uniforms.center[1]) < EPSILON * 10, 'project center at center of clipspace' ); t.ok( - uniforms.project_uCommonUnitsPerWorldUnit[0] === 1 && - uniforms.project_uCommonUnitsPerWorldUnit[1] === 1, + uniforms.commonUnitsPerWorldUnit[0] === 1 && uniforms.commonUnitsPerWorldUnit[1] === 1, 'Returned correct distanceScales' ); @@ -167,12 +164,12 @@ test('project#getUniforms', t => { }); t.notOk(getUniformsError(uniforms, UNIFORMS), 'Uniforms validated'); t.deepEqual( - uniforms.project_uCoordinateOrigin, + uniforms.coordinateOrigin, [10.285714149475098, -3.1415927410125732, 0], 'Returned shader coordinate origin' ); t.ok( - uniforms.project_uCenter.some(x => x), + uniforms.center.some(x => x), 'Returned non-trivial projection center' ); diff --git a/test/modules/core/shaderlib/shadow/shadow.spec.ts b/test/modules/core/shaderlib/shadow/shadow.spec.ts index e0b17f293cf..8c88c170469 100644 --- a/test/modules/core/shaderlib/shadow/shadow.spec.ts +++ b/test/modules/core/shaderlib/shadow/shadow.spec.ts @@ -191,8 +191,8 @@ test('shadow#getUniforms', t => { dummyShadowMaps: [true] }, { - project_uCenter: [0, 0, 0, 0], - project_uCoordinateSystem: COORDINATE_SYSTEM.CARTESIAN + center: [0, 0, 0, 0], + coordinateSystem: COORDINATE_SYSTEM.CARTESIAN } ); diff --git a/test/modules/extensions/fp64.spec.ts b/test/modules/extensions/fp64.spec.ts index 930f331ee54..463aa43ed46 100644 --- a/test/modules/extensions/fp64.spec.ts +++ b/test/modules/extensions/fp64.spec.ts @@ -23,7 +23,8 @@ test('Fp64Extension', t => { }, onAfterUpdate: ({layer}) => { const {uniforms} = layer.state.model; - t.ok(uniforms.project_uViewProjectionMatrixFP64, 'has fp64 uniforms'); + t.ok(uniforms.viewProjectionMatrix, 'has fp64 uniforms'); + t.ok(uniforms.viewProjectionMatrix64Low, 'has fp64 uniforms'); } } ]; diff --git a/yarn.lock b/yarn.lock index c2b91678b95..135cec3aa2e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1922,15 +1922,15 @@ jszip "^3.1.5" md5 "^2.3.0" -"@luma.gl/constants@9.0.11", "@luma.gl/constants@^9.0.11": - version "9.0.11" - resolved "https://registry.yarnpkg.com/@luma.gl/constants/-/constants-9.0.11.tgz#652da5d5dfe870ca6972b6cae55b679490692dd3" - integrity sha512-LRsGHzjz6j035HA2OeAuOwwkrk7ymc5SFfHGKn+G96IRRtqWZ/G5aCVRT/Wlako/cvAKfG7yTrhe0aL2o36KUw== +"@luma.gl/constants@9.0.12", "@luma.gl/constants@^9.0.12": + version "9.0.12" + resolved "https://registry.yarnpkg.com/@luma.gl/constants/-/constants-9.0.12.tgz#627aa743e809a0f21ed28e4fb3119c69d67e7207" + integrity sha512-/J6Z1uQDiEjp9t+5ijHE2wB+eegr2zBLhEnyMx8Fh4FUFELFdK9gaJVpv0u2xzZGyAhCy6GrgqOBVi0agxtF1g== -"@luma.gl/core@^9.0.11", "@luma.gl/core@^9.0.9": - version "9.0.11" - resolved "https://registry.yarnpkg.com/@luma.gl/core/-/core-9.0.11.tgz#a4f986d857730597da918cd267a3735db31cb385" - integrity sha512-oSK/z4tkLlM7wZw5LLxJDr7zcpZHIcg71NBmMgcDx2IEisJth4bPT7GA1vs6r5Snxc+CUiXvdnggeS40ZKLV3A== +"@luma.gl/core@^9.0.12": + version "9.0.12" + resolved "https://registry.yarnpkg.com/@luma.gl/core/-/core-9.0.12.tgz#959e0f00ae8dce44cd236f222252e446e6e80b16" + integrity sha512-hYQRZvY36mo/sAY4UT4nrgBM/1ElNM9RUQbUCujCb/kwSEj5Fsgd0CwRKlx6I3EF3SplnuE7s8bapQDauaMOyQ== dependencies: "@math.gl/types" "^4.0.0" "@probe.gl/env" "^4.0.2" @@ -1938,53 +1938,53 @@ "@probe.gl/stats" "^4.0.2" "@types/offscreencanvas" "^2019.6.4" -"@luma.gl/engine@^9.0.11", "@luma.gl/engine@^9.0.9": - version "9.0.11" - resolved "https://registry.yarnpkg.com/@luma.gl/engine/-/engine-9.0.11.tgz#ac3dcf11cbbcae22befd555b11088e6734da1f6d" - integrity sha512-YDbEBt1ach55TnngYTH0+aIsLQEhKUtMpvOpGaoZ4PPGlRPHhxVRBZQctNGY0CqvgFsI/VGMDSSYmBsrJ8w7GQ== +"@luma.gl/engine@^9.0.12": + version "9.0.12" + resolved "https://registry.yarnpkg.com/@luma.gl/engine/-/engine-9.0.12.tgz#d37bc953929a63665f29ac2b9bea787b6f3b38d7" + integrity sha512-IkM71XZMFxXqoKvniUbjbs1aSqdxrAYPYFbJRdskgP4P3UQgJN4t4zyKr+6NeDFULlTUVtllrP7AKrxHNeIXUA== dependencies: - "@luma.gl/shadertools" "9.0.11" + "@luma.gl/shadertools" "9.0.12" "@math.gl/core" "^4.0.0" "@probe.gl/log" "^4.0.2" "@probe.gl/stats" "^4.0.2" -"@luma.gl/gltf@^9.0.11": - version "9.0.11" - resolved "https://registry.yarnpkg.com/@luma.gl/gltf/-/gltf-9.0.11.tgz#f04dcde3cc9e00ca36cc5766998972663eb9f35b" - integrity sha512-3Y/iyNblYR6JZKihm8XLoAAehB3MYL0dujbmUUuAtyOn9WJMngtMHIMjw75DSpse7mIqhJLRZph76nR9FaxpGQ== +"@luma.gl/gltf@^9.0.12": + version "9.0.12" + resolved "https://registry.yarnpkg.com/@luma.gl/gltf/-/gltf-9.0.12.tgz#2c85b4f2bc40836fc506f78d1a4f709d0aaa6fea" + integrity sha512-ae1HGkgAcMF0WbIbpXX/AaSgdmjRfbJ33llSf0JmXfsi3u6EUBGE4kHScibfcJdHkY0VDRVt5M7bIxlYuYTZfQ== dependencies: "@loaders.gl/textures" "^4.2.0" - "@luma.gl/shadertools" "9.0.11" + "@luma.gl/shadertools" "9.0.12" "@math.gl/core" "^4.0.0" -"@luma.gl/shadertools@9.0.11", "@luma.gl/shadertools@^9.0.11": - version "9.0.11" - resolved "https://registry.yarnpkg.com/@luma.gl/shadertools/-/shadertools-9.0.11.tgz#00ea4b554273321cae9c18c060f42342652a833c" - integrity sha512-MSSmvyQ+hwCEHlw6z5O2bHNQJt4y6RHRaegMDaYPt8z9r4Pzphlzyrl1n+HxKWVfOj2mV/vvyPTJtwY90iBHIA== +"@luma.gl/shadertools@9.0.12", "@luma.gl/shadertools@^9.0.12": + version "9.0.12" + resolved "https://registry.yarnpkg.com/@luma.gl/shadertools/-/shadertools-9.0.12.tgz#2dfa5035defa09e7d25e5c1007deb773a5acc060" + integrity sha512-HIlZst2Zx4UydE/uJkQyR2mbPWvzAe0lrUVpIyH19lO5JgGqP2zOfnH+oCjZatt+n/HWhuZYpm7zNegfYYcJCg== dependencies: "@math.gl/core" "^4.0.0" "@math.gl/types" "^4.0.0" -"@luma.gl/test-utils@^9.0.11": - version "9.0.11" - resolved "https://registry.yarnpkg.com/@luma.gl/test-utils/-/test-utils-9.0.11.tgz#dac11239434866d8df231174a8ad5509259d3049" - integrity sha512-0FqZAbtGZUbSNdtzto7Btk7a3II2k0GZSvtLfgxAQj9EhvFHhIzHJCf63VU9HcKPu3Rra7u0Gj0Wotbx+vDsLw== +"@luma.gl/test-utils@^9.0.12": + version "9.0.12" + resolved "https://registry.yarnpkg.com/@luma.gl/test-utils/-/test-utils-9.0.12.tgz#2e2aa39add7bbab772c3f2552dd9148f3560d7b4" + integrity sha512-UcCjpm8E33juucVjgFFyTBWJJqVyTl536/Y7DyzbhbjKUl60FoJDW/SH0170WH3NJVHxxXkEFE3PWgahWl/KZQ== dependencies: "@probe.gl/env" "^4.0.2" "@probe.gl/stats" "^4.0.2" -"@luma.gl/webgl@^9.0.11": - version "9.0.11" - resolved "https://registry.yarnpkg.com/@luma.gl/webgl/-/webgl-9.0.11.tgz#3fb0ff337c2e267a8f48c2d9c7368e664c9e3f39" - integrity sha512-mWgUzsqjOtdZBKLex0taeRpwwp7ZovHrNhoUccAsNG9WerY3VHGRp1Rx4fn6qIG1QCsyyFEl1c8zlrnzK7axrQ== +"@luma.gl/webgl@^9.0.12": + version "9.0.12" + resolved "https://registry.yarnpkg.com/@luma.gl/webgl/-/webgl-9.0.12.tgz#90b46373b4492280b158220239d8b48b2d562fce" + integrity sha512-k3+EEAsQggzPYFMvqJjwM2+S4Vnwyn7lQCUQn6/RCiiEi+G12rxtQmzDYAoI5pMwYhMiDd7mnJ98yfAhMnEdFw== dependencies: - "@luma.gl/constants" "9.0.11" + "@luma.gl/constants" "9.0.12" "@probe.gl/env" "^4.0.2" -"@luma.gl/webgpu@^9.0.11": - version "9.0.11" - resolved "https://registry.yarnpkg.com/@luma.gl/webgpu/-/webgpu-9.0.11.tgz#092e67fc7c985482116dee62bf488a35d568ed56" - integrity sha512-KwN4z32tzXJyEJ8tpm0r0Omj4TMAIZWSEimLm0uCjVbmP52qkryYcGspbvHZntSLxXgtpQ4vdJ4u4uoWMtDJFQ== +"@luma.gl/webgpu@^9.0.12": + version "9.0.12" + resolved "https://registry.yarnpkg.com/@luma.gl/webgpu/-/webgpu-9.0.12.tgz#6394de890fe5d7ff922314e2fa9af4be8a47a5ed" + integrity sha512-OKVNQMWSTPHw1GKs5Wh7Rz6bJGEUMypjc92B2IT0dxXfPDbIm4Kuzwrnvml6UnVQkacpUa4+NHvd62XOKeNqIA== dependencies: "@probe.gl/env" "^4.0.2" "@webgpu/types" "^0.1.34"