ReflectionSource
Environment.swift:81enum ReflectionSourceenum ReflectionSourceimport SwiftGodotFramework to write Godot Game Extensions using the Swift Programming Language.
class EnvironmentResource for environment nodes (like WorldEnvironment) that define multiple rendering options.
case bgUse the background for reflections.
case disabledDisable reflections. This provides a slight performance boost over other options.
case skyUse the Sky for reflections regardless of what the background is.
override class var godotClassName: StringName { get }final var adjustmentBrightness: Double { get set }The global brightness value of the rendered scene. Effective only if adjustmentEnabled is true.
final var adjustmentColorCorrection: Texture? { get set }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 adjustmentEnabled is true.
final var adjustmentContrast: Double { get set }The global contrast value of the rendered scene (default value is 1). Effective only if adjustmentEnabled is true.
final var adjustmentEnabled: Bool { get set }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.
final var adjustmentSaturation: Double { get set }The global color saturation value of the rendered scene (default value is 1). Effective only if adjustmentEnabled is true.
final var ambientLightColor: Color { get set }The ambient light’s Color. Only effective if ambientLightSkyContribution is lower than 1.0 (exclusive).
final var ambientLightEnergy: Double { get set }The ambient light’s energy. The higher the value, the stronger the light. Only effective if ambientLightSkyContribution is lower than 1.0 (exclusive).
final var ambientLightSkyContribution: Double { get set }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.
final var ambientLightSource: Environment.AmbientSource { get set }The ambient light source to use for rendering materials and global illumination.
final var backgroundCameraFeedId: Int32 { get set }The ID of the camera feed to show in the background.
final var backgroundCanvasMaxLayer: Int32 { get set }The maximum layer ID to display. Only effective when using the .bgCanvas background mode.
final var backgroundColor: Color { get set }The Color displayed for clear areas of the scene. Only effective when using the .bgColor background mode.
final var backgroundEnergyMultiplier: Double { get set }Multiplier for background energy. Increase to make background brighter, decrease to make background dimmer.
final var backgroundIntensity: Double { get set }Luminance of background measured in nits (candela per square meter). Only used when ProjectSettings/rendering/lightsAndShadows/usePhysicalLightUnits is enabled. The default value is roughly equivalent to the sky at midday.
final var backgroundMode: Environment.BGMode { get set }The background mode. See BGMode for possible values.
final var fogAerialPerspective: Double { get set }If set above 0.0 (exclusive), blends between the fog’s color and the color of the background Sky. This has a small performance cost when set above 0.0. Must have backgroundMode set to .bgSky.
final var fogDensity: Double { get set }The fog density to be used. This is demonstrated in different ways depending on the fogMode mode chosen:
final var fogDepthBegin: Double { get set }The fog’s depth starting distance from the camera. Only available when fogMode is set to .depth.
final var fogDepthCurve: Double { get set }The fog depth’s intensity curve. A number of presets are available in the Inspector by right-clicking the curve. Only available when fogMode is set to .depth.
final var fogDepthEnd: Double { get set }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 far value. Only available when fogMode is set to .depth.
final var fogEnabled: Bool { get set }If true, fog effects are enabled.
final var fogHeight: Double { get set }The height at which the height fog effect begins.
final var fogHeightDensity: Double { get set }The density used to increase fog as height decreases. To make fog increase as height increases, use a negative value.
final var fogLightColor: Color { get set }The fog’s color.
final var fogLightEnergy: Double { get set }The fog’s brightness. Higher values result in brighter fog.
final var fogMode: Environment.FogMode { get set }The fog mode. See FogMode for possible values.
final var fogSkyAffect: Double { get set }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.
final var fogSunScatter: Double { get set }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.
final var glowBlendMode: Environment.GlowBlendMode { get set }The glow blending mode.
final var glowBloom: Double { get set }The bloom’s intensity. If set to a value higher than 0, this will make glow visible in areas darker than the glowHdrThreshold.
final var glowEnabled: Bool { get set }If true, the glow effect is enabled. This simulates real world eye/camera behavior where bright pixels bleed onto surrounding pixels.
final var glowHdrLuminanceCap: Double { get set }The higher threshold of the HDR glow. Areas brighter than this threshold will be clamped for the purposes of the glow effect.
final var glowHdrScale: Double { get set }The bleed scale of the HDR glow.
final var glowHdrThreshold: Double { get set }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.
final var glowIntensity: Double { get set }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.
final var glowMap: Texture? { get set }The texture that should be used as a glow map to multiply the resulting glow color according to glowMapStrength. 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.
final var glowMapStrength: Double { get set }How strong of an impact the glowMap 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).
final var glowMix: Double { get set }When using the .mix glowBlendMode, 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 .replace.
final var glowNormalized: Bool { get set }If true, glow levels will be normalized so that summed together their intensities equal 1.0.
final var glowStrength: Double { get set }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.
final var reflectedLightSource: Environment.ReflectionSource { get set }The reflected (specular) light source.
final var sdfgiBounceFeedback: Double { get set }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 sdfgiBounceFeedback generally has no performance impact. See also sdfgiEnergy.
final var sdfgiCascade0Distance: Double { get set }final var sdfgiCascades: Int32 { get set }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, sdfgiCascades can often be decreased between 1 and 4 to improve performance.
final var sdfgiEnabled: Bool { get set }If true, enables signed distance field global illumination for meshes that have their giMode set to ``GeometryInstance3D/GIMode/`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.
final var sdfgiEnergy: Double { get set }The energy multiplier to use for SDFGI. Higher values will result in brighter indirect lighting and reflections. See also sdfgiBounceFeedback.
final var sdfgiMaxDistance: Double { get set }The maximum distance at which SDFGI is visible. Beyond this distance, environment lighting or other sources of GI such as ReflectionProbe will be used as a fallback.
final var sdfgiMinCellSize: Double { get set }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.
final var sdfgiNormalBias: Double { get set }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.
final var sdfgiProbeBias: Double { get set }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.
final var sdfgiReadSkyLight: Bool { get set }If true, SDFGI takes the environment lighting into account. This should be set to false for interior scenes.
final var sdfgiUseOcclusion: Bool { get set }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. sdfgiUseOcclusion has a performance impact and should only be enabled when needed.
final var sdfgiYScale: Environment.SDFGIYScale { get set }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. sdfgiYScale should be set depending on how vertical your scene is (and how fast your camera may move on the Y axis).
final var sky: Sky? { get set }The Sky resource used for this Environment.
final var skyCustomFov: Double { get set }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.
final var skyRotation: Vector3 { get set }The rotation to use for sky rendering.
final var ssaoAoChannelAffect: Double { get set }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.
final var ssaoDetail: Double { get set }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.
final var ssaoEnabled: Bool { get set }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.
final var ssaoHorizon: Double { get set }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.
final var ssaoIntensity: Double { get set }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.
final var ssaoLightAffect: Double { get set }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.
final var ssaoPower: Double { get set }The distribution of occlusion. A higher value results in darker occlusion, similar to ssaoIntensity, but with a sharper falloff.
final var ssaoRadius: Double { get set }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.
final var ssaoSharpness: Double { get set }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.
final var ssilEnabled: Bool { get set }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. Screen-space indirect lighting is not affected by individual light’s lightIndirectEnergy.
final var ssilIntensity: Double { get set }The brightness multiplier for the screen-space indirect lighting effect. A higher value will result in brighter light.
final var ssilNormalRejection: Double { get set }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.
final var ssilRadius: Double { get set }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.
final var ssilSharpness: Double { get set }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.
final var ssrDepthTolerance: Double { get set }The depth tolerance for screen-space reflections.
final var ssrEnabled: Bool { get set }If true, screen-space reflections are enabled. Screen-space reflections are more accurate than reflections from VoxelGIs or ReflectionProbes, but are slower and can’t reflect surfaces occluded by others.
final var ssrFadeIn: Double { get set }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).
final var ssrFadeOut: Double { get set }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).
final var ssrMaxSteps: Int32 { get set }The maximum number of steps for screen-space reflections. Higher values are slower.
final var tonemapExposure: Double { get set }The default exposure used for tonemapping. Higher values result in a brighter image. See also tonemapWhite.
final var tonemapMode: Environment.ToneMapper { get set }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.)
final var tonemapWhite: Double { get set }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 tonemapMode isn’t set to .linear. See also tonemapExposure.
final var volumetricFogAlbedo: Color { get set }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.
final var volumetricFogAmbientInject: Double { get set }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. volumetricFogAmbientInject has a small performance cost when set above 0.0.
final var volumetricFogAnisotropy: Double { get set }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.
final var volumetricFogDensity: Double { get set }The base exponential density of the volumetric fog. Set this to the lowest density you want to have globally. FogVolumes can be used to add to or subtract from this density in specific areas. Fog rendering is exponential as in real life.
final var volumetricFogDetailSpread: Double { get set }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.
final var volumetricFogEmission: Color { get set }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.
final var volumetricFogEmissionEnergy: Double { get set }The brightness of the emitted light from the volumetric fog.
final var volumetricFogEnabled: Bool { get set }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 FogVolumes 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.
final var volumetricFogGiInject: Double { get set }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. volumetricFogGiInject has a small performance cost when set above 0.0.
final var volumetricFogLength: Double { get set }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/volumetricFog/volumeDepth.
final var volumetricFogSkyAffect: Double { get set }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.
final var volumetricFogTemporalReprojectionAmount: Double { get set }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.
final var volumetricFogTemporalReprojectionEnabled: Bool { get set }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 FogVolumes and Light3Ds “ghosting” and leaving a trail behind them. When temporal reprojection is enabled, try to avoid moving FogVolumes or Light3Ds too fast. Short-lived dynamic lighting effects should have lightVolumetricFogEnergy set to 0.0 to avoid ghosting.
final func getGlowLevel(idx: Int32) -> Double Returns the intensity of the glow level idx.
final func setGlowLevel(idx: Int32, intensity: Double) 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.
enum AmbientSourceenum BGModeenum FogModeenum GlowBlendModeenum SDFGIYScaleenum ToneMapperprotocol CaseIterableA type that provides a collection of all of its values.
protocol CustomDebugStringConvertibleA type with a customized textual representation suitable for debugging purposes.
protocol EquatableA type that can be compared for value equality.
protocol Hashable : EquatableA type that can be hashed into a Hasher to produce an integer hash value.
protocol RawRepresentable<RawValue>A type that can be converted to and from an associated raw value.
init?(rawValue: Int64) var debugDescription: String { get }A textual representation of this instance, suitable for debugging
var hashValue: Int { get }static func != (lhs: Self, rhs: Self) -> Bool Returns a Boolean value indicating whether two values are not equal.
func hash(into hasher: inout Hasher)