Skip to content

Offset vector primitive depth by zIndex - #14145

Draft
danielzhong wants to merge 4 commits into
DanielZ/feat/vector-style-compilefrom
DanielZ/feat/vector-zindex-depth-offset
Draft

danielzhong wants to merge 4 commits into
DanielZ/feat/vector-style-compilefrom
DanielZ/feat/vector-zindex-depth-offset

Conversation

@danielzhong

@danielzhong danielzhong commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Description

Ports the depth offset from #13515 to vector primitives.
image

  • Adds VectorPrimitive.zIndex. A non-zero value offsets the log depth written by the point shader (the existing POLYGON_OFFSET path in czm_writeLogDepth), so a primitive with a higher zIndex draws above coincident or nearly coincident geometry with a lower one, including across collections and styles.

  • SymbologyLayer.zIndex is applied to the primitives that VectorStyle creates.

The offset fixes z-fighting and overlapping layers. Features at clearly different depths still draw nearest on top; keeping labels above everything would need a separate screen-space pass. Points are offset only with a logarithmic depth buffer. Lines and polygons will follow once they have vector primitives; VectorPrimitive._addDepthOffset is shared for that.

Issue number and link

#13515

Testing plan

Sandcastle

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have updated the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

AI acknowledgment

  • I used AI to generate content in this PR
  • If yes, I have reviewed the AI-generated content before submitting

If yes, I used the following Tools(s) and/or Service(s):
GitHub Copilot

If yes, I used the following Model(s):
Claude Opus 5.5

@danielzhong danielzhong changed the title init Offset vector primitive depth by zIndex Dec 3, 2026
…ctor-zindex-depth-offset

# Conflicts:
#	packages/engine/Source/Scene/SymbologyLayer.js
#	packages/engine/Source/Scene/VectorPrimitive.js
#	packages/engine/Source/Scene/VectorStyle.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant