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

Rendering: non-standard projection matrix with non-full viewport does not render correctly #109

Closed
vjroba opened this issue Apr 4, 2024 · 2 comments

Comments

@vjroba
Copy link

vjroba commented Apr 4, 2024

When the camera's Projection Matrix is set and the Viewport Rect is not 0, 0, 1, 1, the image becomes distorted.
This file is an implementation of a type of FishTank VR or CAVE VR.
https://drive.google.com/file/d/1nxsJNRDQ0pjozQ3V22nco2ytjLXJn1LW/view?usp=sharing
Please load it into an empty BuiltIn PR project and open the GSTestScene scene.
The TestCamera scripts on Camera and Camera_half are setting the Projection Matrix to distort the view frustum so that it encompasses the entire Quad. The Viewport Rect for Camera is 0, 0, 1, 1, but for Camera_half, it is 0, 0, 0.5, 1, which results in a significant decrease in image quality for Camera_half.

I need to split the Viewport Rect in half and place two side by side to output side-by-side video for stereoscopic viewing. I would appreciate your help.
3dgs

@aras-p aras-p changed the title When the camera's Projection Matrix is set and the Viewport Rect is not 0, 0, 1, 1, the image becomes distorted. Rendering: non-standard projection matrix with non-full viewport does not render correctly Apr 4, 2024
@aras-p
Copy link
Owner

aras-p commented Apr 4, 2024

Yeah, quite likely this does not work. Someone would need to figure out how to do all the projection & splatting in screenspace math properly for that case. I very likely won't be doing this, but if someone figures out the required changes and contributes a fix, I'll consider merging it.

@vjroba
Copy link
Author

vjroba commented Apr 5, 2024

Thank you for your response. Given the situation, I will try to reimplement it by rendering to the RenderTexture with a standard viewport rect and then downsizing and redrawing it.

@vjroba vjroba closed this as completed Apr 5, 2024
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