IssueRaiser

Add custom projection mode to Camera3D, make Camera3D store its CameraMatrix and expose CameraMatrix to user code

<!-- Please fill in *all* the questions below and don't remove any of them. Proposals not following the template below will be closed immediately. --> ### Describe the project you are working on I'm working on a portal plugin. ### Describe the problem or limitation you are having in your project I need to use oblique frustum projection to allow for the portals' cameras to clip content that's behind the portal plane. Which is currently impossible in Godot. ### Describe the feature / enhancement and how it helps to overcome the problem or limitation The enhancement would be to add a new projection mode, PROJECTION_CUSTOM to the Camera class, which would allow the developer to directly set the matrix to be used for projection. For my specific case, that would allow me to use oblique frustum projection. It would also address any other projection that any developer could want to use. And it would probably allow for some weird distortion effects as well. Also, if a new projection is added with a CameraMatrix exposed to the user, it would make sense to migrate the entire Camera class and camera rendering to work with a CameraMatrix object belonging to each Camera instead of calculating the matrices from the Cameras' parameters. ### Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams I think this can be done in a few steps: 1. Make CameraMatrix or other 4x4 matrix type available to user code 1. Register CameraMatrix so that it is accessibl

Posted by Astrono2 on May 11, 2021, 8:47 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments

github (Other)

Add custom projection mode to Camera3D, make Camera3D store its CameraMatrix and expose CameraMatrix to user code

Astrono2May 11, 2021, 8:47 PM

<!-- Please fill in *all* the questions below and don't remove any of them. Proposals not following the template below will be closed immediately. --> ### Describe the project you are working on I'm working on a portal plugin. ### Describe the problem or limitation you are having in your project I need to use oblique frustum projection to allow for the portals' cameras to clip content that's behind the portal plane. Which is currently impossible in Godot. ### Describe the feature / enhancement and how it helps to overcome the problem or limitation The enhancement would be to add a new projection mode, PROJECTION_CUSTOM to the Camera class, which would allow the developer to directly set the matrix to be used for projection. For my specific case, that would allow me to use oblique frustum projection. It would also address any other projection that any developer could want to use. And it would probably allow for some weird distortion effects as well. Also, if a new projection is added with a CameraMatrix exposed to the user, it would make sense to migrate the entire Camera class and camera rendering to work with a CameraMatrix object belonging to each Camera instead of calculating the matrices from the Cameras' parameters. ### Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams I think this can be done in a few steps: 1. Make CameraMatrix or other 4x4 matrix type available to user code 1. Register CameraMatrix so that it is accessibl

Comments (0)

No comments yet. Start the discussion.

Comment on this issue