CesiumGS / CesiumGS/cesium

Custom Shaders: Providing global coordinates to the fragment shader

Open
#9,735 0 comments 0 reactions 0 assignees View on GitHub
category - custom shaders category - model/gltf
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

In #9725, I started adding a few different variables for position in different coordinate systems, `positionMC` for model space, `positionEC` for eye space.

But the tricky bit is handling global coordinates. there's a couple things to determine:

* Precision. The easier thing to implement is to only use 32-bit precision positions. Though this will cause precision issues when working on small scales. The more robust thing would be to split positions into high and low parts (see the article [Precisions, Precisions](https://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm)), though this requires more memory and calculations in the shader.
* Cartographic coordinates will require a bit of shader code for the ECEF -> cartographic coordinate converstion. Though the implementation depends on the answer to the first question

This goes beyond the scope of #9725 so I'm opening this issue for later.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing issue #9725 and the linked “Precisions, Precisions” article. The work is not ready for a straightforward implementation: first establish the precision strategy for global positions, then determine the shader approach for ECEF-to-cartographic conversion; done means those design questions are resolved and global coordinate variables are specified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.