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

Improvement and fix to view-proj matrix handling #4891

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

mvaligursky
Copy link
Contributor

@mvaligursky mvaligursky commented Nov 28, 2022

  • if renderTarget.flipY was set, we were y-flipping the view-proj matrix. This fix flips the proj matrix instead, and view-proj matrix just uses already flipped proj matrix. This causes proj matrix to be the same as the one used in view-proj matrix calculation.
  • added support for projection matrix range adjustment from internally used OpenGL style with depth in -1..1 range, to DirectX format used by WebGPU, with 0..1 range. This fixes othographic camera rendering examples, and also uses full range of depth for perspective camera / shadow maps.
  • slight cleanup of matrix evaluation / set up code as well
  • also, we don't call Device.clear unless any of the flags are set

@mvaligursky mvaligursky self-assigned this Nov 28, 2022
@mvaligursky mvaligursky merged commit 9696204 into main Nov 28, 2022
@mvaligursky mvaligursky deleted the mv-proj-mat-webgpu branch November 28, 2022 11:09
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.

2 participants