跳到主要内容

Environment

继承

Resource

简要描述

定义多个渲染选项的环境节点(例如WorldEnvironment)的资源。

描述

用于定义多个环境操作(例如背景SkyColor,环境光,雾,景深...)的环境节点(例如WorldEnvironment)的资源。这些参数影响场景的最终渲染。这些操作的顺序为:

  • 景深模糊

  • 发光

  • 色调图(自动曝光)

  • 调整

成员

类型属性名默认值
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
boolauto_exposure_enabledfalse
floatauto_exposure_max_luma8.0
floatauto_exposure_min_luma0.05
floatauto_exposure_scale0.4
floatauto_exposure_speed0.5
intbackground_camera_feed_id1
intbackground_canvas_max_layer0
Colorbackground_colorColor( 0, 0, 0, 1 )
floatbackground_energy1.0
intbackground_mode0
Skybackground_sky
floatbackground_sky_custom_fov0.0
Basisbackground_sky_orientationBasis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )
Vector3background_sky_rotationVector3( 0, 0, 0 )
Vector3background_sky_rotation_degreesVector3( 0, 0, 0 )
floatdof_blur_far_amount0.1
floatdof_blur_far_distance10.0
booldof_blur_far_enabledfalse
intdof_blur_far_quality1
floatdof_blur_far_transition5.0
floatdof_blur_near_amount0.1
floatdof_blur_near_distance2.0
booldof_blur_near_enabledfalse
intdof_blur_near_quality1
floatdof_blur_near_transition1.0
Colorfog_colorColor( 0.5, 0.6, 0.7, 1 )
floatfog_depth_begin10.0
floatfog_depth_curve1.0
boolfog_depth_enabledtrue
floatfog_depth_end100.0
boolfog_enabledfalse
floatfog_height_curve1.0
boolfog_height_enabledfalse
floatfog_height_max0.0
floatfog_height_min10.0
floatfog_sun_amount0.0
Colorfog_sun_colorColor( 1, 0.9, 0.7, 1 )
floatfog_transmit_curve1.0
boolfog_transmit_enabledfalse
boolglow_bicubic_upscalefalse
intglow_blend_mode2
floatglow_bloom0.0
boolglow_enabledfalse
floatglow_hdr_luminance_cap12.0
floatglow_hdr_scale2.0
floatglow_hdr_threshold1.0
floatglow_intensity0.8
boolglow_levels/1false
boolglow_levels/2false
boolglow_levels/3true
boolglow_levels/4false
boolglow_levels/5true
boolglow_levels/6false
boolglow_levels/7false
floatglow_strength1.0
floatss_reflections_depth_tolerance0.2
boolss_reflections_enabledfalse
floatss_reflections_fade_in0.15
floatss_reflections_fade_out2.0
intss_reflections_max_steps64
boolss_reflections_roughnesstrue
floatssao_ao_channel_affect0.0
floatssao_bias0.01
intssao_blur3
Colorssao_colorColor( 0, 0, 0, 1 )
floatssao_edge_sharpness4.0
boolssao_enabledfalse
floatssao_intensity1.0
floatssao_intensity21.0
floatssao_light_affect0.0
intssao_quality1
floatssao_radius1.0
floatssao_radius20.0
floattonemap_exposure1.0
inttonemap_mode0
floattonemap_white1.0

方法

返回值类型方法名称
boolis_glow_level_enabled(idx: int) const
voidset_glow_level(idx: int, enabled: bool)

枚举

enum BGMode:

  • **BG_KEEP = 5**

在屏幕上保持背景绘制的每个像素。这是最快的背景模式,但只能安全地用于全室内场景(无可见的天空或天空反射)。如果在可见背景的场景中启用,则在移动相机时将看到“鬼影痕迹”伪影。

  • **BG_CLEAR_COLOR = 0**

使用[ProjectSettings.rendering](/docs/api/object/Singleton/ProjectSettings#method-rendering /environment /default_clear_color)中定义的透明颜色清除背景。

  • **BG_COLOR = 1**

使用自定义的清除颜色清除背景。

  • **BG_SKY = 2**

在背景中显示用户定义的天空。

  • **BG_COLOR_SKY = 3**

使用自定义的透明颜色清除背景,并允许为阴影和反射定义天空。此模式比BG_SKY稍快,在反射可见但天空本身不可见的场景(例如,自上而下的相机)中应优先使用。

  • **BG_CANVAS = 4**

在后台显示CanvasLayer

  • **BG_CAMERA_FEED = 6**

在后台显示摄像机源。

  • **BG_MAX = 7**

表示BGMode枚举的大小。


enum GlowBlendMode:

  • **GLOW_BLEND_MODE_ADDITIVE = 0**

附加发光混合模式。主要用于颗粒,发光(光晕),镜头眩光,明亮光源。

  • **GLOW_BLEND_MODE_SCREEN = 1**

屏幕发光混合模式。增加亮度,经常与光晕配合使用。

  • **GLOW_BLEND_MODE_SOFTLIGHT = 2**

柔光发光混合模式。修改对比度,暴露阴影和高光(鲜艳绽放)。

  • **GLOW_BLEND_MODE_REPLACE = 3**

替换发光混合模式。用辉光值替换所有像素的颜色。通过调整发光参数以匹配原始图像的亮度,可以将其用于模拟全屏模糊效果。


enum ToneMapper:

  • **TONE_MAPPER_LINEAR = 0**

线性色调映射器运算符。读取线性数据并将其传递给未修改的对象。

  • **TONE_MAPPER_REINHARDT = 1**

Reinhardt色调映射器运算符。通过以下公式对渲染像素的颜色进行变化:color = color /(1 + color)

  • **TONE_MAPPER_FILMIC = 2**

电影色调映射器运算符。

  • **TONE_MAPPER_ACES = 3**

Academy Color编码系统tonemapper运算符。


enum DOFBlurQuality:

  • **DOF_BLUR_QUALITY_LOW = 0**

低景深模糊质量(最快)。

  • **DOF_BLUR_QUALITY_MEDIUM = 1**

中等景深模糊质量。

  • **DOF_BLUR_QUALITY_HIGH = 2**

高景深模糊质量(最慢)。


enum SSAOBlur:

  • **SSAO_BLUR_DISABLED = 0**

屏幕空间环境光遮挡效果不模糊(最快)。

  • **SSAO_BLUR_1x1 = 1**

屏幕空间环境光遮蔽效果为1×1模糊。

  • **SSAO_BLUR_2x2 = 2**

屏幕空间环境光遮蔽效果2×2模糊。

  • **SSAO_BLUR_3x3 = 3**

屏幕空间环境光遮挡效果的3×3模糊(最慢)。


enum SSAOQuality:

  • **SSAO_QUALITY_LOW = 0**

低质量的屏幕空间环境光遮挡效果(最快)。

  • **SSAO_QUALITY_MEDIUM = 1**

中等质量的屏幕空间环境光遮蔽效果。

  • **SSAO_QUALITY_HIGH = 2**

高质量的屏幕空间环境光遮挡效果(最慢)。


常量

成员说明

  • float adjustment_brightness
Default1.0
setterset_adjustment_brightness(value)
getterget_adjustment_brightness
  • Texture adjustment_color_correction
setterset_adjustment_color_correction(value)
getterget_adjustment_color_correction
  • float adjustment_contrast
Default1.0
setterset_adjustment_contrast(value)
getterget_adjustment_contrast
  • bool adjustment_enabled
Defaultfalse
setterset_adjustment_enable(value)
getteris_adjustment_enabled
  • float adjustment_saturation
Default1.0
setterset_adjustment_saturation(value)
getterget_adjustment_saturation
  • Color ambient_light_color
DefaultColor( 0, 0, 0, 1 )
setterset_ambient_light_color(value)
getterget_ambient_light_color
  • float ambient_light_energy
Default1.0
setterset_ambient_light_energy(value)
getterget_ambient_light_energy
  • float ambient_light_sky_contribution
Default1.0
setterset_ambient_light_sky_contribution(value)
getterget_ambient_light_sky_contribution
  • bool auto_exposure_enabled
Defaultfalse
setterset_tonemap_auto_exposure(value)
getterget_tonemap_auto_exposure
  • float auto_exposure_max_luma
Default8.0
setterset_tonemap_auto_exposure_max(value)
getterget_tonemap_auto_exposure_max
  • float auto_exposure_min_luma
Default0.05
setterset_tonemap_auto_exposure_min(value)
getterget_tonemap_auto_exposure_min
  • float auto_exposure_scale
Default0.4
setterset_tonemap_auto_exposure_grey(value)
getterget_tonemap_auto_exposure_grey
  • float auto_exposure_speed
Default0.5
setterset_tonemap_auto_exposure_speed(value)
getterget_tonemap_auto_exposure_speed
  • int background_camera_feed_id
Default1
setterset_camera_feed_id(value)
getterget_camera_feed_id
  • int background_canvas_max_layer
Default0
setterset_canvas_max_layer(value)
getterget_canvas_max_layer
  • Color background_color
DefaultColor( 0, 0, 0, 1 )
setterset_bg_color(value)
getterget_bg_color
  • float background_energy
Default1.0
setterset_bg_energy(value)
getterget_bg_energy
  • int background_mode
Default0
setterset_background(value)
getterget_background
  • Sky background_sky
setterset_sky(value)
getterget_sky
  • float background_sky_custom_fov
Default0.0
setterset_sky_custom_fov(value)
getterget_sky_custom_fov
  • Basis background_sky_orientation
DefaultBasis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )
setterset_sky_orientation(value)
getterget_sky_orientation
  • Vector3 background_sky_rotation
DefaultVector3( 0, 0, 0 )
setterset_sky_rotation(value)
getterget_sky_rotation
  • Vector3 background_sky_rotation_degrees
DefaultVector3( 0, 0, 0 )
setterset_sky_rotation_degrees(value)
getterget_sky_rotation_degrees
  • float dof_blur_far_amount
Default0.1
setterset_dof_blur_far_amount(value)
getterget_dof_blur_far_amount
  • float dof_blur_far_distance
Default10.0
setterset_dof_blur_far_distance(value)
getterget_dof_blur_far_distance
  • bool dof_blur_far_enabled
Defaultfalse
setterset_dof_blur_far_enabled(value)
getteris_dof_blur_far_enabled
  • int dof_blur_far_quality
Default1
setterset_dof_blur_far_quality(value)
getterget_dof_blur_far_quality
  • float dof_blur_far_transition
Default5.0
setterset_dof_blur_far_transition(value)
getterget_dof_blur_far_transition
  • float dof_blur_near_amount
Default0.1
setterset_dof_blur_near_amount(value)
getterget_dof_blur_near_amount
  • float dof_blur_near_distance
Default2.0
setterset_dof_blur_near_distance(value)
getterget_dof_blur_near_distance
  • bool dof_blur_near_enabled
Defaultfalse
setterset_dof_blur_near_enabled(value)
getteris_dof_blur_near_enabled
  • int dof_blur_near_quality
Default1
setterset_dof_blur_near_quality(value)
getterget_dof_blur_near_quality
  • float dof_blur_near_transition
Default1.0
setterset_dof_blur_near_transition(value)
getterget_dof_blur_near_transition
  • Color fog_color
DefaultColor( 0.5, 0.6, 0.7, 1 )
setterset_fog_color(value)
getterget_fog_color
  • float fog_depth_begin
Default10.0
setterset_fog_depth_begin(value)
getterget_fog_depth_begin
  • float fog_depth_curve
Default1.0
setterset_fog_depth_curve(value)
getterget_fog_depth_curve
  • bool fog_depth_enabled
Defaulttrue
setterset_fog_depth_enabled(value)
getteris_fog_depth_enabled
  • float fog_depth_end
Default100.0
setterset_fog_depth_end(value)
getterget_fog_depth_end
  • bool fog_enabled
Defaultfalse
setterset_fog_enabled(value)
getteris_fog_enabled
  • float fog_height_curve
Default1.0
setterset_fog_height_curve(value)
getterget_fog_height_curve
  • bool fog_height_enabled
Defaultfalse
setterset_fog_height_enabled(value)
getteris_fog_height_enabled
  • float fog_height_max
Default0.0
setterset_fog_height_max(value)
getterget_fog_height_max
  • float fog_height_min
Default10.0
setterset_fog_height_min(value)
getterget_fog_height_min
  • float fog_sun_amount
Default0.0
setterset_fog_sun_amount(value)
getterget_fog_sun_amount
  • Color fog_sun_color
DefaultColor( 1, 0.9, 0.7, 1 )
setterset_fog_sun_color(value)
getterget_fog_sun_color
  • float fog_transmit_curve
Default1.0
setterset_fog_transmit_curve(value)
getterget_fog_transmit_curve
  • bool fog_transmit_enabled
Defaultfalse
setterset_fog_transmit_enabled(value)
getteris_fog_transmit_enabled
  • bool glow_bicubic_upscale
Defaultfalse
setterset_glow_bicubic_upscale(value)
getteris_glow_bicubic_upscale_enabled
  • int glow_blend_mode
Default2
setterset_glow_blend_mode(value)
getterget_glow_blend_mode
  • float glow_bloom
Default0.0
setterset_glow_bloom(value)
getterget_glow_bloom
  • bool glow_enabled
Defaultfalse
setterset_glow_enabled(value)
getteris_glow_enabled
  • float glow_hdr_luminance_cap
Default12.0
setterset_glow_hdr_luminance_cap(value)
getterget_glow_hdr_luminance_cap
  • float glow_hdr_scale
Default2.0
setterset_glow_hdr_bleed_scale(value)
getterget_glow_hdr_bleed_scale
  • float glow_hdr_threshold
Default1.0
setterset_glow_hdr_bleed_threshold(value)
getterget_glow_hdr_bleed_threshold
  • float glow_intensity
Default0.8
setterset_glow_intensity(value)
getterget_glow_intensity
  • bool glow_levels/1
Defaultfalse
setterset_glow_level(value)
getteris_glow_level_enabled
  • bool glow_levels/2
Defaultfalse
setterset_glow_level(value)
getteris_glow_level_enabled
  • bool glow_levels/3
Defaulttrue
setterset_glow_level(value)
getteris_glow_level_enabled
  • bool glow_levels/4
Defaultfalse
setterset_glow_level(value)
getteris_glow_level_enabled
  • bool glow_levels/5
Defaulttrue
setterset_glow_level(value)
getteris_glow_level_enabled
  • bool glow_levels/6
Defaultfalse
setterset_glow_level(value)
getteris_glow_level_enabled
  • bool glow_levels/7
Defaultfalse
setterset_glow_level(value)
getteris_glow_level_enabled
  • float glow_strength
Default1.0
setterset_glow_strength(value)
getterget_glow_strength
  • float ss_reflections_depth_tolerance
Default0.2
setterset_ssr_depth_tolerance(value)
getterget_ssr_depth_tolerance
  • bool ss_reflections_enabled
Defaultfalse
setterset_ssr_enabled(value)
getteris_ssr_enabled
  • float ss_reflections_fade_in
Default0.15
setterset_ssr_fade_in(value)
getterget_ssr_fade_in
  • float ss_reflections_fade_out
Default2.0
setterset_ssr_fade_out(value)
getterget_ssr_fade_out
  • int ss_reflections_max_steps
Default64
setterset_ssr_max_steps(value)
getterget_ssr_max_steps
  • bool ss_reflections_roughness
Defaulttrue
setterset_ssr_rough(value)
getteris_ssr_rough
  • float ssao_ao_channel_affect
Default0.0
setterset_ssao_ao_channel_affect(value)
getterget_ssao_ao_channel_affect
  • float ssao_bias
Default0.01
setterset_ssao_bias(value)
getterget_ssao_bias
  • int ssao_blur
Default3
setterset_ssao_blur(value)
getterget_ssao_blur
  • Color ssao_color
DefaultColor( 0, 0, 0, 1 )
setterset_ssao_color(value)
getterget_ssao_color
  • float ssao_edge_sharpness
Default4.0
setterset_ssao_edge_sharpness(value)
getterget_ssao_edge_sharpness
  • bool ssao_enabled
Defaultfalse
setterset_ssao_enabled(value)
getteris_ssao_enabled
  • float ssao_intensity
Default1.0
setterset_ssao_intensity(value)
getterget_ssao_intensity
  • float ssao_intensity2
Default1.0
setterset_ssao_intensity2(value)
getterget_ssao_intensity2
  • float ssao_light_affect
Default0.0
setterset_ssao_direct_light_affect(value)
getterget_ssao_direct_light_affect
  • int ssao_quality
Default1
setterset_ssao_quality(value)
getterget_ssao_quality
  • float ssao_radius
Default1.0
setterset_ssao_radius(value)
getterget_ssao_radius
  • float ssao_radius2
Default0.0
setterset_ssao_radius2(value)
getterget_ssao_radius2
  • float tonemap_exposure
Default1.0
setterset_tonemap_exposure(value)
getterget_tonemap_exposure
  • int tonemap_mode
Default0
setterset_tonemapper(value)
getterget_tonemapper
  • float tonemap_white
Default1.0
setterset_tonemap_white(value)
getterget_tonemap_white

方法说明

  • is_glow_level_enabled is_glow_level_enabled(idx: int) const

如果指定发光级别idx,则返回true,否则返回false


  • set_glow_level set_glow_level(idx: int, enabled: bool)

启用或禁用索引为idx的辉光级别。每个级别都依赖于上一个级别。这意味着启用较高的发光级别将降低发光效果的渲染速度,即使未启用先前的发光级别也是如此。