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

Projection scale wrong for perspective projection? #2

Open
Erellu opened this issue May 5, 2023 · 1 comment · May be fixed by #3
Open

Projection scale wrong for perspective projection? #2

Erellu opened this issue May 5, 2023 · 1 comment · May be fixed by #3

Comments

@Erellu
Copy link

Erellu commented May 5, 2023

Currently, scale factor of the projection (used to compute radius to screen), is computed as float(height) / (tanf(projection.fov * 0.5f) * 2.0f);.

projection.fov is 45, so these are presumably degrees . However, tanf expects radians, both in C and in C++.

Shouldn't it be float(height) / (tanf(projection.fov * M_PI * 0.5f / 180.f) * 2.0f);?
If not, what is the meaning of the current value?

mp3guy added a commit to mp3guy/gl_ssao that referenced this issue Oct 18, 2023
@mp3guy mp3guy linked a pull request Oct 18, 2023 that will close this issue
@mp3guy
Copy link

mp3guy commented Oct 18, 2023

You're correct, I noticed this too.

mp3guy added a commit to mp3guy/gl_ssao that referenced this issue Oct 18, 2023
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 a pull request may close this issue.

2 participants