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

Add coordinate system diagrams and fix NDC to framebuffer equation #4641

Merged
merged 6 commits into from
May 17, 2024

Conversation

toji
Copy link
Member

@toji toji commented May 14, 2024

Fixes #4492

Updates the equation for transforming NDC coordinates to framebuffer coordinates to account for the necessary Y flip. Also, because I felt like it would be nice, I added a few diagrams to visually illustrate several of the coordinate systems. I also included a non-normative note to explain that WebGPU can treat either 0 or 1 as the zNear plane, depending on the render state used.

@toji toji requested review from kainino0x and jimblandy May 14, 2024 17:10
Copy link
Contributor

github-actions bot commented May 14, 2024

Previews, as seen when this build job started (88686ad):
WebGPU webgpu.idl | Explainer | Correspondence Reference
WGSL grammar.js | wgsl.lalr.txt

spec/img/framebuffer-coordinates.svg Outdated Show resolved Hide resolved
spec/index.bs Outdated Show resolved Hide resolved
spec/index.bs Outdated Show resolved Hide resolved
spec/index.bs Outdated Show resolved Hide resolved
spec/index.bs Outdated Show resolved Hide resolved
spec/index.bs Outdated Show resolved Hide resolved
spec/index.bs Show resolved Hide resolved
spec/img/uv-coordinates.svg Outdated Show resolved Hide resolved
spec/img/framebuffer-coordinates.svg Outdated Show resolved Hide resolved
Copy link
Contributor

@kainino0x kainino0x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

spec/index.bs Outdated Show resolved Hide resolved
Co-authored-by: Kai Ninomiya <kainino@chromium.org>
spec/index.bs Outdated Show resolved Hide resolved
spec/index.bs Outdated Show resolved Hide resolved
Co-authored-by: Kai Ninomiya <kainino@chromium.org>
@toji toji enabled auto-merge (squash) May 17, 2024 23:26
@toji toji merged commit 494eb33 into main May 17, 2024
4 checks passed
@kainino0x kainino0x deleted the coordinate-systems branch May 17, 2024 23:33
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.

Y orientation of viewport coordinates vs. NDC
2 participants