Skip to content

Commit

Permalink
fix(picking): write to depth buffer for translucent pass when picking
Browse files Browse the repository at this point in the history
This change fixes a picking issue with multiple translucent actors overlaid on top of each other.
The hardware selector would just register the propID of the last rendered prop. This was because we
explicitly turn off writing to the depth buffer when rendering translucent props as OIT doesn't need
it. This change enables writing to the depth buffer when picking in the translucent pass.

BREAKING CHANGE: Applications relying on picked propID would see a difference in the IDs returned by
the hardware selector.

fix #2800
  • Loading branch information
sankhesh committed Jul 4, 2024
1 parent 7c7ac0b commit 792ae36
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Sources/Rendering/OpenGL/Actor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ function vtkOpenGLActor(publicAPI, model) {
// Renders myself
publicAPI.translucentPass = (prepass, renderPass) => {
if (prepass) {
model.context.depthMask(false);
model.context.depthMask(
model._openGLRenderer.getSelector() &&
model.renderable.getNestedPickable()
);
publicAPI.activateTextures();
} else if (model.activeTextures) {
for (let index = 0; index < model.activeTextures.length; index++) {
Expand Down

0 comments on commit 792ae36

Please sign in to comment.