Skip to content

Commit

Permalink
HeatmapLayer fix to work with project UBO
Browse files Browse the repository at this point in the history
  • Loading branch information
felixpalmer committed Jul 23, 2024
1 parent 4861a55 commit 4239e47
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion modules/aggregation-layers/src/heatmap-layer/heatmap-layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ import {
log,
Position,
UpdateParameters,
DefaultProps
DefaultProps,
project32
} from '@deck.gl/core';
import TriangleLayer from './triangle-layer';
import AggregationLayer, {AggregationLayerProps} from '../aggregation-layer';
Expand Down Expand Up @@ -201,6 +202,10 @@ export default class HeatmapLayer<
viewportCorners: number[][];
};

getShaders(shaders: any) {
return super.getShaders({...shaders, modules: [project32]});
}

initializeState() {
super.initializeAggregationLayer(DIMENSIONS);
this.setState({colorDomain: DEFAULT_COLOR_DOMAIN});
Expand Down Expand Up @@ -593,6 +598,12 @@ export default class HeatmapLayer<
weightsTransform.model.setVertexCount(this.getNumInstances());
weightsTransform.model.setUniforms(uniforms);
weightsTransform.model.updateModuleSettings(moduleSettings);

const {viewport, devicePixelRatio, coordinateSystem, coordinateOrigin} = moduleSettings;
const {modelMatrix} = this.props;
weightsTransform.model.shaderInputs.setProps({
project: {viewport, devicePixelRatio, modelMatrix, coordinateSystem, coordinateOrigin}
});
weightsTransform.run({
parameters: {viewport: [0, 0, textureSize, textureSize]},
clearColor: [0, 0, 0, 0]
Expand Down

0 comments on commit 4239e47

Please sign in to comment.