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

Perspective projection? #163

Closed
abbec opened this issue Jun 13, 2019 · 3 comments
Closed

Perspective projection? #163

abbec opened this issue Jun 13, 2019 · 3 comments

Comments

@abbec
Copy link

abbec commented Jun 13, 2019

Hi, this is not so much of an issue as it is a question.

In the mesh example here you use nalgebra to create a perspective projection matrix. Looking at the nalgebra code here though, it seems like this is creating a matrix for OpenGL NDC (depth -1 to 1), not Vulkan NDC (depth 0 to 1) and I thought gfx-hal was based on Vulkan conventions. Am I missing something here or how does this work? It seems like it would map objects on the near plane to -1 in clip space?

@zakarumych
Copy link
Member

This can actually be the case, but the only downside is that actual near plane becomes bit farther, so it is unnoticed in the example.

@abbec
Copy link
Author

abbec commented Jun 19, 2019

Okok, yeah it would not really cause any major issues of course, thanks!

@abbec abbec closed this as completed Jun 19, 2019
@zakarumych
Copy link
Member

zakarumych commented Jun 19, 2019

IIRC you can set whatever depth bounds in vulkan
gfx-hal sets [0, 1) by default.

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

No branches or pull requests

2 participants