Skip to content
Download
API reference

Environment

Inherits: Resource < Shared < Object

Resource for environment actors (like WorldEnvironment) that define multiple rendering options.

Resource for environment actors (like WorldEnvironment) that define multiple environment operations (such as background Sky or 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

  • Auto Exposure

  • Glow

  • Tonemap

  • Adjustments

TypeNameDefault
floatadjustment_brightness1.0
Textureadjustment_color_correction
floatadjustment_contrast1.0
booladjustment_enabledfalse
floatadjustment_saturation1.0
Colorambient_light_colorColor(0, 0, 0, 1)
floatambient_light_energy1.0
floatambient_light_sky_contribution1.0
Environment.AmbientSourceambient_light_source0
intbackground_camera_feed_id1
intbackground_canvas_max_layer0
Colorbackground_colorColor(0, 0, 0, 1)
floatbackground_energy_multiplier1.0
floatbackground_intensity30000.0
Environment.BGModebackground_mode0
boolchromatic_aberration_enabledfalse
floatchromatic_aberration_strength0.3
floatcrt_curvature0.3
boolcrt_enabledfalse
floatcrt_flicker0.0
floatcrt_mask_strength0.4
floatfilm_grain_amount0.1
boolfilm_grain_animatedtrue
boolfilm_grain_enabledfalse
floatfog_aerial_perspective0.0
floatfog_density0.01
floatfog_depth_begin10.0
floatfog_depth_curve1.0
floatfog_depth_end100.0
boolfog_enabledfalse
floatfog_height0.0
floatfog_height_density0.0
Colorfog_light_colorColor(0.518, 0.553, 0.608, 1)
floatfog_light_energy1.0
Environment.FogModefog_mode0
floatfog_sky_affect1.0
floatfog_sun_scatter0.0
boolglitch_enabledfalse
floatglitch_frequency0.3
floatglitch_intensity0.3
Environment.GlowBlendModeglow_blend_mode1
floatglow_bloom0.0
boolglow_enabledfalse
floatglow_hdr_luminance_cap12.0
floatglow_hdr_scale2.0
floatglow_hdr_threshold1.0
floatglow_intensity0.3
floatglow_levels/10.0
floatglow_levels/20.8
floatglow_levels/30.4
floatglow_levels/40.1
floatglow_levels/50.0
floatglow_levels/60.0
floatglow_levels/70.0
Textureglow_map
floatglow_map_strength0.8
floatglow_mix0.05
boolglow_normalizedfalse
floatglow_strength1.0
boolpixelate_enabledfalse
intpixelate_size4
Environment.ReflectionSourcereflected_light_source0
boolscanlines_enabledfalse
intscanlines_height3
floatscanlines_intensity0.35
floatscanlines_speed0.0
Skysky
floatsky_custom_fov0.0
Vector3sky_rotationVector3(0, 0, 0)
floatssao_ao_channel_affect0.0
floatssao_detail0.5
boolssao_enabledfalse
floatssao_horizon0.06
floatssao_intensity2.0
floatssao_light_affect0.0
floatssao_power1.5
floatssao_radius1.0
floatssao_sharpness0.98
boolssil_enabledfalse
floatssil_intensity1.0
floatssil_normal_rejection1.0
floatssil_radius5.0
floatssil_sharpness0.98
floatssr_depth_tolerance0.5
boolssr_enabledfalse
floatssr_fade_in0.15
floatssr_fade_out2.0
intssr_max_steps64
floattonemap_agx_contrast1.25
floattonemap_agx_white16.29
floattonemap_exposure1.0
Environment.ToneMappertonemap_mode0
floattonemap_white1.0
floatvhs_color_bleed0.5
boolvhs_enabledfalse
floatvhs_noise0.3
floatvhs_tracking0.3
Colorvignette_colorColor(0, 0, 0, 1)
boolvignette_enabledfalse
floatvignette_intensity0.4
floatvignette_smoothness0.5
Colorvolumetric_fog_albedoColor(1, 1, 1, 1)
floatvolumetric_fog_ambient_inject0.0
floatvolumetric_fog_anisotropy0.2
floatvolumetric_fog_density0.05
floatvolumetric_fog_detail_spread2.0
Colorvolumetric_fog_emissionColor(0, 0, 0, 1)
floatvolumetric_fog_emission_energy1.0
boolvolumetric_fog_enabledfalse
floatvolumetric_fog_gi_inject1.0
floatvolumetric_fog_length64.0
floatvolumetric_fog_sky_affect1.0
floatvolumetric_fog_temporal_reprojection_amount0.9
boolvolumetric_fog_temporal_reprojection_enabledtrue
ReturnsMethod
floatget_glow_level(idx)
voidset_glow_level(idx, intensity)

  • BG_COLOR = 1 — Clears the background using a custom clear color.

  • BG_SKY = 2 — Displays a user-defined sky in the background.

  • BG_CANVAS = 3 — Displays a CanvasLayer in the background.

  • 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.

  • BG_CAMERA_FEED = 5 — Displays a camera feed in the background.

  • BG_MAX = 6 — Represents the size of the BGMode enum.

  • AMBIENT_SOURCE_BG = 0 — Gather ambient light from whichever source is specified as the background.

  • AMBIENT_SOURCE_DISABLED = 1 — Disable ambient light. This provides a slight performance boost over AMBIENT_SOURCE_SKY.

  • AMBIENT_SOURCE_COLOR = 2 — Specify a specific Color for ambient light. This provides a slight performance boost over AMBIENT_SOURCE_SKY.

  • AMBIENT_SOURCE_SKY = 3 — Gather ambient light from the Sky regardless of what the background is.

  • REFLECTION_SOURCE_BG = 0 — Use the background for reflections.

  • REFLECTION_SOURCE_DISABLED = 1 — Disable reflections. This provides a slight performance boost over other options.

  • REFLECTION_SOURCE_SKY = 2 — Use the Sky for reflections regardless of what the background is.

  • TONE_MAPPER_LINEAR = 0 — Does not modify color data, resulting in a linear tonemapping curve which unnaturally clips bright values, causing bright lighting to look blown out. The simplest and fastest tonemapper.

  • TONE_MAPPER_FILMIC = 2 — Uses a film-like tonemapping curve to prevent clipping of bright values and provide better contrast than TONE_MAPPER_REINHARDT. Slightly slower than TONE_MAPPER_REINHARDT. Note: This tonemapper does not support HDR output because it produces output in the SDR range. It is recommended to use a different tonemapper when rendering to an HDR screen.

  • TONE_MAPPER_ACES = 3 — Uses a high-contrast film-like tonemapping curve and desaturates bright values for a more realistic appearance. Slightly slower than TONE_MAPPER_FILMIC. Note: This tonemapping operator is called “ACES Fitted” in Gobu 3.x. Note: This tonemapper does not support HDR output because it produces output in the SDR range. It is recommended to use a different tonemapper when rendering to an HDR screen.

  • TONE_MAPPER_AGX = 4 — Uses an adjustable film-like tonemapping curve and desaturates bright values for a more realistic appearance. Better than other tonemappers at maintaining the hue of colors as they become brighter. The slowest tonemapping option.

  • GLOW_BLEND_MODE_ADDITIVE = 0 — Adds the glow effect to the scene.

  • GLOW_BLEND_MODE_SCREEN = 1 — Adds the glow effect to the scene after modifying the glow influence based on the scene value; dark values will be highly influenced by glow and bright values will not be influenced by glow. This approach avoids bright values becoming overly bright from the glow effect. tonemap_white is used to determine the maximum scene value where the glow should have no influence. When tonemap_mode is set to TONE_MAPPER_LINEAR and Viewport.use_hdr_2d is true, the parent window’s Window.get_output_max_linear_value() will be used as the maximum scene value.

  • GLOW_BLEND_MODE_SOFTLIGHT = 2 — Adds the glow effect to the tonemapped image after modifying the glow influence based on the image value; dark values and bright values will not be influenced by glow and mid-range values will be highly influenced by glow. This approach avoids bright values becoming overly bright from the glow effect. The glow will have the largest influence on image values of 0.25 and will have no influence when applied to image values greater than 1.0. Note: This blend mode does not support HDR output because expects a maximum output value of 1.0. It is recommended to use a different blend mode when rendering to an HDR screen.

  • GLOW_BLEND_MODE_REPLACE = 3 — Replaces all pixels’ color by the glow effect. This can be used to simulate a full-screen blur effect by tweaking the glow parameters to match the original image’s brightness or to preview glow configuration in the editor.

  • GLOW_BLEND_MODE_MIX = 4 — Mixes the glow image with the scene image. Best used with glow_bloom to avoid darkening the scene.

  • FOG_MODE_EXPONENTIAL = 0 — Use a physically-based fog model defined primarily by fog density.

  • 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.

float adjustment_brightness = 1.0

Setter/getter: set_adjustment_brightness(), get_adjustment_brightness()

Applies a simple brightness adjustment to the rendered image after tonemaping. To adjust scene brightness use tonemap_exposure instead, which is applied before tonemapping and thus less prone to issues with bright colors. Effective only if adjustment_enabled is true.

Texture adjustment_color_correction

Setter/getter: set_adjustment_color_correction(), get_adjustment_color_correction()

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

Note: Color correction does not currently support HDR output due to only supporting values in the SDR (0.0 to 1.0) range.

float adjustment_contrast = 1.0

Setter/getter: set_adjustment_contrast(), get_adjustment_contrast()

Increasing adjustment_contrast will make dark values darker and bright values brighter. This simple adjustment is applied to the rendered image after tonemaping. When set to a value greater than 1.0, adjustment_contrast is prone to clipping colors that become too bright or too dark. Effective only if adjustment_enabled is true.

bool adjustment_enabled = false

Setter/getter: set_adjustment_enabled(), 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.

float adjustment_saturation = 1.0

Setter/getter: set_adjustment_saturation(), get_adjustment_saturation()

Applies a simple saturation adjustment to the rendered image after tonemaping. When adjustment_saturation is set to 0.0, the rendered image will be fully converted to a grayscale image. Effective only if adjustment_enabled is true.

Color ambient_light_color = Color(0, 0, 0, 1)

Setter/getter: set_ambient_light_color(), get_ambient_light_color()

The ambient light’s Color. Only effective if ambient_light_sky_contribution is lower than 1.0 (exclusive).

float ambient_light_energy = 1.0

Setter/getter: set_ambient_light_energy(), get_ambient_light_energy()

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

float ambient_light_sky_contribution = 1.0

Setter/getter: set_ambient_light_sky_contribution(), 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 is internally clamped between 0.0 and 1.0 (inclusive).

Environment.AmbientSource ambient_light_source = 0

Setter/getter: set_ambient_source(), get_ambient_source()

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

int background_camera_feed_id = 1

Setter/getter: set_camera_feed_id(), get_camera_feed_id()

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

int background_canvas_max_layer = 0

Setter/getter: set_canvas_max_layer(), get_canvas_max_layer()

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

Color background_color = Color(0, 0, 0, 1)

Setter/getter: set_bg_color(), get_bg_color()

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

float background_energy_multiplier = 1.0

Setter/getter: set_bg_energy_multiplier(), get_bg_energy_multiplier()

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

float background_intensity = 30000.0

Setter/getter: set_bg_intensity(), 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 is enabled. The default value is roughly equivalent to the sky at midday.

Environment.BGMode background_mode = 0

Setter/getter: set_background(), get_background()

The background mode.

bool chromatic_aberration_enabled = false

Setter/getter: set_chromatic_aberration_enabled(), is_chromatic_aberration_enabled()

No description yet.

float chromatic_aberration_strength = 0.3

Setter/getter: set_chromatic_aberration_strength(), get_chromatic_aberration_strength()

No description yet.

float crt_curvature = 0.3

Setter/getter: set_crt_curvature(), get_crt_curvature()

No description yet.

bool crt_enabled = false

Setter/getter: set_crt_enabled(), is_crt_enabled()

No description yet.

float crt_flicker = 0.0

Setter/getter: set_crt_flicker(), get_crt_flicker()

No description yet.

float crt_mask_strength = 0.4

Setter/getter: set_crt_mask_strength(), get_crt_mask_strength()

No description yet.

float film_grain_amount = 0.1

Setter/getter: set_film_grain_amount(), get_film_grain_amount()

No description yet.

bool film_grain_animated = true

Setter/getter: set_film_grain_animated(), is_film_grain_animated()

No description yet.

bool film_grain_enabled = false

Setter/getter: set_film_grain_enabled(), is_film_grain_enabled()

No description yet.

float fog_aerial_perspective = 0.0

Setter/getter: set_fog_aerial_perspective(), get_fog_aerial_perspective()

If set above 0.0 (exclusive), blends between the fog’s color and the color of the background Sky, as read from the radiance cubemap. This has a small performance cost when set above 0.0. Must have background_mode set to 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. If set to 0.0, aerial perspective is disabled.

Notice that this does not sample the Sky directly, but rather the radiance cubemap. The cubemap is sampled at a mipmap level depending on the depth of the rendered pixel; the farther away, the higher the resolution of the sampled mipmap. This results in the actual color being a blurred version of the sky, with more blur closer to the camera. The highest mipmap resolution is used at a depth of Camera3D.far.

float fog_density = 0.01

Setter/getter: set_fog_density(), get_fog_density()

The fog density to be used. This is demonstrated in different ways depending on the 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.

float fog_depth_begin = 10.0

Setter/getter: set_fog_depth_begin(), get_fog_depth_begin()

The fog’s depth starting distance from the camera. Only available when fog_mode is set to FOG_MODE_DEPTH.

float fog_depth_curve = 1.0

Setter/getter: set_fog_depth_curve(), 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 is set to FOG_MODE_DEPTH.

float fog_depth_end = 100.0

Setter/getter: set_fog_depth_end(), 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 value. Only available when fog_mode is set to FOG_MODE_DEPTH.

bool fog_enabled = false

Setter/getter: set_fog_enabled(), is_fog_enabled()

If true, fog effects are enabled.

float fog_height = 0.0

Setter/getter: set_fog_height(), get_fog_height()

The height at which the height fog effect begins.

float fog_height_density = 0.0

Setter/getter: set_fog_height_density(), get_fog_height_density()

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

Color fog_light_color = Color(0.518, 0.553, 0.608, 1)

Setter/getter: set_fog_light_color(), get_fog_light_color()

The fog’s color.

float fog_light_energy = 1.0

Setter/getter: set_fog_light_energy(), get_fog_light_energy()

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

Environment.FogMode fog_mode = 0

Setter/getter: set_fog_mode(), get_fog_mode()

The fog mode.

float fog_sky_affect = 1.0

Setter/getter: set_fog_sky_affect(), 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 has no visual effect if fog_aerial_perspective is 1.0.

float fog_sun_scatter = 0.0

Setter/getter: set_fog_sun_scatter(), 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.

bool glitch_enabled = false

Setter/getter: set_glitch_enabled(), is_glitch_enabled()

No description yet.

float glitch_frequency = 0.3

Setter/getter: set_glitch_frequency(), get_glitch_frequency()

No description yet.

float glitch_intensity = 0.3

Setter/getter: set_glitch_intensity(), get_glitch_intensity()

No description yet.

Environment.GlowBlendMode glow_blend_mode = 1

Setter/getter: set_glow_blend_mode(), get_glow_blend_mode()

The glow blending mode.

Note: The Compatibility renderer always uses GLOW_BLEND_MODE_SCREEN and glow_blend_mode will have no effect.

float glow_bloom = 0.0

Setter/getter: set_glow_bloom(), 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.

bool glow_enabled = false

Setter/getter: set_glow_enabled(), is_glow_enabled()

If true, the glow effect is enabled. This simulates real world atmosphere and eye/camera behavior by causing bright pixels to 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, glow_strength, glow_blend_mode, glow_mix, glow_map, and glow_map_strength. This implementation is optimized to run on low-end devices and is less flexible as a result.

float glow_hdr_luminance_cap = 12.0

Setter/getter: set_glow_hdr_luminance_cap(), 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.

float glow_hdr_scale = 2.0

Setter/getter: set_glow_hdr_bleed_scale(), get_glow_hdr_bleed_scale()

Smooths the transition between values that are below and above glow_hdr_threshold by reducing the amount of glow generated by values that are close to glow_hdr_threshold. Values above glow_hdr_threshold + glow_hdr_scale will not have glow reduced in this way.

float glow_hdr_threshold = 1.0

Setter/getter: set_glow_hdr_bleed_threshold(), 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.

float glow_intensity = 0.3

Setter/getter: set_glow_intensity(), get_glow_intensity()

The overall brightness multiplier that is applied to the glow effect just before it is blended with the scene. 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.

float glow_levels/1 = 0.0

Setter/getter: set_glow_level(), get_glow_level()

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

Note: 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.

float glow_levels/2 = 0.8

Setter/getter: set_glow_level(), get_glow_level()

The intensity of the 2nd level of glow.

Note: 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.

float glow_levels/3 = 0.4

Setter/getter: set_glow_level(), get_glow_level()

The intensity of the 3rd level of glow.

Note: 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.

float glow_levels/4 = 0.1

Setter/getter: set_glow_level(), get_glow_level()

The intensity of the 4th level of glow.

Note: 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.

float glow_levels/5 = 0.0

Setter/getter: set_glow_level(), get_glow_level()

The intensity of the 5th level of glow.

Note: 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.

float glow_levels/6 = 0.0

Setter/getter: set_glow_level(), get_glow_level()

The intensity of the 6th level of glow.

Note: 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.

float glow_levels/7 = 0.0

Setter/getter: set_glow_level(), get_glow_level()

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

Note: 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.

Texture glow_map

Setter/getter: set_glow_map(), get_glow_map()

The texture that should be used as a glow map to multiply the resulting glow color according to 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 has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.

float glow_map_strength = 0.8

Setter/getter: set_glow_map_strength(), get_glow_map_strength()

How strong of an influence the glow_map should have on the overall glow effect. A strength of 0.0 means the glow map has no influence, while a strength of 1.0 means the glow map has full influence.

Note: If the glow map has black areas, a value of 1.0 can also turn off the glow effect entirely in specific areas of the screen.

Note: 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.

float glow_mix = 0.05

Setter/getter: set_glow_mix(), get_glow_mix()

When using the GLOW_BLEND_MODE_MIX 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.

Note: 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.

bool glow_normalized = false

Setter/getter: set_glow_normalized(), is_glow_normalized()

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

Note: 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.

float glow_strength = 1.0

Setter/getter: set_glow_strength(), get_glow_strength()

The strength that is used when blurring across the screen to generate the glow effect. This affects 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 has no effect when using the Compatibility rendering method, due to this rendering method using a simpler glow implementation optimized for low-end devices.

bool pixelate_enabled = false

Setter/getter: set_pixelate_enabled(), is_pixelate_enabled()

No description yet.

int pixelate_size = 4

Setter/getter: set_pixelate_size(), get_pixelate_size()

No description yet.

Environment.ReflectionSource reflected_light_source = 0

Setter/getter: set_reflection_source(), get_reflection_source()

The reflected (specular) light source.

bool scanlines_enabled = false

Setter/getter: set_scanlines_enabled(), is_scanlines_enabled()

No description yet.

int scanlines_height = 3

Setter/getter: set_scanlines_height(), get_scanlines_height()

No description yet.

float scanlines_intensity = 0.35

Setter/getter: set_scanlines_intensity(), get_scanlines_intensity()

No description yet.

float scanlines_speed = 0.0

Setter/getter: set_scanlines_speed(), get_scanlines_speed()

No description yet.

Sky sky

Setter/getter: set_sky(), get_sky()

The Sky resource used for this Environment.

float sky_custom_fov = 0.0

Setter/getter: set_sky_custom_fov(), 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 is used for sky rendering.

Vector3 sky_rotation = Vector3(0, 0, 0)

Setter/getter: set_sky_rotation(), get_sky_rotation()

The rotation to use for sky rendering.

float ssao_ao_channel_affect = 0.0

Setter/getter: set_ssao_ao_channel_affect(), 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.

float ssao_detail = 0.5

Setter/getter: set_ssao_detail(), 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.

bool ssao_enabled = false

Setter/getter: set_ssao_enabled(), 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. Gobu 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+ and Compatibility rendering methods, not Mobile.

float ssao_horizon = 0.06

Setter/getter: set_ssao_horizon(), 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.

float ssao_intensity = 2.0

Setter/getter: set_ssao_intensity(), 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.

float ssao_light_affect = 0.0

Setter/getter: set_ssao_direct_light_affect(), 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.

float ssao_power = 1.5

Setter/getter: set_ssao_power(), get_ssao_power()

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

float ssao_radius = 1.0

Setter/getter: set_ssao_radius(), 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.

float ssao_sharpness = 0.98

Setter/getter: set_ssao_sharpness(), 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.

bool ssil_enabled = false

Setter/getter: set_ssil_enabled(), 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. Screen-space indirect lighting is not affected by individual light’s Light3D.light_indirect_energy.

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

float ssil_intensity = 1.0

Setter/getter: set_ssil_intensity(), get_ssil_intensity()

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

float ssil_normal_rejection = 1.0

Setter/getter: set_ssil_normal_rejection(), 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.

float ssil_radius = 5.0

Setter/getter: set_ssil_radius(), 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.

float ssil_sharpness = 0.98

Setter/getter: set_ssil_sharpness(), 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.

float ssr_depth_tolerance = 0.5

Setter/getter: set_ssr_depth_tolerance(), get_ssr_depth_tolerance()

The depth tolerance for screen-space reflections.

bool ssr_enabled = false

Setter/getter: set_ssr_enabled(), is_ssr_enabled()

If true, screen-space reflections are enabled. Screen-space reflections are more accurate than reflections from ReflectionProbes, 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.

Note: SSR is not supported on viewports that have a transparent background (where Viewport.transparent_bg is true).

float ssr_fade_in = 0.15

Setter/getter: set_ssr_fade_in(), 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).

float ssr_fade_out = 2.0

Setter/getter: set_ssr_fade_out(), 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).

int ssr_max_steps = 64

Setter/getter: set_ssr_max_steps(), get_ssr_max_steps()

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

float tonemap_agx_contrast = 1.25

Setter/getter: set_tonemap_agx_contrast(), get_tonemap_agx_contrast()

Increasing tonemap_agx_contrast will make dark values darker and bright values brighter. Produces a higher quality result than adjustment_contrast without any additional performance cost, but is only available when using the TONE_MAPPER_AGX tonemapper.

float tonemap_agx_white = 16.29

Setter/getter: set_tonemap_agx_white(), get_tonemap_agx_white()

The white reference value for tonemapping, which indicates where bright white is located in the scale of values provided to the tonemapper. For photorealistic lighting, it is recommended to set tonemap_agx_white to at least 6.0. Higher values result in less blown out highlights, but may make the scene appear lower contrast. tonemap_agx_white is the same as tonemap_white, but is only effective with the TONE_MAPPER_AGX tonemapper. See also tonemap_exposure.

Note: When using the Mobile renderer with Viewport.use_hdr_2d disabled, tonemap_agx_white is ignored and a white value of 2.0 will always be used instead. Otherwise, tonemap_agx_white will be dynamically adjusted at runtime by multiplying it by the parent window’s Window.get_output_max_linear_value() when using Viewport.use_hdr_2d to ensure good behavior with both SDR and HDR output.

float tonemap_exposure = 1.0

Setter/getter: set_tonemap_exposure(), get_tonemap_exposure()

Adjusts the brightness of values before they are provided to the tonemapper. Higher tonemap_exposure values result in a brighter image. See also tonemap_white.

Note: Values provided to the tonemapper will also be multiplied by 2.0 and 1.8 for TONE_MAPPER_FILMIC and TONE_MAPPER_ACES respectively to produce a similar apparent brightness as TONE_MAPPER_LINEAR.

Environment.ToneMapper tonemap_mode = 0

Setter/getter: set_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. (Gobu doesn’t support rendering on HDR displays yet.)

float tonemap_white = 1.0

Setter/getter: set_tonemap_white(), get_tonemap_white()

The white reference value for tonemapping, which indicates where bright white is located in the scale of values provided to the tonemapper. For photorealistic lighting, it is recommended to set tonemap_white to at least 6.0. Higher values result in less blown out highlights, but may make the scene appear lower contrast. tonemap_agx_white will be used instead when using the TONE_MAPPER_AGX tonemapper. See also tonemap_exposure.

Note: tonemap_white must be set to 2.0 or lower on the Mobile renderer to produce bright images.

Note: tonemap_white is ignored when using TONE_MAPPER_LINEAR and will be dynamically adjusted at runtime to never be less than the parent window’s Window.get_output_max_linear_value() when using TONE_MAPPER_REINHARDT with Viewport.use_hdr_2d.

float vhs_color_bleed = 0.5

Setter/getter: set_vhs_color_bleed(), get_vhs_color_bleed()

No description yet.

bool vhs_enabled = false

Setter/getter: set_vhs_enabled(), is_vhs_enabled()

No description yet.

float vhs_noise = 0.3

Setter/getter: set_vhs_noise(), get_vhs_noise()

No description yet.

float vhs_tracking = 0.3

Setter/getter: set_vhs_tracking(), get_vhs_tracking()

No description yet.

Color vignette_color = Color(0, 0, 0, 1)

Setter/getter: set_vignette_color(), get_vignette_color()

No description yet.

bool vignette_enabled = false

Setter/getter: set_vignette_enabled(), is_vignette_enabled()

No description yet.

float vignette_intensity = 0.4

Setter/getter: set_vignette_intensity(), get_vignette_intensity()

No description yet.

float vignette_smoothness = 0.5

Setter/getter: set_vignette_smoothness(), get_vignette_smoothness()

No description yet.

Color volumetric_fog_albedo = Color(1, 1, 1, 1)

Setter/getter: set_volumetric_fog_albedo(), get_volumetric_fog_albedo()

The 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.

float volumetric_fog_ambient_inject = 0.0

Setter/getter: set_volumetric_fog_ambient_inject(), 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 has a small performance cost when set above 0.0.

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

float volumetric_fog_anisotropy = 0.2

Setter/getter: set_volumetric_fog_anisotropy(), 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.

float volumetric_fog_density = 0.05

Setter/getter: set_volumetric_fog_density(), get_volumetric_fog_density()

The base exponential density of the volumetric fog. Set this to the lowest density you want to have globally. Fog rendering is exponential as in real life.

A value of 0.0 disables global volumetric fog.

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

float volumetric_fog_detail_spread = 2.0

Setter/getter: set_volumetric_fog_detail_spread(), 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.

Color volumetric_fog_emission = Color(0, 0, 0, 1)

Setter/getter: set_volumetric_fog_emission(), 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.

float volumetric_fog_emission_energy = 1.0

Setter/getter: set_volumetric_fog_emission_energy(), get_volumetric_fog_emission_energy()

The brightness of the emitted light from the volumetric fog.

bool volumetric_fog_enabled = false

Setter/getter: set_volumetric_fog_enabled(), 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 lights. 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.

float volumetric_fog_gi_inject = 1.0

Setter/getter: set_volumetric_fog_gi_inject(), 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 has a small performance cost when set above 0.0.

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

Note: Global illumination from LightmapGI, ReflectionProbe and SSIL (see ssil_enabled) will be ignored by volumetric fog.

float volumetric_fog_length = 64.0

Setter/getter: set_volumetric_fog_length(), 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.

float volumetric_fog_sky_affect = 1.0

Setter/getter: set_volumetric_fog_sky_affect(), 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.

volumetric_fog_temporal_reprojection_amount

Section titled “volumetric_fog_temporal_reprojection_amount”

float volumetric_fog_temporal_reprojection_amount = 0.9

Setter/getter: set_volumetric_fog_temporal_reprojection_amount(), 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.

volumetric_fog_temporal_reprojection_enabled

Section titled “volumetric_fog_temporal_reprojection_enabled”

bool volumetric_fog_temporal_reprojection_enabled = true

Setter/getter: set_volumetric_fog_temporal_reprojection_enabled(), 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 Light3Ds “ghosting” and leaving a trail behind them. When temporal reprojection is enabled, try to avoid moving Light3Ds too fast. Short-lived dynamic lighting effects should have Light3D.light_volumetric_fog_energy set to 0.0 to avoid ghosting.

float get_glow_level(idx: int) const

Returns the intensity of the glow level idx.

void set_glow_level(idx: int, intensity: 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.