CesiumGS / CesiumGS/cesium

Globe translucency artifacts when the number of imagery layers exceeds the texture uniform limit

Open
#8,966 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

category - graphics category - terrain and imagery type - bug
Dominant language
JavaScript
Stars
15.8k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

From https://github.com/CesiumGS/cesium/pull/8726#issuecomment-618777065

When a terrain tile has more textures than the hardware-dependent texture uniform limit (16 on my machine) it issues multiple commands: an opaque command with the first 16 layers followed by blend commands with the rest of the texture layers. This doesn't work if the globe is translucent, especially if OIT is enabled, because the first and second commands will not blend properly with each other (OIT messes with the blend function) and there isn't a good time to apply to globe translucency. What you really want to do is blend all the globe commands normally then apply the translucency. The only solution that seems to work consistently in every scenario is to composite the texture layers to a new texture and use that in the globe shader, so that only one globe command gets issued into OIT.

The sandcastle below is using the ArcGIS terrain provider which, for whatever reason, uses > 16 textures for some tiles, maybe because of a misalignment in bing imagery / ArcGIS tiling schemes. This is where bluer areas appear - the first command will render most of sections of the tile and the second command will blend on top with the remaining sections, but since it applied globe translucency in the shader a layer that would normally be opaque becomes translucent and the base color shows through. This can be mitigated by (1) disabling OIT (2) setting the base color to TRANSPARENT.

Sandcastle
bug-arcgis

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the artifact with the linked Sandcastle using the ArcGIS terrain provider, more than 16 imagery layers, globe translucency, and OIT enabled. Trace how terrain texture layers become globe commands and how translucency and OIT affect those commands. Done means the layers composite correctly and globe translucency remains correct in all listed scenarios.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.