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

Check matrix multiplication in shaders #4250

Open
bagnell opened this issue Aug 29, 2016 · 1 comment · May be fixed by #12349 or #12367
Open

Check matrix multiplication in shaders #4250

bagnell opened this issue Aug 29, 2016 · 1 comment · May be fixed by #12349 or #12367
Labels
category - graphics good first issue An opportunity for first time contributors

Comments

@bagnell
Copy link
Contributor

bagnell commented Aug 29, 2016

Prevent possible precision errors when transforming vertices be multiple matrices.

Go through all of the shaders and change things like:

vec4 positionWC = czm_inverseView * positionEC;
vec4 positionMC = czm_inverseModel * positionWC;

to
vec4 positionMC = czm_inverseModelView * positionEC;

The only exception here is the projection matrix where we would want to do the opposite. Change
gl_Position = czm_modelViewProjection * position;
to

vec4 positionEC = czm_modelView * position;
gl_Position = czm_projection * positionEC;

For the first change see Creating Vast Game Worls by Emil Persson.
For the second change see Tightening the Precision of Perspective Rendering by Paul Upchurch and Mathieu Desbrun and Depth Precision Visualized by Nathan Reed.

@bagnell bagnell added the good first issue An opportunity for first time contributors label Aug 29, 2016
@GGajanan1
Copy link

Hi @bagnell
Can You assign me this task I am ready to contribute to this

@GGajanan1 GGajanan1 linked a pull request Dec 1, 2024 that will close this issue
6 tasks
@GGajanan1 GGajanan1 linked a pull request Dec 10, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category - graphics good first issue An opportunity for first time contributors
Projects
None yet
3 participants