-
-
Notifications
You must be signed in to change notification settings - Fork 16
Feature/custom ndc z range #177
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -18,7 +18,7 @@ namespace omath::frostbite_engine | |||||
| static Mat4X4 calc_view_matrix(const ViewAngles& angles, const Vector3<float>& cam_origin) noexcept; | ||||||
| [[nodiscard]] | ||||||
| static Mat4X4 calc_projection_matrix(const projection::FieldOfView& fov, const projection::ViewPort& view_port, | ||||||
| float near, float far) noexcept; | ||||||
| float near, float far, NDCDepthRange ndc_depth_range) noexcept; | ||||||
| }; | ||||||
|
|
||||||
| } // namespace omath::unreal_engine | ||||||
|
||||||
| } // namespace omath::unreal_engine | |
| } // namespace omath::frostbite_engine |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,5 +9,5 @@ | |||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| namespace omath::unreal_engine | ||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||
| using Camera = projection::Camera<Mat4X4, ViewAngles, CameraTrait>; | ||||||||||||||||||||||||||||||||||||
| using Camera = projection::Camera<Mat4X4, ViewAngles, CameraTrait, false, NDCDepthRange::ZERO_TO_ONE>; | ||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||
| using Camera = projection::Camera<Mat4X4, ViewAngles, CameraTrait, false, NDCDepthRange::ZERO_TO_ONE>; | |
| // Unreal Engine uses a [0, 1] depth range in NDC. Provide explicit camera aliases | |
| // for both supported conventions to avoid ambiguity: | |
| // | |
| // - CameraZO : NDCDepthRange::ZERO_TO_ONE (Unreal-style depth range) | |
| // - CameraNO : NDCDepthRange::NEGATIVE_ONE_TO_ONE (OpenGL-style depth range) | |
| // | |
| // NOTE: The generic `Camera` alias below currently maps to `CameraZO`, i.e. it uses | |
| // NDCDepthRange::ZERO_TO_ONE. In earlier versions, `Camera` used a different default | |
| // depth range (typically NEGATIVE_ONE_TO_ONE). Prefer using `CameraZO` or `CameraNO` | |
| // explicitly if your code depends on a particular NDC depth convention. | |
| using CameraZO = projection::Camera<Mat4X4, ViewAngles, CameraTrait, false, NDCDepthRange::ZERO_TO_ONE>; | |
| using CameraNO = projection::Camera<Mat4X4, ViewAngles, CameraTrait, false, NDCDepthRange::NEGATIVE_ONE_TO_ONE>; | |
| // Backward-compatible alias: keep `Camera` pointing to the ZERO_TO_ONE variant. | |
| using Camera = CameraZO; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The closing namespace comment is incorrect (it says omath::unity_engine but the header declares namespace omath::frostbite_engine). Please update the comment to match the actual namespace.