1
0
Fork 0

Add info regarding missing depth correction to Camera3D.get_camera_projection documentation

This commit is contained in:
Jonathan Bernhard 2025-02-28 10:55:15 +01:00
parent 15ff450680
commit f237fddf1f
1 changed files with 13 additions and 0 deletions

View File

@ -21,6 +21,19 @@
<return type="Projection" />
<description>
Returns the projection matrix that this camera uses to render to its associated viewport. The camera must be part of the scene tree to function.
[b]Note:[/b] The resulting [Projection] does [i]not[/i] include the depth correction Godot's Vulkan renderer uses internally. To add depth correction, multiply the returned [Projection] by [method Projection.create_depth_correction] with [code]flip_y[/code] set to [code]true[/code]:
[codeblocks]
[gdscript]
var camera_projection: Projection = camera.get_camera_projection()
var correction: Projection = Projection.create_depth_correction(true)
var corrected_camera_projection = correction * camera_projection
[/gdscript]
[csharp]
var cameraProjection = camera.GetCameraProjection();
var correction = Projection.CreateDepthCorrection(true);
var correctedCameraProjection = correction * cameraProjection;
[/csharp]
[/codeblocks]
</description>
</method>
<method name="get_camera_rid" qualifiers="const">