-
Notifications
You must be signed in to change notification settings - Fork 218
Description
I did not found another channel for questions, so I created this issue as it may be interesting for other people too.
I am trying to implement object picking using the inbuilt picking module of luma.gl, (https://luma.gl/docs/api-reference/shadertools/shader-modules/gpu-picking#usage) but the documentation is not quite clear on how the actual picking process works.
The example that uses picking (instanced cubes) seems to not do anything with it (no highlight). I tried something similiar
this.shaderInputs = new ShaderInputs({
picking,
});
this.picker = new PickingManager(this.device, {
// @ts-expect-error example
shaderInputs: this.shaderInputs,
});
and then after my main pass
this.picker.clearPickState();
const pickingPass = this.picker.beginRenderPass();
model.draw(pickingPass);
pickingPass.end();
const info = this.picker.getPickInfo([mouseX, mouseY]); // mouseX, mouseY are pixel coordinates from top-left
which does not return anything and throws this warning
my vertex shader has this as last line
picking_setPickingColor(vec3(0.5, 0.5, 0.5));
// some constant color for testing purposes
and my fragment shader
picking_filterPickingColor(fragColor);
Is there a working example or a documentation page which could help me resolve this issue?