Struct gdnative_bindings_lily::Environment[][src]

pub struct Environment { /* fields omitted */ }
Expand description

core class Environment inherits Resource (reference counted).

Official documentation

See the documentation of this class in the Godot engine’s official documentation. The method descriptions are generated from it and typically contain code samples in GDScript, not Rust.

Memory management

The lifetime of this object is automatically managed through reference counting.

Class hierarchy

Environment inherits methods from:

Safety

All types in the Godot API have “interior mutability” in Rust parlance. To enforce that the official thread-safety guidelines are followed, the typestate pattern is used in the Ref and TRef smart pointers, and the Instance API. The typestate Access in these types tracks whether the access is unique, shared, or exclusive to the current thread. For more information, see the type-level documentation on Ref.

Implementations

Constants

Creates a new instance of this object.

This is a reference-counted type. The returned object is automatically managed by Ref.

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

Applies the provided Texture resource to affect the global color aspect of the rendered scene. Effective only if adjustment_enabled is true.

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

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

The ambient light’s Color.

The ambient light’s energy. The higher the value, the stronger the light.

Defines the amount of light that the sky brings on the scene. A value of 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 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.

The background mode. See [enum BGMode] for possible values.

The Color displayed for clear areas of the scene. Only effective when using the [constant BG_COLOR] or [constant BG_COLOR_SKY] background modes).

The power of the light emitted by the background.

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

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

The amount of far blur for the depth-of-field effect.

The distance from the camera where the far blur effect affects the rendering.

The depth-of-field far blur’s quality. Higher values can mitigate the visible banding effect seen at higher strengths, but are much slower.

The length of the transition between the no-blur area and far blur.

The amount of near blur for the depth-of-field effect.

Distance from the camera where the near blur effect affects the rendering.

The depth-of-field near blur’s quality. Higher values can mitigate the visible banding effect seen at higher strengths, but are much slower.

The length of the transition between the near blur and no-blur area.

The fog’s Color.

The fog’s depth starting distance from the camera.

The fog depth’s intensity curve. A number of presets are available in the Inspector by right-clicking the curve.

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 [member Camera.far] value.

The height fog’s intensity. A number of presets are available in the Inspector by right-clicking the curve.

The Y coordinate where the height fog will be the most intense. If this value is greater than [member fog_height_min], fog will be displayed from bottom to top. Otherwise, it will be displayed from top to bottom.

The Y coordinate where the height fog will be the least intense. If this value is greater than [member fog_height_max], fog will be displayed from top to bottom. Otherwise, it will be displayed from bottom to top.

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.

The depth fog’s Color when looking towards the sun.

The intensity of the fog light transmittance effect. Amount of light that the fog transmits.

The glow blending mode.

The bloom’s intensity. If set to a value higher than 0, this will make glow visible in areas darker than the [member glow_hdr_threshold].

The bleed scale of the HDR glow.

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.

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

The glow intensity. When using the GLES2 renderer, this should be increased to 1.5 to compensate for the lack of HDR rendering.

The glow strength. When using the GLES2 renderer, this should be increased to 1.3 to compensate for the lack of HDR rendering.

The Sky resource defined as background.

The Sky resource’s custom field of view.

The Sky resource’s rotation expressed as a Basis.

The Sky resource’s rotation expressed as Euler angles in radians.

The Sky resource’s rotation expressed as Euler angles in degrees.

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.

The screen-space ambient occlusion bias. This should be kept high enough to prevent “smooth” curves from being affected by ambient occlusion.

The screen-space ambient occlusion blur quality. See [enum SSAOBlur] for possible values.

The screen-space ambient occlusion color.

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.

The screen-space ambient occlusion edge sharpness.

The primary screen-space ambient occlusion intensity. See also [member ssao_radius].

The secondary screen-space ambient occlusion intensity. See also [member ssao_radius2].

The screen-space ambient occlusion quality. Higher qualities will make better use of small objects for ambient occlusion, but are slower.

The primary screen-space ambient occlusion radius.

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

The depth tolerance for screen-space reflections.

The fade-in distance for screen-space reflections. Affects the area from the reflected material to the screen-space reflection).

The fade-out distance for screen-space reflections. Affects the area from the screen-space reflection to the “global” reflection.

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

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.

The scale of the auto exposure effect. Affects the intensity of auto exposure.

The maximum luminance value for the auto exposure.

The minimum luminance value for the auto exposure.

The speed of the auto exposure effect. Affects the time needed for the camera to perform auto exposure.

The default exposure used for tonemapping.

The white reference value for tonemapping. Only effective if the [member tonemap_mode] isn’t set to [constant TONE_MAPPER_LINEAR].

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

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.

If true, enables the depth-of-field far blur effect.

If true, enables the depth-of-field near blur effect.

If true, the depth fog effect is enabled. When enabled, fog will appear in the distance (relative to the camera).

If true, fog effects are enabled. [member fog_height_enabled] and/or [member fog_depth_enabled] must be set to true to actually display fog.

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.

Enables fog’s light transmission effect. If true, light will be more visible in the fog to simulate light scattering as in real life.

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.

If true, the glow effect is enabled.

If true, the 7th level of glow is enabled. This is the most “global” level (blurriest).

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.

If true, screen-space reflections are enabled. Screen-space reflections are more accurate than reflections from GIProbes or ReflectionProbes, but are slower and can’t reflect surfaces occluded by others.

If true, screen-space reflections will take the material roughness into account.

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

Applies the provided Texture resource to affect the global color aspect of the rendered scene. Effective only if adjustment_enabled is true.

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

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.

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

The ambient light’s Color.

The ambient light’s energy. The higher the value, the stronger the light.

Defines the amount of light that the sky brings on the scene. A value of 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 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.

The background mode. See [enum BGMode] for possible values.

The Color displayed for clear areas of the scene. Only effective when using the [constant BG_COLOR] or [constant BG_COLOR_SKY] background modes).

The power of the light emitted by the background.

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

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

The amount of far blur for the depth-of-field effect.

The distance from the camera where the far blur effect affects the rendering.

If true, enables the depth-of-field far blur effect.

The depth-of-field far blur’s quality. Higher values can mitigate the visible banding effect seen at higher strengths, but are much slower.

The length of the transition between the no-blur area and far blur.

The amount of near blur for the depth-of-field effect.

Distance from the camera where the near blur effect affects the rendering.

If true, enables the depth-of-field near blur effect.

The depth-of-field near blur’s quality. Higher values can mitigate the visible banding effect seen at higher strengths, but are much slower.

The length of the transition between the near blur and no-blur area.

The fog’s Color.

The fog’s depth starting distance from the camera.

The fog depth’s intensity curve. A number of presets are available in the Inspector by right-clicking the curve.

If true, the depth fog effect is enabled. When enabled, fog will appear in the distance (relative to the camera).

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 [member Camera.far] value.

If true, fog effects are enabled. [member fog_height_enabled] and/or [member fog_depth_enabled] must be set to true to actually display fog.

The height fog’s intensity. A number of presets are available in the Inspector by right-clicking the curve.

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.

The Y coordinate where the height fog will be the most intense. If this value is greater than [member fog_height_min], fog will be displayed from bottom to top. Otherwise, it will be displayed from top to bottom.

The Y coordinate where the height fog will be the least intense. If this value is greater than [member fog_height_max], fog will be displayed from top to bottom. Otherwise, it will be displayed from bottom to top.

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.

The depth fog’s Color when looking towards the sun.

The intensity of the fog light transmittance effect. Amount of light that the fog transmits.

Enables fog’s light transmission effect. If true, light will be more visible in the fog to simulate light scattering as in real life.

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.

The glow blending mode.

The bloom’s intensity. If set to a value higher than 0, this will make glow visible in areas darker than the [member glow_hdr_threshold].

If true, the glow effect is enabled.

The bleed scale of the HDR glow.

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.

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

The glow intensity. When using the GLES2 renderer, this should be increased to 1.5 to compensate for the lack of HDR rendering.

If true, the 7th level of glow is enabled. This is the most “global” level (blurriest).

The glow strength. When using the GLES2 renderer, this should be increased to 1.3 to compensate for the lack of HDR rendering.

The Sky resource defined as background.

The Sky resource’s custom field of view.

The Sky resource’s rotation expressed as a Basis.

The Sky resource’s rotation expressed as Euler angles in radians.

The Sky resource’s rotation expressed as Euler angles in degrees.

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.

The screen-space ambient occlusion bias. This should be kept high enough to prevent “smooth” curves from being affected by ambient occlusion.

The screen-space ambient occlusion blur quality. See [enum SSAOBlur] for possible values.

The screen-space ambient occlusion color.

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.

The screen-space ambient occlusion edge sharpness.

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.

The primary screen-space ambient occlusion intensity. See also [member ssao_radius].

The secondary screen-space ambient occlusion intensity. See also [member ssao_radius2].

The screen-space ambient occlusion quality. Higher qualities will make better use of small objects for ambient occlusion, but are slower.

The primary screen-space ambient occlusion radius.

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

The depth tolerance for screen-space reflections.

If true, screen-space reflections are enabled. Screen-space reflections are more accurate than reflections from GIProbes or ReflectionProbes, but are slower and can’t reflect surfaces occluded by others.

The fade-in distance for screen-space reflections. Affects the area from the reflected material to the screen-space reflection).

The fade-out distance for screen-space reflections. Affects the area from the screen-space reflection to the “global” reflection.

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

If true, screen-space reflections will take the material roughness into account.

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.

The scale of the auto exposure effect. Affects the intensity of auto exposure.

The maximum luminance value for the auto exposure.

The minimum luminance value for the auto exposure.

The speed of the auto exposure effect. Affects the time needed for the camera to perform auto exposure.

The default exposure used for tonemapping.

The white reference value for tonemapping. Only effective if the [member tonemap_mode] isn’t set to [constant TONE_MAPPER_LINEAR].

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

Methods from Deref<Target = Resource>

Duplicates the resource, returning a new resource. By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing true to the subresources argument which will copy the subresources. Note: If subresources is true, this method will only perform a shallow copy. Nested resources within subresources will not be duplicated and will still be shared.

Default Arguments

  • subresources - false

If [member resource_local_to_scene] is enabled and the resource was loaded from a PackedScene instantiation, returns the local scene where this resource’s unique copy is in use. Otherwise, returns null.

The name of the resource. This is an optional identifier.

The path to the resource. In case it has its own file, it will return its filepath. If it’s tied to the scene, it will return the scene’s path, followed by the resource’s index.

Returns the RID of the resource (or an empty RID). Many resources (such as Texture, Mesh, etc) are high-level abstractions of resources stored in a server, so this function will return the original RID.

If true, the resource will be made unique in each instance of its local scene. It can thus be modified in a scene instance without impacting other instances of that same scene.

If true, the resource will be made unique in each instance of its local scene. It can thus be modified in a scene instance without impacting other instances of that same scene.

The name of the resource. This is an optional identifier.

The path to the resource. In case it has its own file, it will return its filepath. If it’s tied to the scene, it will return the scene’s path, followed by the resource’s index.

This method is called when a resource with [member resource_local_to_scene] enabled is loaded from a PackedScene instantiation. Its behavior can be customized by overriding [method _setup_local_to_scene] from script. For most resources, this method performs no base logic. ViewportTexture performs custom logic to properly set the proxy texture and flags in the local viewport.

Sets the path of the resource, potentially overriding an existing cache entry for this path. This differs from setting [member resource_path], as the latter would error out if another resource was already cached for the given path.

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

The memory management kind of this type. This modifies the behavior of the Ref smart pointer. See its type-level documentation for more information. Read more

Creates an explicitly null reference of Self as a method argument. This makes type inference easier for the compiler compared to Option. Read more

Creates a new instance of Self using a zero-argument constructor, as a Unique reference. Read more

Performs a dynamic reference downcast to target type. Read more

Performs a static reference upcast to a supertype that is guaranteed to be valid. Read more

Creates a persistent reference to the same Godot object with shared thread access. Read more

Creates a persistent reference to the same Godot object with thread-local thread access. Read more

Creates a persistent reference to the same Godot object with unique access. Read more

Recovers a instance ID previously returned by Object::get_instance_id if the object is still alive. See also TRef::try_from_instance_id. Read more

Recovers a instance ID previously returned by Object::get_instance_id if the object is still alive, and panics otherwise. This does NOT guarantee that the resulting reference is safe to use. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.