Skip to content

Commit

Permalink
Fix picking bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Mar 31, 2024
1 parent 1536dea commit bdc99e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 15 deletions.
13 changes: 6 additions & 7 deletions modules/core/src/lib/deck-picker.ts
Expand Up @@ -145,16 +145,15 @@ export default class DeckPicker {
_resizeBuffer() {
// Create a frame buffer if not already available
if (!this.pickingFBO) {
this.pickingFBO = this.device.createFramebuffer({colorAttachments: ['rgba8unorm']});
this.pickingFBO = this.device.createFramebuffer({
colorAttachments: ['rgba8unorm'],
depthStencilAttachment: 'depth16unorm'
});

if (this.device.isTextureFormatRenderable('rgba32float')) {
const depthFBO = this.device.createFramebuffer({
colorAttachments: [
this.device.createTexture({
format: 'rgba32float'
// type: GL.FLOAT
})
]
colorAttachments: ['rgba32float'],
depthStencilAttachment: 'depth16unorm'
});
this.depthFBO = depthFBO;
}
Expand Down
11 changes: 3 additions & 8 deletions modules/core/src/passes/pick-layers-pass.ts
Expand Up @@ -131,22 +131,17 @@ export default class PickLayersPass extends LayersPass {
depthMask: true,
depthTest: true,
depthRange: [0, 1],
...layer.props.parameters,
// Blending
...PICKING_BLENDING,
blend: !this.pickZ
...layer.props.parameters
};
const {pickable, operation} = layer.props;

if (!this._colorEncoderState) {
if (!this._colorEncoderState || operation.includes('terrain')) {
pickParameters.blend = false;
} else if (pickable && operation.includes('draw')) {
Object.assign(pickParameters, PICKING_BLENDING);
pickParameters.blend = true;
pickParameters.blendColor = encodeColor(this._colorEncoderState, layer, viewport);
}
if (operation.includes('terrain')) {
pickParameters.blend = false;
}

return pickParameters;
}
Expand Down

0 comments on commit bdc99e4

Please sign in to comment.