Skip to content

Point depth in 3D#377

Draft
Carifio24 wants to merge 5 commits into
WorldWideTelescope:masterfrom
Carifio24:youve-gotta-dig-deep
Draft

Point depth in 3D#377
Carifio24 wants to merge 5 commits into
WorldWideTelescope:masterfrom
Carifio24:youve-gotta-dig-deep

Conversation

@Carifio24

Copy link
Copy Markdown
Member

This PR builds on some hacking that @johnarban and I did for https://github.com/cosmicds/artemis-ii to get points to correctly display in front of/behind planets in 3D mode. The key ideas here are:

  • We need to set these layers' point lists to be depth-buffered
  • We need to disable writing to the depth mask while drawing point layers. The reason for this is that the Gaussian point blob is actually an image texture with a transparent background. If we write to the depth buffer, things behind the transparent piece of the texture will be clipped when they really shouldn't be. We also don't want to clip points against each other so that we can increase the brightness when points stack. The same is true for point planets.
    • The other option would be to discard inside the fragment shader, but this can disable early-Z optimization
  • Because of this, we need to draw our layers after we draw the celestial bodies

I'm wondering whether the depthMask calls should be somewhere in the shader so that we don't need to make sure and track down everywhere that they're used.

I currently have the research app set up with a small example that you can use to test this out - zoom into the Moon (the center of the view) to see the behavior of the points.

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