Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Orthographic projection #2

Open
manuel-kroeter opened this issue Oct 27, 2018 · 2 comments
Open

Orthographic projection #2

manuel-kroeter opened this issue Oct 27, 2018 · 2 comments

Comments

@manuel-kroeter
Copy link

Hi Sebastian,

is it possible to use an orthographic projection instead of the perspective one? Do I need to change some shader code or is it enough to just change the projection matrix of the camera? If I have to change the shaders, can you shortly point out what needs to be changed?

Thanks in advance,
Manuel

@sebastianlipponer
Copy link
Owner

sebastianlipponer commented Oct 28, 2018

Hi Manuel,

since I did not look into the code for quite a while, I quickly tried this myself using the orthographic projection matrix:

m_projection_matrix <<
    2.0f / (r - l), 0.0f, 0.0f, -(r + l) / (r - l),
    0.0f, 2.0f / (t - b), 0.0f, -(t + b) / (t - b),
    0.0f, 0.0f, -2.0f / (f - n), -(f + n) / (f - n),
    0.0f, 0.0f, 0.0f, 1.0f;

Unfortunately, this seems to break the splat rendering code, since the results do not look correct. I am afraid this means you cannot get away without any changes to the shader code.

Start by checking whether the computation of gl_PointSize is still correct.

@manuel-kroeter
Copy link
Author

Yes, I also tried that projection matrix. With EWA filter turned off, it even results in an empty image. I also think that the attribute fragment shader needs to be changed. Can you maybe tell me what "w3d" and and "w2d" represents?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants