Resource for environment nodes (like godot.WorldEnvironment
) that define multiple environment operations (such as background godot.Sky
or godot.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
If the target godot.Viewport
is set to "2D Without Sampling", all post-processing effects will be unavailable. With "3D Without Effects", the following options will be unavailable:
-
Ssao
-
Ss Reflections
This can be configured for the root Viewport with , or for specific Viewports via the godot.Viewport.usage
property.
Note that has a mobile platform override to use "3D Without Effects" by default. It improves the performance on mobile devices, but at the same time affects the screen display on mobile devices.
Constructor
Variables
adjustmentBrightness:Single
The global brightness value of the rendered scene. Effective only if adjustment_enabled
is true
.
adjustmentColorCorrection:Texture
Applies the provided godot.Texture
resource to affect the global color aspect of the rendered scene. Effective only if adjustment_enabled
is true
.
adjustmentContrast:Single
The global contrast value of the rendered scene (default value is 1). Effective only if adjustment_enabled
is true
.
adjustmentEnabled:Bool
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.
adjustmentSaturation:Single
The global color saturation value of the rendered scene (default value is 1). Effective only if adjustment_enabled
is true
.
ambientLightSkyContribution:Single
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: godot.Environment.ambientLightSkyContribution
is internally clamped between 0.0
and 1.0
(inclusive).
autoExposureEnabled:Bool
If true
, enables the tonemapping auto exposure mode of the scene renderer. If true
, the renderer will automatically determine the exposure setting to adapt to the scene's illumination and the observed light.
autoExposureScale:Single
The scale of the auto exposure effect. Affects the intensity of auto exposure.
autoExposureSpeed:Single
The speed of the auto exposure effect. Affects the time needed for the camera to perform auto exposure.
backgroundCanvasMaxLayer:Int
The maximum layer ID to display. Only effective when using the godot.Environment_BGMode.canvas
background mode.
backgroundColor:Color
The godot.Color
displayed for clear areas of the scene. Only effective when using the godot.Environment_BGMode.color
or godot.Environment_BGMode.colorSky
background modes).
backgroundMode:Environment_BGMode
The background mode. See godot.Environment_BGMode
for possible values.
backgroundSkyRotation:Vector3
The godot.Sky
resource's rotation expressed as Euler angles in radians.
backgroundSkyRotationDegrees:Vector3
The godot.Sky
resource's rotation expressed as Euler angles in degrees.
dofBlurFarDistance:Single
The distance from the camera where the far blur effect affects the rendering.
dofBlurFarQuality:Environment_DOFBlurQuality
The depth-of-field far blur's quality. Higher values can mitigate the visible banding effect seen at higher strengths, but are much slower.
dofBlurNearDistance:Single
Distance from the camera where the near blur effect affects the rendering.
dofBlurNearQuality:Environment_DOFBlurQuality
The depth-of-field near blur's quality. Higher values can mitigate the visible banding effect seen at higher strengths, but are much slower.
fogDepthCurve:Single
The fog depth's intensity curve. A number of presets are available in the Inspector by right-clicking the curve.
fogDepthEnabled:Bool
If true
, the depth fog effect is enabled. When enabled, fog will appear in the distance (relative to the camera).
fogDepthEnd:Single
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 godot.Camera.far
value.
fogEnabled:Bool
If true
, fog effects are enabled. godot.Environment.fogHeightEnabled
and/or godot.Environment.fogDepthEnabled
must be set to true
to actually display fog.
fogHeightCurve:Single
The height fog's intensity. A number of presets are available in the Inspector by right-clicking the curve.
fogHeightEnabled:Bool
If true
, the height fog effect is enabled. When enabled, fog will appear in a defined height range, regardless of the distance from the camera. This can be used to simulate "deep water" effects with a lower performance cost compared to a dedicated shader.
fogHeightMax:Single
The Y coordinate where the height fog will be the most intense. If this value is greater than godot.Environment.fogHeightMin
, fog will be displayed from bottom to top. Otherwise, it will be displayed from top to bottom.
fogHeightMin:Single
The Y coordinate where the height fog will be the least intense. If this value is greater than godot.Environment.fogHeightMax
, fog will be displayed from top to bottom. Otherwise, it will be displayed from bottom to top.
fogSunAmount:Single
The intensity of the depth fog color transition when looking towards the sun. The sun's direction is determined automatically using the DirectionalLight node in the scene.
fogTransmitCurve:Single
The intensity of the fog light transmittance effect. Amount of light that the fog transmits.
fogTransmitEnabled:Bool
Enables fog's light transmission effect. If true
, light will be more visible in the fog to simulate light scattering as in real life.
glowBicubicUpscale:Bool
Smooths out the blockiness created by sampling higher levels, at the cost of performance.
Note: When using the GLES2 renderer, this is only available if the GPU supports the GL_EXT_gpu_shader4
extension.
glowBloom:Single
The bloom's intensity. If set to a value higher than 0
, this will make glow visible in areas darker than the godot.Environment.glowHdrThreshold
.
glowEnabled:Bool
If true
, the glow effect is enabled.
Note: Only effective if is 3D (not 3D Without Effects). On mobile, defaults to 3D Without Effects by default, so its .mobile
override needs to be changed to 3D.
Note: When using GLES3 on mobile, HDR rendering is disabled by default for performance reasons. This means glow will only be visible if godot.Environment.glowHdrThreshold
is decreased below 1.0
or if godot.Environment.glowBloom
is increased above 0.0
. Also consider increasing godot.Environment.glowIntensity
to 1.5
. If you want glow to behave on mobile like it does on desktop (at a performance cost), enable 's .mobile
override.
glowHdrLuminanceCap:Single
The higher threshold of the HDR glow. Areas brighter than this threshold will be clamped for the purposes of the glow effect.
glowHdrThreshold:Single
The lower threshold of the HDR glow. When using the GLES2 renderer (which doesn't support HDR), this needs to be below 1.0
for glow to be visible. A value of 0.9
works well in this case.
glowHighQuality:Bool
Takes more samples during downsample pass of glow. This ensures that single pixels are captured by glow which makes the glow look smoother and more stable during movement. However, it is very expensive and makes the glow post process take twice as long.
glowIntensity:Single
The glow intensity. When using the GLES2 renderer, this should be increased to 1.5 to compensate for the lack of HDR rendering.
glowLevels__1:Bool
If true
, the 1st level of glow is enabled. This is the most "local" level (least blurry).
glowLevels__7:Bool
If true
, the 7th level of glow is enabled. This is the most "global" level (blurriest).
glowStrength:Single
The glow strength. When using the GLES2 renderer, this should be increased to 1.3 to compensate for the lack of HDR rendering.
ssReflectionsEnabled:Bool
If true
, screen-space reflections are enabled. Screen-space reflections are more accurate than reflections from godot.GIProbe
s or godot.ReflectionProbe
s, but are slower and can't reflect surfaces occluded by others.
ssReflectionsFadeIn:Single
The fade-in distance for screen-space reflections. Affects the area from the reflected material to the screen-space reflection).
ssReflectionsFadeOut:Single
The fade-out distance for screen-space reflections. Affects the area from the screen-space reflection to the "global" reflection.
ssReflectionsMaxSteps:Int
The maximum number of steps for screen-space reflections. Higher values are slower.
ssReflectionsRoughness:Bool
If true
, screen-space reflections will take the material roughness into account.
ssaoAoChannelAffect:Single
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.
ssaoBias:Single
The screen-space ambient occlusion bias. This should be kept high enough to prevent "smooth" curves from being affected by ambient occlusion.
ssaoBlur:Environment_SSAOBlur
The screen-space ambient occlusion blur quality. See godot.Environment_SSAOBlur
for possible values.
ssaoEnabled:Bool
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. This is a costly effect and should be disabled first when running into performance issues.
ssaoIntensity:Single
The primary screen-space ambient occlusion intensity. See also godot.Environment.ssaoRadius
.
ssaoIntensity2:Single
The secondary screen-space ambient occlusion intensity. See also godot.Environment.ssaoRadius2
.
ssaoLightAffect:Single
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.
ssaoQuality:Environment_SSAOQuality
The screen-space ambient occlusion quality. Higher qualities will make better use of small objects for ambient occlusion, but are slower.
ssaoRadius2:Single
The secondary screen-space ambient occlusion radius. If set to a value higher than 0
, enables the secondary screen-space ambient occlusion effect which can be used to improve the effect's appearance (at the cost of performance).
tonemapMode:Environment_ToneMapper
The tonemapping mode to use. Tonemapping is the process that "converts" HDR values to be suitable for rendering on a LDR display. (Godot doesn't support rendering on HDR displays yet.)
tonemapWhite:Single
The white reference value for tonemapping. Only effective if the godot.Environment.tonemapMode
isn't set to godot.Environment_ToneMapper.linear
.
Methods
setGlowLevel(idx:Int, enabled:Bool):Void
Enables or disables the glow level at index idx
. 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.