Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Globe show skirts option #8489

Merged
merged 25 commits into from
Jan 6, 2020
Merged

Globe show skirts option #8489

merged 25 commits into from
Jan 6, 2020

Conversation

lilleyse
Copy link
Contributor

This PR adds a new property globe.showSkirts to allow showing/hiding terrain skirts dynamically. The main use case is to hide skirts when viewing terrain from below the surface like in the clipping planes screenshot below.

The two main changes in this PR are:

  • Change the draw command count when skirts are disabled so that skirts don't get rendered.
  • For heightmap terrain, force skirt indices to be added after grid indices rather than interleaved. This brought along some optimizations like being able to generate and cache edge indices outside of the web worker. Quantized mesh terrain didn't require as many changes since skirt indices are already after grid indices there.

Local sandcastle

terrain-above
terrain-below

CC @fredj @gberaudo

@cesium-concierge
Copy link

Thanks for the pull request @lilleyse!

  • ✔️ Signed CLA found.

Reviewers, don't forget to make sure that:

  • Cesium Viewer works.
  • Works in 2D/CV.
  • Works (or fails gracefully) in IE11.

@lilleyse lilleyse requested a review from IanLilleyT December 21, 2019 19:01
@IanLilleyT
Copy link
Contributor

The PR looks good. I submitted my own commit with minor code changes including a restructuring of how skirts are generated by HeightmapTessellator. @lilleyse and I decided to move this to the February release to give it more time to breathe.

Even though this PR is done, there are some ideas for further skirt improvements:

  • Ability to reverse the direction of skirts when underground. One approach would be to generate skirts pointing below and above, and render the correct set depending on where the camera is.
  • Move skirt creation to a common function. Right now heightmap, quantized mesh, etc do it themselves but the logic is roughly the same.
  • Make skirts contiguous in the index buffer by ordering west indices south to north, north indices west to east, east indices north to south, and south indices east to west). This could allow rendering skirts as a triangle strip, though it might not be worth the extra draw call.
  • Create skirts on the corners of tiles.

None of these are high priority at this time.

@IanLilleyT IanLilleyT merged commit 215a588 into master Jan 6, 2020
@emackey emackey deleted the show-skirts branch January 7, 2020 15:26
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.

3 participants