Skip to content

Draw objects flagged alwaysOnTop last, without a depth test - #2

Draft
katosh wants to merge 1 commit into
oitfrom
alwaysontop
Draft

katosh wants to merge 1 commit into
oitfrom
alwaysontop

Conversation

@katosh

@katosh katosh commented Dec 5, 2026 •

Copy link
Copy Markdown

An object with alwaysOnTop set is skipped by the depth, opaque and transparent passes. The scene draws it after the composite, with premultiplied blending, in object order. The pick pass does not change, so the object stays pickable. Objects without the flag draw as before.

plotly.js uses it for scatter3d.alwaysontop, which keeps a highlight visible inside a dense or translucent cloud: settylab/plotly.js#6.

Two renders of a red point cloud: the cloud hides the black marker on the left, and the marker shows in full on the right

A black marker of size 30 in a cloud of 3,000 red markers of size 6 at opacity 0.6. Left, without the flag. Right, with it: every pixel of the marker shows its own color.

This branch builds on the order-independent transparency branch settylab/gl-plot3d#1 and changes scene.js only (29 lines added, 6 removed). We are glad to rework, split or drop it.

…pth test

An object with obj.alwaysOnTop set is skipped by the depth, opaque and transparent passes and drawn
after the composite with premultiplied blending, in object order. Pick pass unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant