Skip to content

Latest commit

 

History

History
2351 lines (1335 loc) · 124 KB

class_environment.rst

File metadata and controls

2351 lines (1335 loc) · 124 KB
github_url

hide

Environment

Inherits: Resource<class_Resource> < RefCounted<class_RefCounted> < Object<class_Object>

Resource for environment nodes (like WorldEnvironment<class_WorldEnvironment>) that define multiple rendering options.

classref-introduction-group

Description

Resource for environment nodes (like WorldEnvironment<class_WorldEnvironment>) that define multiple environment operations (such as background Sky<class_Sky> or Color<class_Color>, ambient light, fog, depth-of-field...). These parameters affect the final render of the scene. The order of these operations is:

  • Depth of Field Blur
  • Glow
  • Tonemap (Auto Exposure)
  • Adjustments

classref-introduction-group

Tutorials

classref-reftable-group

Properties

float<class_float> adjustment_brightness<class_Environment_property_adjustment_brightness> 1.0
Texture<class_Texture> adjustment_color_correction<class_Environment_property_adjustment_color_correction>
float<class_float> adjustment_contrast<class_Environment_property_adjustment_contrast> 1.0
bool<class_bool> adjustment_enabled<class_Environment_property_adjustment_enabled> false
float<class_float> adjustment_saturation<class_Environment_property_adjustment_saturation> 1.0
Color<class_Color> ambient_light_color<class_Environment_property_ambient_light_color> Color(0, 0, 0, 1)
float<class_float> ambient_light_energy<class_Environment_property_ambient_light_energy> 1.0
float<class_float> ambient_light_sky_contribution<class_Environment_property_ambient_light_sky_contribution> 1.0
AmbientSource<enum_Environment_AmbientSource> ambient_light_source<class_Environment_property_ambient_light_source> 0
int<class_int> background_camera_feed_id<class_Environment_property_background_camera_feed_id> 1
int<class_int> background_canvas_max_layer<class_Environment_property_background_canvas_max_layer> 0
Color<class_Color> background_color<class_Environment_property_background_color> Color(0, 0, 0, 1)
float<class_float> background_energy_multiplier<class_Environment_property_background_energy_multiplier> 1.0
float<class_float> background_intensity<class_Environment_property_background_intensity> 30000.0
BGMode<enum_Environment_BGMode> background_mode<class_Environment_property_background_mode> 0
float<class_float> fog_aerial_perspective<class_Environment_property_fog_aerial_perspective> 0.0
float<class_float> fog_density<class_Environment_property_fog_density> 0.01
float<class_float> fog_depth_begin<class_Environment_property_fog_depth_begin> 10.0
float<class_float> fog_depth_curve<class_Environment_property_fog_depth_curve> 1.0
float<class_float> fog_depth_end<class_Environment_property_fog_depth_end> 100.0
bool<class_bool> fog_enabled<class_Environment_property_fog_enabled> false
float<class_float> fog_height<class_Environment_property_fog_height> 0.0
float<class_float> fog_height_density<class_Environment_property_fog_height_density> 0.0
Color<class_Color> fog_light_color<class_Environment_property_fog_light_color> Color(0.518, 0.553, 0.608, 1)
float<class_float> fog_light_energy<class_Environment_property_fog_light_energy> 1.0
FogMode<enum_Environment_FogMode> fog_mode<class_Environment_property_fog_mode> 0
float<class_float> fog_sky_affect<class_Environment_property_fog_sky_affect> 1.0
float<class_float> fog_sun_scatter<class_Environment_property_fog_sun_scatter> 0.0
GlowBlendMode<enum_Environment_GlowBlendMode> glow_blend_mode<class_Environment_property_glow_blend_mode> 2
float<class_float> glow_bloom<class_Environment_property_glow_bloom> 0.0
bool<class_bool> glow_enabled<class_Environment_property_glow_enabled> false
float<class_float> glow_hdr_luminance_cap<class_Environment_property_glow_hdr_luminance_cap> 12.0
float<class_float> glow_hdr_scale<class_Environment_property_glow_hdr_scale> 2.0
float<class_float> glow_hdr_threshold<class_Environment_property_glow_hdr_threshold> 1.0
float<class_float> glow_intensity<class_Environment_property_glow_intensity> 0.8
float<class_float> glow_levels/1<class_Environment_property_glow_levels/1> 0.0
float<class_float> glow_levels/2<class_Environment_property_glow_levels/2> 0.0
float<class_float> glow_levels/3<class_Environment_property_glow_levels/3> 1.0
float<class_float> glow_levels/4<class_Environment_property_glow_levels/4> 0.0
float<class_float> glow_levels/5<class_Environment_property_glow_levels/5> 1.0
float<class_float> glow_levels/6<class_Environment_property_glow_levels/6> 0.0
float<class_float> glow_levels/7<class_Environment_property_glow_levels/7> 0.0
Texture<class_Texture> glow_map<class_Environment_property_glow_map>
float<class_float> glow_map_strength<class_Environment_property_glow_map_strength> 0.8
float<class_float> glow_mix<class_Environment_property_glow_mix> 0.05
bool<class_bool> glow_normalized<class_Environment_property_glow_normalized> false
float<class_float> glow_strength<class_Environment_property_glow_strength> 1.0
ReflectionSource<enum_Environment_ReflectionSource> reflected_light_source<class_Environment_property_reflected_light_source> 0
float<class_float> sdfgi_bounce_feedback<class_Environment_property_sdfgi_bounce_feedback> 0.5
float<class_float> sdfgi_cascade0_distance<class_Environment_property_sdfgi_cascade0_distance> 12.8
int<class_int> sdfgi_cascades<class_Environment_property_sdfgi_cascades> 4
bool<class_bool> sdfgi_enabled<class_Environment_property_sdfgi_enabled> false
float<class_float> sdfgi_energy<class_Environment_property_sdfgi_energy> 1.0
float<class_float> sdfgi_max_distance<class_Environment_property_sdfgi_max_distance> 204.8
float<class_float> sdfgi_min_cell_size<class_Environment_property_sdfgi_min_cell_size> 0.2
float<class_float> sdfgi_normal_bias<class_Environment_property_sdfgi_normal_bias> 1.1
float<class_float> sdfgi_probe_bias<class_Environment_property_sdfgi_probe_bias> 1.1
bool<class_bool> sdfgi_read_sky_light<class_Environment_property_sdfgi_read_sky_light> true
bool<class_bool> sdfgi_use_occlusion<class_Environment_property_sdfgi_use_occlusion> false
SDFGIYScale<enum_Environment_SDFGIYScale> sdfgi_y_scale<class_Environment_property_sdfgi_y_scale> 1
Sky<class_Sky> sky<class_Environment_property_sky>
float<class_float> sky_custom_fov<class_Environment_property_sky_custom_fov> 0.0
Vector3<class_Vector3> sky_rotation<class_Environment_property_sky_rotation> Vector3(0, 0, 0)
float<class_float> ssao_ao_channel_affect<class_Environment_property_ssao_ao_channel_affect> 0.0
float<class_float> ssao_detail<class_Environment_property_ssao_detail> 0.5
bool<class_bool> ssao_enabled<class_Environment_property_ssao_enabled> false
float<class_float> ssao_horizon<class_Environment_property_ssao_horizon> 0.06
float<class_float> ssao_intensity<class_Environment_property_ssao_intensity> 2.0
float<class_float> ssao_light_affect<class_Environment_property_ssao_light_affect> 0.0
float<class_float> ssao_power<class_Environment_property_ssao_power> 1.5
float<class_float> ssao_radius<class_Environment_property_ssao_radius> 1.0
float<class_float> ssao_sharpness<class_Environment_property_ssao_sharpness> 0.98
bool<class_bool> ssil_enabled<class_Environment_property_ssil_enabled> false
float<class_float> ssil_intensity<class_Environment_property_ssil_intensity> 1.0
float<class_float> ssil_normal_rejection<class_Environment_property_ssil_normal_rejection> 1.0
float<class_float> ssil_radius<class_Environment_property_ssil_radius> 5.0
float<class_float> ssil_sharpness<class_Environment_property_ssil_sharpness> 0.98
float<class_float> ssr_depth_tolerance<class_Environment_property_ssr_depth_tolerance> 0.2
bool<class_bool> ssr_enabled<class_Environment_property_ssr_enabled> false
float<class_float> ssr_fade_in<class_Environment_property_ssr_fade_in> 0.15
float<class_float> ssr_fade_out<class_Environment_property_ssr_fade_out> 2.0
int<class_int> ssr_max_steps<class_Environment_property_ssr_max_steps> 64
float<class_float> tonemap_exposure<class_Environment_property_tonemap_exposure> 1.0
ToneMapper<enum_Environment_ToneMapper> tonemap_mode<class_Environment_property_tonemap_mode> 0
float<class_float> tonemap_white<class_Environment_property_tonemap_white> 1.0
Color<class_Color> volumetric_fog_albedo<class_Environment_property_volumetric_fog_albedo> Color(1, 1, 1, 1)
float<class_float> volumetric_fog_ambient_inject<class_Environment_property_volumetric_fog_ambient_inject> 0.0
float<class_float> volumetric_fog_anisotropy<class_Environment_property_volumetric_fog_anisotropy> 0.2
float<class_float> volumetric_fog_density<class_Environment_property_volumetric_fog_density> 0.05
float<class_float> volumetric_fog_detail_spread<class_Environment_property_volumetric_fog_detail_spread> 2.0
Color<class_Color> volumetric_fog_emission<class_Environment_property_volumetric_fog_emission> Color(0, 0, 0, 1)
float<class_float> volumetric_fog_emission_energy<class_Environment_property_volumetric_fog_emission_energy> 1.0
bool<class_bool> volumetric_fog_enabled<class_Environment_property_volumetric_fog_enabled> false
float<class_float> volumetric_fog_gi_inject<class_Environment_property_volumetric_fog_gi_inject> 1.0
float<class_float> volumetric_fog_length<class_Environment_property_volumetric_fog_length> 64.0
float<class_float> volumetric_fog_sky_affect<class_Environment_property_volumetric_fog_sky_affect> 1.0
float<class_float> volumetric_fog_temporal_reprojection_amount<class_Environment_property_volumetric_fog_temporal_reprojection_amount> 0.9
bool<class_bool> volumetric_fog_temporal_reprojection_enabled<class_Environment_property_volumetric_fog_temporal_reprojection_enabled> true

classref-reftable-group

Methods

float<class_float> get_glow_level<class_Environment_method_get_glow_level>(idx: int<class_int>) const (This method has no side effects. It doesn't modify any of the instance's member variables.)
void (No return value.) :ref:set_glow_level<class_Environment_method_set_glow_level>(idx: int<class_int>, intensity: float<class_float>)

classref-section-separator


classref-descriptions-group

Enumerations

classref-enumeration

enum BGMode:

classref-enumeration-constant

BGMode<enum_Environment_BGMode> BG_CLEAR_COLOR = 0

Clears the background using the clear color defined in ProjectSettings.rendering/environment/defaults/default_clear_color<class_ProjectSettings_property_rendering/environment/defaults/default_clear_color>.

classref-enumeration-constant

BGMode<enum_Environment_BGMode> BG_COLOR = 1

Clears the background using a custom clear color.

classref-enumeration-constant

BGMode<enum_Environment_BGMode> BG_SKY = 2

Displays a user-defined sky in the background.

classref-enumeration-constant

BGMode<enum_Environment_BGMode> BG_CANVAS = 3

Displays a CanvasLayer<class_CanvasLayer> in the background.

classref-enumeration-constant

BGMode<enum_Environment_BGMode> BG_KEEP = 4

Keeps on screen every pixel drawn in the background. This is the fastest background mode, but it can only be safely used in fully-interior scenes (no visible sky or sky reflections). If enabled in a scene where the background is visible, "ghost trail" artifacts will be visible when moving the camera.

classref-enumeration-constant

BGMode<enum_Environment_BGMode> BG_CAMERA_FEED = 5

Displays a camera feed in the background.

classref-enumeration-constant

BGMode<enum_Environment_BGMode> BG_MAX = 6

Represents the size of the BGMode<enum_Environment_BGMode> enum.

classref-item-separator


classref-enumeration

enum AmbientSource:

classref-enumeration-constant

AmbientSource<enum_Environment_AmbientSource> AMBIENT_SOURCE_BG = 0

Gather ambient light from whichever source is specified as the background.

classref-enumeration-constant

AmbientSource<enum_Environment_AmbientSource> AMBIENT_SOURCE_DISABLED = 1

Disable ambient light. This provides a slight performance boost over AMBIENT_SOURCE_SKY<class_Environment_constant_AMBIENT_SOURCE_SKY>.

classref-enumeration-constant

AmbientSource<enum_Environment_AmbientSource> AMBIENT_SOURCE_COLOR = 2

Specify a specific Color<class_Color> for ambient light. This provides a slight performance boost over AMBIENT_SOURCE_SKY<class_Environment_constant_AMBIENT_SOURCE_SKY>.

classref-enumeration-constant

AmbientSource<enum_Environment_AmbientSource> AMBIENT_SOURCE_SKY = 3

Gather ambient light from the Sky<class_Sky> regardless of what the background is.

classref-item-separator


classref-enumeration

enum ReflectionSource:

classref-enumeration-constant

ReflectionSource<enum_Environment_ReflectionSource> REFLECTION_SOURCE_BG = 0

Use the background for reflections.

classref-enumeration-constant

ReflectionSource<enum_Environment_ReflectionSource> REFLECTION_SOURCE_DISABLED = 1

Disable reflections. This provides a slight performance boost over other options.

classref-enumeration-constant

ReflectionSource<enum_Environment_ReflectionSource> REFLECTION_SOURCE_SKY = 2

Use the Sky<class_Sky> for reflections regardless of what the background is.

classref-item-separator


classref-enumeration

enum ToneMapper:

classref-enumeration-constant

ToneMapper<enum_Environment_ToneMapper> TONE_MAPPER_LINEAR = 0

Linear tonemapper operator. Reads the linear data and passes it on unmodified. This can cause bright lighting to look blown out, with noticeable clipping in the output colors.

classref-enumeration-constant

ToneMapper<enum_Environment_ToneMapper> TONE_MAPPER_REINHARDT = 1

Reinhardt tonemapper operator. Performs a variation on rendered pixels' colors by this formula: color = color / (1 + color). This avoids clipping bright highlights, but the resulting image can look a bit dull.

classref-enumeration-constant

ToneMapper<enum_Environment_ToneMapper> TONE_MAPPER_FILMIC = 2

Filmic tonemapper operator. This avoids clipping bright highlights, with a resulting image that usually looks more vivid than TONE_MAPPER_REINHARDT<class_Environment_constant_TONE_MAPPER_REINHARDT>.

classref-enumeration-constant

ToneMapper<enum_Environment_ToneMapper> TONE_MAPPER_ACES = 3

Use the Academy Color Encoding System tonemapper. ACES is slightly more expensive than other options, but it handles bright lighting in a more realistic fashion by desaturating it as it becomes brighter. ACES typically has a more contrasted output compared to TONE_MAPPER_REINHARDT<class_Environment_constant_TONE_MAPPER_REINHARDT> and TONE_MAPPER_FILMIC<class_Environment_constant_TONE_MAPPER_FILMIC>.

Note: This tonemapping operator is called "ACES Fitted" in Godot 3.x.

classref-item-separator


classref-enumeration

enum GlowBlendMode:

classref-enumeration-constant

GlowBlendMode<enum_Environment_GlowBlendMode> GLOW_BLEND_MODE_ADDITIVE = 0

Additive glow blending mode. Mostly used for particles, glows (bloom), lens flare, bright sources.

classref-enumeration-constant

GlowBlendMode<enum_Environment_GlowBlendMode> GLOW_BLEND_MODE_SCREEN = 1

Screen glow blending mode. Increases brightness, used frequently with bloom.

classref-enumeration-constant

GlowBlendMode<enum_Environment_GlowBlendMode> GLOW_BLEND_MODE_SOFTLIGHT = 2

Soft light glow blending mode. Modifies contrast, exposes shadows and highlights (vivid bloom).

classref-enumeration-constant

GlowBlendMode<enum_Environment_GlowBlendMode> GLOW_BLEND_MODE_REPLACE = 3

Replace glow blending mode. Replaces all pixels' color by the glow value. This can be used to simulate a full-screen blur effect by tweaking the glow parameters to match the original image's brightness.

classref-enumeration-constant

GlowBlendMode<enum_Environment_GlowBlendMode> GLOW_BLEND_MODE_MIX = 4

Mixes the glow with the underlying color to avoid increasing brightness as much while still maintaining a glow effect.

classref-item-separator


classref-enumeration

enum FogMode:

classref-enumeration-constant

FogMode<enum_Environment_FogMode> FOG_MODE_EXPONENTIAL = 0

Use a physically-based fog model defined primarily by fog density.

classref-enumeration-constant

FogMode<enum_Environment_FogMode> FOG_MODE_DEPTH = 1

Use a simple fog model defined by start and end positions and a custom curve. While not physically accurate, this model can be useful when you need more artistic control.

classref-item-separator


classref-enumeration

enum SDFGIYScale:

classref-enumeration-constant

SDFGIYScale<enum_Environment_SDFGIYScale> SDFGI_Y_SCALE_50_PERCENT = 0

Use 50% scale for SDFGI on the Y (vertical) axis. SDFGI cells will be twice as short as they are wide. This allows providing increased GI detail and reduced light leaking with thin floors and ceilings. This is usually the best choice for scenes that don't feature much verticality.

classref-enumeration-constant

SDFGIYScale<enum_Environment_SDFGIYScale> SDFGI_Y_SCALE_75_PERCENT = 1

Use 75% scale for SDFGI on the Y (vertical) axis. This is a balance between the 50% and 100% SDFGI Y scales.

classref-enumeration-constant

SDFGIYScale<enum_Environment_SDFGIYScale> SDFGI_Y_SCALE_100_PERCENT = 2

Use 100% scale for SDFGI on the Y (vertical) axis. SDFGI cells will be as tall as they are wide. This is usually the best choice for highly vertical scenes. The downside is that light leaking may become more noticeable with thin floors and ceilings.

classref-section-separator


classref-descriptions-group

Property Descriptions

classref-property

float<class_float> adjustment_brightness = 1.0

classref-property-setget

  • void (No return value.) set_adjustment_brightness(value: float<class_float>)
  • float<class_float> get_adjustment_brightness()

The global brightness value of the rendered scene. Effective only if adjustment_enabled<class_Environment_property_adjustment_enabled> is true.

classref-item-separator


classref-property

Texture<class_Texture> adjustment_color_correction

classref-property-setget

  • void (No return value.) set_adjustment_color_correction(value: Texture<class_Texture>)
  • Texture<class_Texture> get_adjustment_color_correction()

The Texture2D<class_Texture2D> or Texture3D<class_Texture3D> lookup table (LUT) to use for the built-in post-process color grading. Can use a GradientTexture1D<class_GradientTexture1D> for a 1-dimensional LUT, or a Texture3D<class_Texture3D> for a more complex LUT. Effective only if adjustment_enabled<class_Environment_property_adjustment_enabled> is true.

classref-item-separator


classref-property

float<class_float> adjustment_contrast = 1.0

classref-property-setget

  • void (No return value.) set_adjustment_contrast(value: float<class_float>)
  • float<class_float> get_adjustment_contrast()

The global contrast value of the rendered scene (default value is 1). Effective only if adjustment_enabled<class_Environment_property_adjustment_enabled> is true.

classref-item-separator


classref-property

bool<class_bool> adjustment_enabled = false

classref-property-setget

  • void (No return value.) set_adjustment_enabled(value: bool<class_bool>)
  • bool<class_bool> is_adjustment_enabled()

If true, enables the adjustment_* properties provided by this resource. If false, modifications to the adjustment_* properties will have no effect on the rendered scene.

Note: Adjustments are only supported in the Forward+ and Mobile rendering methods, not Compatibility.

classref-item-separator


classref-property

float<class_float> adjustment_saturation = 1.0

classref-property-setget

  • void (No return value.) set_adjustment_saturation(value: float<class_float>)
  • float<class_float> get_adjustment_saturation()

The global color saturation value of the rendered scene (default value is 1). Effective only if adjustment_enabled<class_Environment_property_adjustment_enabled> is true.

classref-item-separator


classref-property

Color<class_Color> ambient_light_color = Color(0, 0, 0, 1)

classref-property-setget

  • void (No return value.) set_ambient_light_color(value: Color<class_Color>)
  • Color<class_Color> get_ambient_light_color()

The ambient light's Color<class_Color>. Only effective if ambient_light_sky_contribution<class_Environment_property_ambient_light_sky_contribution> is lower than 1.0 (exclusive).

classref-item-separator


classref-property

float<class_float> ambient_light_energy = 1.0

classref-property-setget

  • void (No return value.) set_ambient_light_energy(value: float<class_float>)
  • float<class_float> get_ambient_light_energy()

The ambient light's energy. The higher the value, the stronger the light. Only effective if ambient_light_sky_contribution<class_Environment_property_ambient_light_sky_contribution> is lower than 1.0 (exclusive).

classref-item-separator


classref-property

float<class_float> ambient_light_sky_contribution = 1.0

classref-property-setget

  • void (No return value.) set_ambient_light_sky_contribution(value: float<class_float>)
  • float<class_float> get_ambient_light_sky_contribution()

Defines the amount of light that the sky brings on the scene. A value of 0.0 means that the sky's light emission has no effect on the scene illumination, thus all ambient illumination is provided by the ambient light. On the contrary, a value of 1.0 means that all the light that affects the scene is provided by the sky, thus the ambient light parameter has no effect on the scene.

Note: ambient_light_sky_contribution<class_Environment_property_ambient_light_sky_contribution> is internally clamped between 0.0 and 1.0 (inclusive).

classref-item-separator


classref-property

AmbientSource<enum_Environment_AmbientSource> ambient_light_source = 0

classref-property-setget

  • void (No return value.) set_ambient_source(value: AmbientSource<enum_Environment_AmbientSource>)
  • AmbientSource<enum_Environment_AmbientSource> get_ambient_source()

The ambient light source to use for rendering materials and global illumination.

classref-item-separator


classref-property

int<class_int> background_camera_feed_id = 1

classref-property-setget

  • void (No return value.) set_camera_feed_id(value: int<class_int>)
  • int<class_int> get_camera_feed_id()

The ID of the camera feed to show in the background.

classref-item-separator


classref-property

int<class_int> background_canvas_max_layer = 0

classref-property-setget

  • void (No return value.) set_canvas_max_layer(value: int<class_int>)
  • int<class_int> get_canvas_max_layer()

The maximum layer ID to display. Only effective when using the BG_CANVAS<class_Environment_constant_BG_CANVAS> background mode.

classref-item-separator


classref-property

Color<class_Color> background_color = Color(0, 0, 0, 1)

classref-property-setget

  • void (No return value.) set_bg_color(value: Color<class_Color>)
  • Color<class_Color> get_bg_color()

The Color<class_Color> displayed for clear areas of the scene. Only effective when using the BG_COLOR<class_Environment_constant_BG_COLOR> background mode.

classref-item-separator


classref-property

float<class_float> background_energy_multiplier = 1.0

classref-property-setget

  • void (No return value.) set_bg_energy_multiplier(value: float<class_float>)
  • float<class_float> get_bg_energy_multiplier()

Multiplier for background energy. Increase to make background brighter, decrease to make background dimmer.

classref-item-separator


classref-property

float<class_float> background_intensity = 30000.0

classref-property-setget

  • void (No return value.) set_bg_intensity(value: float<class_float>)
  • float<class_float> get_bg_intensity()

Luminance of background measured in nits (candela per square meter). Only used when ProjectSettings.rendering/lights_and_shadows/use_physical_light_units<class_ProjectSettings_property_rendering/lights_and_shadows/use_physical_light_units> is enabled. The default value is roughly equivalent to the sky at midday.

classref-item-separator


classref-property

BGMode<enum_Environment_BGMode> background_mode = 0

classref-property-setget

  • void (No return value.) set_background(value: BGMode<enum_Environment_BGMode>)
  • BGMode<enum_Environment_BGMode> get_background()

The background mode. See BGMode<enum_Environment_BGMode> for possible values.

classref-item-separator


classref-property

float<class_float> fog_aerial_perspective = 0.0

classref-property-setget

  • void (No return value.) set_fog_aerial_perspective(value: float<class_float>)
  • float<class_float> get_fog_aerial_perspective()

If set above 0.0 (exclusive), blends between the fog's color and the color of the background Sky<class_Sky>. This has a small performance cost when set above 0.0. Must have background_mode<class_Environment_property_background_mode> set to BG_SKY<class_Environment_constant_BG_SKY>.

This is useful to simulate aerial perspective in large scenes with low density fog. However, it is not very useful for high-density fog, as the sky will shine through. When set to 1.0, the fog color comes completely from the Sky<class_Sky>. If set to 0.0, aerial perspective is disabled.

classref-item-separator


classref-property

float<class_float> fog_density = 0.01

classref-property-setget

  • void (No return value.) set_fog_density(value: float<class_float>)
  • float<class_float> get_fog_density()

The fog density to be used. This is demonstrated in different ways depending on the fog_mode<class_Environment_property_fog_mode> mode chosen:

Exponential Fog Mode: Higher values result in denser fog. The fog rendering is exponential like in real life.

Depth Fog mode: The maximum intensity of the deep fog, effect will appear in the distance (relative to the camera). At 1.0 the fog will fully obscure the scene, at 0.0 the fog will not be visible.

classref-item-separator


classref-property

float<class_float> fog_depth_begin = 10.0

classref-property-setget

  • void (No return value.) set_fog_depth_begin(value: float<class_float>)
  • float<class_float> get_fog_depth_begin()

The fog's depth starting distance from the camera. Only available when fog_mode<class_Environment_property_fog_mode> is set to FOG_MODE_DEPTH<class_Environment_constant_FOG_MODE_DEPTH>.

classref-item-separator


classref-property

float<class_float> fog_depth_curve = 1.0

classref-property-setget

  • void (No return value.) set_fog_depth_curve(value: float<class_float>)
  • float<class_float> get_fog_depth_curve()

The fog depth's intensity curve. A number of presets are available in the Inspector by right-clicking the curve. Only available when fog_mode<class_Environment_property_fog_mode> is set to FOG_MODE_DEPTH<class_Environment_constant_FOG_MODE_DEPTH>.

classref-item-separator


classref-property

float<class_float> fog_depth_end = 100.0

classref-property-setget

  • void (No return value.) set_fog_depth_end(value: float<class_float>)
  • float<class_float> get_fog_depth_end()

The fog's depth end distance from the camera. If this value is set to 0, it will be equal to the current camera's Camera3D.far<class_Camera3D_property_far> value. Only available when fog_mode<class_Environment_property_fog_mode> is set to FOG_MODE_DEPTH<class_Environment_constant_FOG_MODE_DEPTH>.

classref-item-separator


classref-property

bool<class_bool> fog_enabled = false

classref-property-setget

  • void (No return value.) set_fog_enabled(value: bool<class_bool>)
  • bool<class_bool> is_fog_enabled()

If true, fog effects are enabled.

classref-item-separator


classref-property

float<class_float> fog_height = 0.0

classref-property-setget

  • void (No return value.) set_fog_height(value: float<class_float>)
  • float<class_float> get_fog_height()

The height at which the height fog effect begins.

classref-item-separator


classref-property

float<class_float> fog_height_density = 0.0

classref-property-setget

  • void (No return value.) set_fog_height_density(value: float<class_float>)
  • float<class_float> get_fog_height_density()

The density used to increase fog as height decreases. To make fog increase as height increases, use a negative value.

classref-item-separator


classref-property

Color<class_Color> fog_light_color = Color(0.518, 0.553, 0.608, 1)

classref-property-setget

  • void (No return value.) set_fog_light_color(value: Color<class_Color>)
  • Color<class_Color> get_fog_light_color()

The fog's color.

classref-item-separator


classref-property

float<class_float> fog_light_energy = 1.0

classref-property-setget

  • void (No return value.) set_fog_light_energy(value: float<class_float>)
  • float<class_float> get_fog_light_energy()

The fog's brightness. Higher values result in brighter fog.

classref-item-separator


classref-property

FogMode<enum_Environment_FogMode> fog_mode = 0

classref-property-setget

  • void (No return value.) set_fog_mode(value: FogMode<enum_Environment_FogMode>)
  • FogMode<enum_Environment_FogMode> get_fog_mode()

The fog mode. See FogMode<enum_Environment_FogMode> for possible values.

classref-item-separator


classref-property

float<class_float> fog_sky_affect = 1.0

classref-property-setget

  • void (No return value.) set_fog_sky_affect(value: float<class_float>)
  • float<class_float> get_fog_sky_affect()

The factor to use when affecting the sky with non-volumetric fog. 1.0 means that fog can fully obscure the sky. Lower values reduce the impact of fog on sky rendering, with 0.0 not affecting sky rendering at all.

Note: fog_sky_affect<class_Environment_property_fog_sky_affect> has no visual effect if fog_aerial_perspective<class_Environment_property_fog_aerial_perspective> is 1.0.

classref-item-separator


classref-property

float<class_float> fog_sun_scatter = 0.0

classref-property-setget

  • void (No return value.) set_fog_sun_scatter(value: float<class_float>)
  • float<class_float> get_fog_sun_scatter()

If set above 0.0, renders the scene's directional light(s) in the fog color depending on the view angle. This can be used to give the impression that the sun is "piercing" through the fog.

classref-item-separator


classref-property

GlowBlendMode<enum_Environment_GlowBlendMode> glow_blend_mode = 2

classref-property-setget

  • void (No return value.) set_glow_blend_mode(value: GlowBlendMode<enum_Environment_GlowBlendMode>)
  • GlowBlendMode<enum_Environment_GlowBlendMode> get_glow_blend_mode()

The glow blending mode.

Note: glow_blend_mode<class_Environment_property_glow_blend_mode> has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.

classref-item-separator


classref-property

float<class_float> glow_bloom = 0.0

classref-property-setget

  • void (No return value.) set_glow_bloom(value: float<class_float>)
  • float<class_float> get_glow_bloom()

The bloom's intensity. If set to a value higher than 0, this will make glow visible in areas darker than the glow_hdr_threshold<class_Environment_property_glow_hdr_threshold>.

classref-item-separator


classref-property

bool<class_bool> glow_enabled = false

classref-property-setget

  • void (No return value.) set_glow_enabled(value: bool<class_bool>)
  • bool<class_bool> is_glow_enabled()

If true, the glow effect is enabled. This simulates real world eye/camera behavior where bright pixels bleed onto surrounding pixels.

Note: When using the Mobile rendering method, glow looks different due to the lower dynamic range available in the Mobile rendering method.

Note: When using the Compatibility rendering method, glow uses a different implementation with some properties being unavailable and hidden from the inspector: glow_levels/*, glow_normalized<class_Environment_property_glow_normalized>, glow_strength<class_Environment_property_glow_strength>, glow_blend_mode<class_Environment_property_glow_blend_mode>, glow_mix<class_Environment_property_glow_mix>, glow_map<class_Environment_property_glow_map>, and glow_map_strength<class_Environment_property_glow_map_strength>. This implementation is optimized to run on low-end devices and is less flexible as a result.

classref-item-separator


classref-property

float<class_float> glow_hdr_luminance_cap = 12.0

classref-property-setget

  • void (No return value.) set_glow_hdr_luminance_cap(value: float<class_float>)
  • float<class_float> get_glow_hdr_luminance_cap()

The higher threshold of the HDR glow. Areas brighter than this threshold will be clamped for the purposes of the glow effect.

classref-item-separator


classref-property

float<class_float> glow_hdr_scale = 2.0

classref-property-setget

  • void (No return value.) set_glow_hdr_bleed_scale(value: float<class_float>)
  • float<class_float> get_glow_hdr_bleed_scale()

The bleed scale of the HDR glow.

classref-item-separator


classref-property

float<class_float> glow_hdr_threshold = 1.0

classref-property-setget

  • void (No return value.) set_glow_hdr_bleed_threshold(value: float<class_float>)
  • float<class_float> get_glow_hdr_bleed_threshold()

The lower threshold of the HDR glow. When using the Mobile rendering method (which only supports a lower dynamic range up to 2.0), this may need to be below 1.0 for glow to be visible. A value of 0.9 works well in this case. This value also needs to be decreased below 1.0 when using glow in 2D, as 2D rendering is performed in SDR.

classref-item-separator


classref-property

float<class_float> glow_intensity = 0.8

classref-property-setget

  • void (No return value.) set_glow_intensity(value: float<class_float>)
  • float<class_float> get_glow_intensity()

The overall brightness multiplier of the glow effect. When using the Mobile rendering method (which only supports a lower dynamic range up to 2.0), this should be increased to 1.5 to compensate.

classref-item-separator


classref-property

float<class_float> glow_levels/1 = 0.0

classref-property-setget

  • void (No return value.) set_glow_level(idx: int<class_int>, intensity: float<class_float>)
  • float<class_float> get_glow_level(idx: int<class_int>) const (This method has no side effects. It doesn't modify any of the instance's member variables.)

The intensity of the 1st level of glow. This is the most "local" level (least blurry).

Note: glow_levels/1<class_Environment_property_glow_levels/1> has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.

classref-item-separator


classref-property

float<class_float> glow_levels/2 = 0.0

classref-property-setget

  • void (No return value.) set_glow_level(idx: int<class_int>, intensity: float<class_float>)
  • float<class_float> get_glow_level(idx: int<class_int>) const (This method has no side effects. It doesn't modify any of the instance's member variables.)

The intensity of the 2nd level of glow.

Note: glow_levels/2<class_Environment_property_glow_levels/2> has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.

classref-item-separator


classref-property

float<class_float> glow_levels/3 = 1.0

classref-property-setget

  • void (No return value.) set_glow_level(idx: int<class_int>, intensity: float<class_float>)
  • float<class_float> get_glow_level(idx: int<class_int>) const (This method has no side effects. It doesn't modify any of the instance's member variables.)

The intensity of the 3rd level of glow.

Note: glow_levels/3<class_Environment_property_glow_levels/3> has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.

classref-item-separator


classref-property

float<class_float> glow_levels/4 = 0.0

classref-property-setget

  • void (No return value.) set_glow_level(idx: int<class_int>, intensity: float<class_float>)
  • float<class_float> get_glow_level(idx: int<class_int>) const (This method has no side effects. It doesn't modify any of the instance's member variables.)

The intensity of the 4th level of glow.

Note: glow_levels/4<class_Environment_property_glow_levels/4> has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.

classref-item-separator


classref-property

float<class_float> glow_levels/5 = 1.0

classref-property-setget

  • void (No return value.) set_glow_level(idx: int<class_int>, intensity: float<class_float>)
  • float<class_float> get_glow_level(idx: int<class_int>) const (This method has no side effects. It doesn't modify any of the instance's member variables.)

The intensity of the 5th level of glow.

Note: glow_levels/5<class_Environment_property_glow_levels/5> has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.

classref-item-separator


classref-property

float<class_float> glow_levels/6 = 0.0

classref-property-setget

  • void (No return value.) set_glow_level(idx: int<class_int>, intensity: float<class_float>)
  • float<class_float> get_glow_level(idx: int<class_int>) const (This method has no side effects. It doesn't modify any of the instance's member variables.)

The intensity of the 6th level of glow.

Note: glow_levels/6<class_Environment_property_glow_levels/6> has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.

classref-item-separator


classref-property

float<class_float> glow_levels/7 = 0.0

classref-property-setget

  • void (No return value.) set_glow_level(idx: int<class_int>, intensity: float<class_float>)
  • float<class_float> get_glow_level(idx: int<class_int>) const (This method has no side effects. It doesn't modify any of the instance's member variables.)

The intensity of the 7th level of glow. This is the most "global" level (blurriest).

Note: glow_levels/7<class_Environment_property_glow_levels/7> has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.

classref-item-separator


classref-property

Texture<class_Texture> glow_map

classref-property-setget

  • void (No return value.) set_glow_map(value: Texture<class_Texture>)
  • Texture<class_Texture> get_glow_map()

The texture that should be used as a glow map to multiply the resulting glow color according to glow_map_strength<class_Environment_property_glow_map_strength>. This can be used to create a "lens dirt" effect. The texture's RGB color channels are used for modulation, but the alpha channel is ignored.

Note: The texture will be stretched to fit the screen. Therefore, it's recommended to use a texture with an aspect ratio that matches your project's base aspect ratio (typically 16:9).

Note: glow_map<class_Environment_property_glow_map> has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.

classref-item-separator


classref-property

float<class_float> glow_map_strength = 0.8

classref-property-setget

  • void (No return value.) set_glow_map_strength(value: float<class_float>)
  • float<class_float> get_glow_map_strength()

How strong of an impact the glow_map<class_Environment_property_glow_map> should have on the overall glow effect. A strength of 0.0 means the glow map has no effect on the overall glow effect. A strength of 1.0 means the glow has a full effect on the overall glow effect (and can turn off glow entirely in specific areas of the screen if the glow map has black areas).

Note: glow_map_strength<class_Environment_property_glow_map_strength> has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.

classref-item-separator


classref-property

float<class_float> glow_mix = 0.05

classref-property-setget

  • void (No return value.) set_glow_mix(value: float<class_float>)
  • float<class_float> get_glow_mix()

When using the GLOW_BLEND_MODE_MIX<class_Environment_constant_GLOW_BLEND_MODE_MIX> glow_blend_mode<class_Environment_property_glow_blend_mode>, this controls how much the source image is blended with the glow layer. A value of 0.0 makes the glow rendering invisible, while a value of 1.0 is equivalent to GLOW_BLEND_MODE_REPLACE<class_Environment_constant_GLOW_BLEND_MODE_REPLACE>.

Note: glow_mix<class_Environment_property_glow_mix> has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.

classref-item-separator


classref-property

bool<class_bool> glow_normalized = false

classref-property-setget

  • void (No return value.) set_glow_normalized(value: bool<class_bool>)
  • bool<class_bool> is_glow_normalized()

If true, glow levels will be normalized so that summed together their intensities equal 1.0.

Note: glow_normalized<class_Environment_property_glow_normalized> has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.

classref-item-separator


classref-property

float<class_float> glow_strength = 1.0

classref-property-setget

  • void (No return value.) set_glow_strength(value: float<class_float>)
  • float<class_float> get_glow_strength()

The strength of the glow effect. This applies as the glow is blurred across the screen and increases the distance and intensity of the blur. When using the Mobile rendering method, this should be increased to compensate for the lower dynamic range.

Note: glow_strength<class_Environment_property_glow_strength> has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.

classref-item-separator


classref-property

ReflectionSource<enum_Environment_ReflectionSource> reflected_light_source = 0

classref-property-setget

  • void (No return value.) set_reflection_source(value: ReflectionSource<enum_Environment_ReflectionSource>)
  • ReflectionSource<enum_Environment_ReflectionSource> get_reflection_source()

The reflected (specular) light source.

classref-item-separator


classref-property

float<class_float> sdfgi_bounce_feedback = 0.5

classref-property-setget

  • void (No return value.) set_sdfgi_bounce_feedback(value: float<class_float>)
  • float<class_float> get_sdfgi_bounce_feedback()

The energy multiplier applied to light every time it bounces from a surface when using SDFGI. Values greater than 0.0 will simulate multiple bounces, resulting in a more realistic appearance. Increasing sdfgi_bounce_feedback<class_Environment_property_sdfgi_bounce_feedback> generally has no performance impact. See also sdfgi_energy<class_Environment_property_sdfgi_energy>.

Note: Values greater than 0.5 can cause infinite feedback loops and should be avoided in scenes with bright materials.

Note: If sdfgi_bounce_feedback<class_Environment_property_sdfgi_bounce_feedback> is 0.0, indirect lighting will not be represented in reflections as light will only bounce one time.

classref-item-separator


classref-property

float<class_float> sdfgi_cascade0_distance = 12.8

classref-property-setget

  • void (No return value.) set_sdfgi_cascade0_distance(value: float<class_float>)
  • float<class_float> get_sdfgi_cascade0_distance()

Note: This property is linked to sdfgi_min_cell_size<class_Environment_property_sdfgi_min_cell_size> and sdfgi_max_distance<class_Environment_property_sdfgi_max_distance>. Changing its value will automatically change those properties as well.

classref-item-separator


classref-property

int<class_int> sdfgi_cascades = 4

classref-property-setget

  • void (No return value.) set_sdfgi_cascades(value: int<class_int>)
  • int<class_int> get_sdfgi_cascades()

The number of cascades to use for SDFGI (between 1 and 8). A higher number of cascades allows displaying SDFGI further away while preserving detail up close, at the cost of performance. When using SDFGI on small-scale levels, sdfgi_cascades<class_Environment_property_sdfgi_cascades> can often be decreased between 1 and 4 to improve performance.

classref-item-separator


classref-property

bool<class_bool> sdfgi_enabled = false

classref-property-setget

  • void (No return value.) set_sdfgi_enabled(value: bool<class_bool>)
  • bool<class_bool> is_sdfgi_enabled()

If true, enables signed distance field global illumination for meshes that have their GeometryInstance3D.gi_mode<class_GeometryInstance3D_property_gi_mode> set to GeometryInstance3D.GI_MODE_STATIC<class_GeometryInstance3D_constant_GI_MODE_STATIC>. SDFGI is a real-time global illumination technique that works well with procedurally generated and user-built levels, including in situations where geometry is created during gameplay. The signed distance field is automatically generated around the camera as it moves. Dynamic lights are supported, but dynamic occluders and emissive surfaces are not.

Note: SDFGI is only supported in the Forward+ rendering method, not Mobile or Compatibility.

Performance: SDFGI is relatively demanding on the GPU and is not suited to low-end hardware such as integrated graphics (consider LightmapGI<class_LightmapGI> instead). To improve SDFGI performance, enable ProjectSettings.rendering/global_illumination/gi/use_half_resolution<class_ProjectSettings_property_rendering/global_illumination/gi/use_half_resolution> in the Project Settings.

Note: Meshes should have sufficiently thick walls to avoid light leaks (avoid one-sided walls). For interior levels, enclose your level geometry in a sufficiently large box and bridge the loops to close the mesh.

classref-item-separator


classref-property

float<class_float> sdfgi_energy = 1.0

classref-property-setget

  • void (No return value.) set_sdfgi_energy(value: float<class_float>)
  • float<class_float> get_sdfgi_energy()

The energy multiplier to use for SDFGI. Higher values will result in brighter indirect lighting and reflections. See also sdfgi_bounce_feedback<class_Environment_property_sdfgi_bounce_feedback>.

classref-item-separator


classref-property

float<class_float> sdfgi_max_distance = 204.8

classref-property-setget

  • void (No return value.) set_sdfgi_max_distance(value: float<class_float>)
  • float<class_float> get_sdfgi_max_distance()

The maximum distance at which SDFGI is visible. Beyond this distance, environment lighting or other sources of GI such as ReflectionProbe<class_ReflectionProbe> will be used as a fallback.

Note: This property is linked to sdfgi_min_cell_size<class_Environment_property_sdfgi_min_cell_size> and sdfgi_cascade0_distance<class_Environment_property_sdfgi_cascade0_distance>. Changing its value will automatically change those properties as well.

classref-item-separator


classref-property

float<class_float> sdfgi_min_cell_size = 0.2

classref-property-setget

  • void (No return value.) set_sdfgi_min_cell_size(value: float<class_float>)
  • float<class_float> get_sdfgi_min_cell_size()

The cell size to use for the closest SDFGI cascade (in 3D units). Lower values allow SDFGI to be more precise up close, at the cost of making SDFGI updates more demanding. This can cause stuttering when the camera moves fast. Higher values allow SDFGI to cover more ground, while also reducing the performance impact of SDFGI updates.

Note: This property is linked to sdfgi_max_distance<class_Environment_property_sdfgi_max_distance> and sdfgi_cascade0_distance<class_Environment_property_sdfgi_cascade0_distance>. Changing its value will automatically change those properties as well.

classref-item-separator


classref-property

float<class_float> sdfgi_normal_bias = 1.1

classref-property-setget

  • void (No return value.) set_sdfgi_normal_bias(value: float<class_float>)
  • float<class_float> get_sdfgi_normal_bias()

The normal bias to use for SDFGI probes. Increasing this value can reduce visible streaking artifacts on sloped surfaces, at the cost of increased light leaking.

classref-item-separator


classref-property

float<class_float> sdfgi_probe_bias = 1.1

classref-property-setget

  • void (No return value.) set_sdfgi_probe_bias(value: float<class_float>)
  • float<class_float> get_sdfgi_probe_bias()

The constant bias to use for SDFGI probes. Increasing this value can reduce visible streaking artifacts on sloped surfaces, at the cost of increased light leaking.

classref-item-separator


classref-property

bool<class_bool> sdfgi_read_sky_light = true

classref-property-setget

  • void (No return value.) set_sdfgi_read_sky_light(value: bool<class_bool>)
  • bool<class_bool> is_sdfgi_reading_sky_light()

If true, SDFGI takes the environment lighting into account. This should be set to false for interior scenes.

classref-item-separator


classref-property

bool<class_bool> sdfgi_use_occlusion = false

classref-property-setget

  • void (No return value.) set_sdfgi_use_occlusion(value: bool<class_bool>)
  • bool<class_bool> is_sdfgi_using_occlusion()

If true, SDFGI uses an occlusion detection approach to reduce light leaking. Occlusion may however introduce dark blotches in certain spots, which may be undesired in mostly outdoor scenes. sdfgi_use_occlusion<class_Environment_property_sdfgi_use_occlusion> has a performance impact and should only be enabled when needed.

classref-item-separator


classref-property

SDFGIYScale<enum_Environment_SDFGIYScale> sdfgi_y_scale = 1

classref-property-setget

  • void (No return value.) set_sdfgi_y_scale(value: SDFGIYScale<enum_Environment_SDFGIYScale>)
  • SDFGIYScale<enum_Environment_SDFGIYScale> get_sdfgi_y_scale()

The Y scale to use for SDFGI cells. Lower values will result in SDFGI cells being packed together more closely on the Y axis. This is used to balance between quality and covering a lot of vertical ground. sdfgi_y_scale<class_Environment_property_sdfgi_y_scale> should be set depending on how vertical your scene is (and how fast your camera may move on the Y axis).

classref-item-separator


classref-property

Sky<class_Sky> sky

classref-property-setget

  • void (No return value.) set_sky(value: Sky<class_Sky>)
  • Sky<class_Sky> get_sky()

The Sky<class_Sky> resource used for this Environment.

classref-item-separator


classref-property

float<class_float> sky_custom_fov = 0.0

classref-property-setget

  • void (No return value.) set_sky_custom_fov(value: float<class_float>)
  • float<class_float> get_sky_custom_fov()

If set to a value greater than 0.0, overrides the field of view to use for sky rendering. If set to 0.0, the same FOV as the current Camera3D<class_Camera3D> is used for sky rendering.

classref-item-separator


classref-property

Vector3<class_Vector3> sky_rotation = Vector3(0, 0, 0)

classref-property-setget

  • void (No return value.) set_sky_rotation(value: Vector3<class_Vector3>)
  • Vector3<class_Vector3> get_sky_rotation()

The rotation to use for sky rendering.

classref-item-separator


classref-property

float<class_float> ssao_ao_channel_affect = 0.0

classref-property-setget

  • void (No return value.) set_ssao_ao_channel_affect(value: float<class_float>)
  • float<class_float> get_ssao_ao_channel_affect()

The screen-space ambient occlusion intensity on materials that have an AO texture defined. Values higher than 0 will make the SSAO effect visible in areas darkened by AO textures.

classref-item-separator


classref-property

float<class_float> ssao_detail = 0.5

classref-property-setget

  • void (No return value.) set_ssao_detail(value: float<class_float>)
  • float<class_float> get_ssao_detail()

Sets the strength of the additional level of detail for the screen-space ambient occlusion effect. A high value makes the detail pass more prominent, but it may contribute to aliasing in your final image.

classref-item-separator


classref-property

bool<class_bool> ssao_enabled = false

classref-property-setget

  • void (No return value.) set_ssao_enabled(value: bool<class_bool>)
  • bool<class_bool> is_ssao_enabled()

If true, the screen-space ambient occlusion effect is enabled. This darkens objects' corners and cavities to simulate ambient light not reaching the entire object as in real life. This works well for small, dynamic objects, but baked lighting or ambient occlusion textures will do a better job at displaying ambient occlusion on large static objects. Godot uses a form of SSAO called Adaptive Screen Space Ambient Occlusion which is itself a form of Horizon Based Ambient Occlusion.

Note: SSAO is only supported in the Forward+ rendering method, not Mobile or Compatibility.

classref-item-separator


classref-property

float<class_float> ssao_horizon = 0.06

classref-property-setget

  • void (No return value.) set_ssao_horizon(value: float<class_float>)
  • float<class_float> get_ssao_horizon()

The threshold for considering whether a given point on a surface is occluded or not represented as an angle from the horizon mapped into the 0.0-1.0 range. A value of 1.0 results in no occlusion.

classref-item-separator


classref-property

float<class_float> ssao_intensity = 2.0

classref-property-setget

  • void (No return value.) set_ssao_intensity(value: float<class_float>)
  • float<class_float> get_ssao_intensity()

The primary screen-space ambient occlusion intensity. Acts as a multiplier for the screen-space ambient occlusion effect. A higher value results in darker occlusion.

classref-item-separator


classref-property

float<class_float> ssao_light_affect = 0.0

classref-property-setget

  • void (No return value.) set_ssao_direct_light_affect(value: float<class_float>)
  • float<class_float> get_ssao_direct_light_affect()

The screen-space ambient occlusion intensity in direct light. In real life, ambient occlusion only applies to indirect light, which means its effects can't be seen in direct light. Values higher than 0 will make the SSAO effect visible in direct light.

classref-item-separator


classref-property

float<class_float> ssao_power = 1.5

classref-property-setget

  • void (No return value.) set_ssao_power(value: float<class_float>)
  • float<class_float> get_ssao_power()

The distribution of occlusion. A higher value results in darker occlusion, similar to ssao_intensity<class_Environment_property_ssao_intensity>, but with a sharper falloff.

classref-item-separator


classref-property

float<class_float> ssao_radius = 1.0

classref-property-setget

  • void (No return value.) set_ssao_radius(value: float<class_float>)
  • float<class_float> get_ssao_radius()

The distance at which objects can occlude each other when calculating screen-space ambient occlusion. Higher values will result in occlusion over a greater distance at the cost of performance and quality.

classref-item-separator


classref-property

float<class_float> ssao_sharpness = 0.98

classref-property-setget

  • void (No return value.) set_ssao_sharpness(value: float<class_float>)
  • float<class_float> get_ssao_sharpness()

The amount that the screen-space ambient occlusion effect is allowed to blur over the edges of objects. Setting too high will result in aliasing around the edges of objects. Setting too low will make object edges appear blurry.

classref-item-separator


classref-property

bool<class_bool> ssil_enabled = false

classref-property-setget

  • void (No return value.) set_ssil_enabled(value: bool<class_bool>)
  • bool<class_bool> is_ssil_enabled()

If true, the screen-space indirect lighting effect is enabled. Screen space indirect lighting is a form of indirect lighting that allows diffuse light to bounce between nearby objects. Screen-space indirect lighting works very similarly to screen-space ambient occlusion, in that it only affects a limited range. It is intended to be used along with a form of proper global illumination like SDFGI or VoxelGI<class_VoxelGI>. Screen-space indirect lighting is not affected by individual light's Light3D.light_indirect_energy<class_Light3D_property_light_indirect_energy>.

Note: SSIL is only supported in the Forward+ rendering method, not Mobile or Compatibility.

classref-item-separator


classref-property

float<class_float> ssil_intensity = 1.0

classref-property-setget

  • void (No return value.) set_ssil_intensity(value: float<class_float>)
  • float<class_float> get_ssil_intensity()

The brightness multiplier for the screen-space indirect lighting effect. A higher value will result in brighter light.

classref-item-separator


classref-property

float<class_float> ssil_normal_rejection = 1.0

classref-property-setget

  • void (No return value.) set_ssil_normal_rejection(value: float<class_float>)
  • float<class_float> get_ssil_normal_rejection()

Amount of normal rejection used when calculating screen-space indirect lighting. Normal rejection uses the normal of a given sample point to reject samples that are facing away from the current pixel. Normal rejection is necessary to avoid light leaking when only one side of an object is illuminated. However, normal rejection can be disabled if light leaking is desirable, such as when the scene mostly contains emissive objects that emit light from faces that cannot be seen from the camera.

classref-item-separator


classref-property

float<class_float> ssil_radius = 5.0

classref-property-setget

  • void (No return value.) set_ssil_radius(value: float<class_float>)
  • float<class_float> get_ssil_radius()

The distance that bounced lighting can travel when using the screen space indirect lighting effect. A larger value will result in light bouncing further in a scene, but may result in under-sampling artifacts which look like long spikes surrounding light sources.

classref-item-separator


classref-property

float<class_float> ssil_sharpness = 0.98

classref-property-setget

  • void (No return value.) set_ssil_sharpness(value: float<class_float>)
  • float<class_float> get_ssil_sharpness()

The amount that the screen-space indirect lighting effect is allowed to blur over the edges of objects. Setting too high will result in aliasing around the edges of objects. Setting too low will make object edges appear blurry.

classref-item-separator


classref-property

float<class_float> ssr_depth_tolerance = 0.2

classref-property-setget

  • void (No return value.) set_ssr_depth_tolerance(value: float<class_float>)
  • float<class_float> get_ssr_depth_tolerance()

The depth tolerance for screen-space reflections.

classref-item-separator


classref-property

bool<class_bool> ssr_enabled = false

classref-property-setget

  • void (No return value.) set_ssr_enabled(value: bool<class_bool>)
  • bool<class_bool> is_ssr_enabled()

If true, screen-space reflections are enabled. Screen-space reflections are more accurate than reflections from VoxelGI<class_VoxelGI>s or ReflectionProbe<class_ReflectionProbe>s, but are slower and can't reflect surfaces occluded by others.

Note: SSR is only supported in the Forward+ rendering method, not Mobile or Compatibility.

classref-item-separator


classref-property

float<class_float> ssr_fade_in = 0.15

classref-property-setget

  • void (No return value.) set_ssr_fade_in(value: float<class_float>)
  • float<class_float> get_ssr_fade_in()

The fade-in distance for screen-space reflections. Affects the area from the reflected material to the screen-space reflection. Only positive values are valid (negative values will be clamped to 0.0).

classref-item-separator


classref-property

float<class_float> ssr_fade_out = 2.0

classref-property-setget

  • void (No return value.) set_ssr_fade_out(value: float<class_float>)
  • float<class_float> get_ssr_fade_out()

The fade-out distance for screen-space reflections. Affects the area from the screen-space reflection to the "global" reflection. Only positive values are valid (negative values will be clamped to 0.0).

classref-item-separator


classref-property

int<class_int> ssr_max_steps = 64

classref-property-setget

  • void (No return value.) set_ssr_max_steps(value: int<class_int>)
  • int<class_int> get_ssr_max_steps()

The maximum number of steps for screen-space reflections. Higher values are slower.

classref-item-separator


classref-property

float<class_float> tonemap_exposure = 1.0

classref-property-setget

  • void (No return value.) set_tonemap_exposure(value: float<class_float>)
  • float<class_float> get_tonemap_exposure()

The default exposure used for tonemapping. Higher values result in a brighter image. See also tonemap_white<class_Environment_property_tonemap_white>.

classref-item-separator


classref-property

ToneMapper<enum_Environment_ToneMapper> tonemap_mode = 0

classref-property-setget

  • void (No return value.) set_tonemapper(value: ToneMapper<enum_Environment_ToneMapper>)
  • ToneMapper<enum_Environment_ToneMapper> get_tonemapper()

The tonemapping mode to use. Tonemapping is the process that "converts" HDR values to be suitable for rendering on an LDR display. (Godot doesn't support rendering on HDR displays yet.)

classref-item-separator


classref-property

float<class_float> tonemap_white = 1.0

classref-property-setget

  • void (No return value.) set_tonemap_white(value: float<class_float>)
  • float<class_float> get_tonemap_white()

The white reference value for tonemapping (also called "whitepoint"). Higher values can make highlights look less blown out, and will also slightly darken the whole scene as a result. Only effective if the tonemap_mode<class_Environment_property_tonemap_mode> isn't set to TONE_MAPPER_LINEAR<class_Environment_constant_TONE_MAPPER_LINEAR>. See also tonemap_exposure<class_Environment_property_tonemap_exposure>.

classref-item-separator


classref-property

Color<class_Color> volumetric_fog_albedo = Color(1, 1, 1, 1)

classref-property-setget

  • void (No return value.) set_volumetric_fog_albedo(value: Color<class_Color>)
  • Color<class_Color> get_volumetric_fog_albedo()

The Color<class_Color> of the volumetric fog when interacting with lights. Mist and fog have an albedo close to Color(1, 1, 1, 1) while smoke has a darker albedo.

classref-item-separator


classref-property

float<class_float> volumetric_fog_ambient_inject = 0.0

classref-property-setget

  • void (No return value.) set_volumetric_fog_ambient_inject(value: float<class_float>)
  • float<class_float> get_volumetric_fog_ambient_inject()

Scales the strength of ambient light used in the volumetric fog. A value of 0.0 means that ambient light will not impact the volumetric fog. volumetric_fog_ambient_inject<class_Environment_property_volumetric_fog_ambient_inject> has a small performance cost when set above 0.0.

Note: This has no visible effect if volumetric_fog_density<class_Environment_property_volumetric_fog_density> is 0.0 or if volumetric_fog_albedo<class_Environment_property_volumetric_fog_albedo> is a fully black color.

classref-item-separator


classref-property

float<class_float> volumetric_fog_anisotropy = 0.2

classref-property-setget

  • void (No return value.) set_volumetric_fog_anisotropy(value: float<class_float>)
  • float<class_float> get_volumetric_fog_anisotropy()

The direction of scattered light as it goes through the volumetric fog. A value close to 1.0 means almost all light is scattered forward. A value close to 0.0 means light is scattered equally in all directions. A value close to -1.0 means light is scattered mostly backward. Fog and mist scatter light slightly forward, while smoke scatters light equally in all directions.

classref-item-separator


classref-property

float<class_float> volumetric_fog_density = 0.05

classref-property-setget

  • void (No return value.) set_volumetric_fog_density(value: float<class_float>)
  • float<class_float> get_volumetric_fog_density()

The base exponential density of the volumetric fog. Set this to the lowest density you want to have globally. FogVolume<class_FogVolume>s can be used to add to or subtract from this density in specific areas. Fog rendering is exponential as in real life.

A value of 0.0 disables global volumetric fog while allowing FogVolume<class_FogVolume>s to display volumetric fog in specific areas.

To make volumetric fog work as a volumetric lighting solution, set volumetric_fog_density<class_Environment_property_volumetric_fog_density> to the lowest non-zero value (0.0001) then increase lights' Light3D.light_volumetric_fog_energy<class_Light3D_property_light_volumetric_fog_energy> to values between 10000 and 100000 to compensate for the very low density.

classref-item-separator


classref-property

float<class_float> volumetric_fog_detail_spread = 2.0

classref-property-setget

  • void (No return value.) set_volumetric_fog_detail_spread(value: float<class_float>)
  • float<class_float> get_volumetric_fog_detail_spread()

The distribution of size down the length of the froxel buffer. A higher value compresses the froxels closer to the camera and places more detail closer to the camera.

classref-item-separator


classref-property

Color<class_Color> volumetric_fog_emission = Color(0, 0, 0, 1)

classref-property-setget

  • void (No return value.) set_volumetric_fog_emission(value: Color<class_Color>)
  • Color<class_Color> get_volumetric_fog_emission()

The emitted light from the volumetric fog. Even with emission, volumetric fog will not cast light onto other surfaces. Emission is useful to establish an ambient color. As the volumetric fog effect uses single-scattering only, fog tends to need a little bit of emission to soften the harsh shadows.

classref-item-separator


classref-property

float<class_float> volumetric_fog_emission_energy = 1.0

classref-property-setget

  • void (No return value.) set_volumetric_fog_emission_energy(value: float<class_float>)
  • float<class_float> get_volumetric_fog_emission_energy()

The brightness of the emitted light from the volumetric fog.

classref-item-separator


classref-property

bool<class_bool> volumetric_fog_enabled = false

classref-property-setget

  • void (No return value.) set_volumetric_fog_enabled(value: bool<class_bool>)
  • bool<class_bool> is_volumetric_fog_enabled()

Enables the volumetric fog effect. Volumetric fog uses a screen-aligned froxel buffer to calculate accurate volumetric scattering in the short to medium range. Volumetric fog interacts with FogVolume<class_FogVolume>s and lights to calculate localized and global fog. Volumetric fog uses a PBR single-scattering model based on extinction, scattering, and emission which it exposes to users as density, albedo, and emission.

Note: Volumetric fog is only supported in the Forward+ rendering method, not Mobile or Compatibility.

classref-item-separator


classref-property

float<class_float> volumetric_fog_gi_inject = 1.0

classref-property-setget

  • void (No return value.) set_volumetric_fog_gi_inject(value: float<class_float>)
  • float<class_float> get_volumetric_fog_gi_inject()

Scales the strength of Global Illumination used in the volumetric fog's albedo color. A value of 0.0 means that Global Illumination will not impact the volumetric fog. volumetric_fog_gi_inject<class_Environment_property_volumetric_fog_gi_inject> has a small performance cost when set above 0.0.

Note: This has no visible effect if volumetric_fog_density<class_Environment_property_volumetric_fog_density> is 0.0 or if volumetric_fog_albedo<class_Environment_property_volumetric_fog_albedo> is a fully black color.

Note: Only VoxelGI<class_VoxelGI> and SDFGI (sdfgi_enabled<class_Environment_property_sdfgi_enabled>) are taken into account when using volumetric_fog_gi_inject<class_Environment_property_volumetric_fog_gi_inject>. Global illumination from LightmapGI<class_LightmapGI>, ReflectionProbe<class_ReflectionProbe> and SSIL (see ssil_enabled<class_Environment_property_ssil_enabled>) will be ignored by volumetric fog.

classref-item-separator


classref-property

float<class_float> volumetric_fog_length = 64.0

classref-property-setget

  • void (No return value.) set_volumetric_fog_length(value: float<class_float>)
  • float<class_float> get_volumetric_fog_length()

The distance over which the volumetric fog is computed. Increase to compute fog over a greater range, decrease to add more detail when a long range is not needed. For best quality fog, keep this as low as possible. See also ProjectSettings.rendering/environment/volumetric_fog/volume_depth<class_ProjectSettings_property_rendering/environment/volumetric_fog/volume_depth>.

classref-item-separator


classref-property

float<class_float> volumetric_fog_sky_affect = 1.0

classref-property-setget

  • void (No return value.) set_volumetric_fog_sky_affect(value: float<class_float>)
  • float<class_float> get_volumetric_fog_sky_affect()

The factor to use when affecting the sky with volumetric fog. 1.0 means that volumetric fog can fully obscure the sky. Lower values reduce the impact of volumetric fog on sky rendering, with 0.0 not affecting sky rendering at all.

Note: volumetric_fog_sky_affect<class_Environment_property_volumetric_fog_sky_affect> also affects FogVolume<class_FogVolume>s, even if volumetric_fog_density<class_Environment_property_volumetric_fog_density> is 0.0. If you notice FogVolume<class_FogVolume>s are disappearing when looking towards the sky, set volumetric_fog_sky_affect<class_Environment_property_volumetric_fog_sky_affect> to 1.0.

classref-item-separator


classref-property

float<class_float> volumetric_fog_temporal_reprojection_amount = 0.9

classref-property-setget

  • void (No return value.) set_volumetric_fog_temporal_reprojection_amount(value: float<class_float>)
  • float<class_float> get_volumetric_fog_temporal_reprojection_amount()

The amount by which to blend the last frame with the current frame. A higher number results in smoother volumetric fog, but makes "ghosting" much worse. A lower value reduces ghosting but can result in the per-frame temporal jitter becoming visible.

classref-item-separator


classref-property

bool<class_bool> volumetric_fog_temporal_reprojection_enabled = true

classref-property-setget

  • void (No return value.) set_volumetric_fog_temporal_reprojection_enabled(value: bool<class_bool>)
  • bool<class_bool> is_volumetric_fog_temporal_reprojection_enabled()

Enables temporal reprojection in the volumetric fog. Temporal reprojection blends the current frame's volumetric fog with the last frame's volumetric fog to smooth out jagged edges. The performance cost is minimal; however, it leads to moving FogVolume<class_FogVolume>s and Light3D<class_Light3D>s "ghosting" and leaving a trail behind them. When temporal reprojection is enabled, try to avoid moving FogVolume<class_FogVolume>s or Light3D<class_Light3D>s too fast. Short-lived dynamic lighting effects should have Light3D.light_volumetric_fog_energy<class_Light3D_property_light_volumetric_fog_energy> set to 0.0 to avoid ghosting.

classref-section-separator


classref-descriptions-group

Method Descriptions

classref-method

float<class_float> get_glow_level(idx: int<class_int>) const (This method has no side effects. It doesn't modify any of the instance's member variables.)

Returns the intensity of the glow level idx.

classref-item-separator


classref-method

void (No return value.) set_glow_level(idx: int<class_int>, intensity: float<class_float>)

Sets the intensity of the glow level idx. A value above 0.0 enables the level. Each level relies on the previous level. This means that enabling higher glow levels will slow down the glow effect rendering, even if previous levels aren't enabled.