Review Note

Last Update: 06/07/2024 05:46 PM

Current Deck: Technology::Godot::Godot Docs::Camera3D

Published

Currently Published Content


Content

Property Descriptions

CameraAttributes attributes

void set_attributes (value: CameraAttributes )

CameraAttributes get_attributes ()

The CameraAttributes to use for this camera.


Compositor compositor

void set_compositor (value: Compositor )

Compositor get_compositor ()

The Compositor to use for this camera.


int cull_mask = 1048575

void set_cull_mask (value: int )

int get_cull_mask ()

The culling mask that describes which VisualInstance3D.layers are rendered by this camera. By default, all 20 user-visible layers are rendered.

Note: Since the cull_mask allows for 32 layers to be stored in total, there are an additional 12 layers that are only used internally by the engine and aren't exposed in the editor. Setting cull_mask using a script allows you to toggle those reserved layers, which can be useful for editor plugins.

To adjust cull_mask more easily using a script, use get_cull_mask_value and set_cull_mask_value .

Note: VoxelGI , SDFGI and LightmapGI will always take all layers into account to determine what contributes to global illumination. If this is an issue, set GeometryInstance3D.gi_mode to GeometryInstance3D.GI_MODE_DISABLED for meshes and Light3D.light_bake_mode to Light3D.BAKE_DISABLED for lights to exclude them from global illumination.


bool current = false

void set_current (value: bool )

bool is_current ()

If true , the ancestor Viewport is currently using this camera.

If multiple cameras are in the scene, one will always be made current. For example, if two Camera3D nodes are present in the scene and only one is current, setting one camera's current to false will cause the other camera to be made current.


DopplerTracking doppler_tracking = 0

void set_doppler_tracking (value: DopplerTracking )

DopplerTracking get_doppler_tracking ()

If not DOPPLER_TRACKING_DISABLED , this camera will simulate the Doppler effect for objects changed in particular _process methods. See DopplerTracking for possible values.


Environment environment

void set_environment (value: Environment )

Environment get_environment ()

The Environment to use for this camera.


float far = 4000.0

void set_far (value: float )

float get_far ()

The distance to the far culling boundary for this camera relative to its local Z axis. Higher values allow the camera to see further away, while decreasing far can improve performance if it results in objects being partially or fully culled.


float fov = 75.0

void set_fov (value: float )

float get_fov ()

The camera's field of view angle (in degrees). Only applicable in perspective mode. Since keep_aspect locks one axis, fov sets the other axis' field of view angle.

For reference, the default vertical field of view value ( 75.0 ) is equivalent to a horizontal FOV of:

~91.31 degrees in a 4:3 viewport

~101.67 degrees in a 16:10 viewport

~107.51 degrees in a 16:9 viewport

~121.63 degrees in a 21:9 viewport


Vector2 frustum_offset = Vector2(0, 0)

void set_frustum_offset (value: Vector2 )

Vector2 get_frustum_offset ()

The camera's frustum offset. This can be changed from the default to create "tilted frustum" effects such as Y-shearing .

Note: Only effective if projection is PROJECTION_FRUSTUM .


float h_offset = 0.0

void set_h_offset (value: float )

float get_h_offset ()

The horizontal (X) offset of the camera viewport.


KeepAspect keep_aspect = 1

void set_keep_aspect_mode (value: KeepAspect )

KeepAspect get_keep_aspect_mode ()

The axis to lock during fov / size adjustments. Can be either KEEP_WIDTH or KEEP_HEIGHT .


float near = 0.05

void set_near (value: float )

float get_near ()

The distance to the near culling boundary for this camera relative to its local Z axis. Lower values allow the camera to see objects more up close to its origin, at the cost of lower precision across the entire range. Values lower than the default can lead to increased Z-fighting.


ProjectionType projection = 0

void set_projection (value: ProjectionType )

ProjectionType get_projection ()

The camera's projection mode. In PROJECTION_PERSPECTIVE mode, objects' Z distance from the camera's local space scales their perceived size.


float size = 1.0

void set_size (value: float )

float get_size ()

The camera's size in meters measured as the diameter of the width or height, depending on keep_aspect . Only applicable in orthogonal and frustum modes.


float v_offset = 0.0

void set_v_offset (value: float )

float get_v_offset ()

The vertical (Y) offset of the camera viewport.

Note
Mnemonics
Extra
Cloze99
{{c1::.}}

Current Tags:

Docs godot

Pending Suggestions


No pending suggestions for this note.