Renamed Environment to Environment3D, and WorldEnvironment to WorldEnvironment3D.

This commit is contained in:
Relintai 2022-08-29 17:21:40 +02:00
parent 2aee6ab0bb
commit e4ae7f2ebc
51 changed files with 1001 additions and 1001 deletions

View File

@ -148,8 +148,8 @@
If not [constant DOPPLER_TRACKING_DISABLED], this camera will simulate the [url=https://en.wikipedia.org/wiki/Doppler_effect]Doppler effect[/url] for objects changed in particular [code]_process[/code] methods. The Doppler effect is only simulated for [AudioStreamPlayer3D] nodes that have [member AudioStreamPlayer3D.doppler_tracking] set to a value other than [constant AudioStreamPlayer3D.DOPPLER_TRACKING_DISABLED].
[b]Note:[/b] To toggle the Doppler effect preview in the editor, use the Perspective menu in the top-left corner of the 3D viewport and toggle [b]Enable Doppler[/b].
</member>
<member name="environment" type="Environment" setter="set_environment" getter="get_environment">
The [Environment] to use for this camera.
<member name="environment" type="Environment3D" setter="set_environment" getter="get_environment">
The [Environment3D] to use for this camera.
</member>
<member name="far" type="float" setter="set_zfar" getter="get_zfar" default="100.0">
The distance to the far culling boundary for this camera relative to its local Z axis.

View File

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Environment" inherits="Resource" version="3.8">
<class name="Environment3D" inherits="Resource" version="3.8">
<brief_description>
Resource for environment nodes (like [WorldEnvironment]) that define multiple rendering options.
Resource for environment nodes (like [WorldEnvironment3D]) that define multiple rendering options.
</brief_description>
<description>
Resource for environment nodes (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:
Resource for environment nodes (like [WorldEnvironment3D]) 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
- Glow
- Tonemap (Auto Exposure)
@ -16,7 +16,7 @@
Note that [member ProjectSettings.rendering/quality/intended_usage/framebuffer_allocation] 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.
</description>
<tutorials>
<link title="Environment and post-processing">$DOCS_URL/tutorials/3d/environment_and_post_processing.html</link>
<link title="Environment3D and post-processing">$DOCS_URL/tutorials/3d/environment_and_post_processing.html</link>
<link title="Light transport in game engines">$DOCS_URL/tutorials/3d/high_dynamic_range.html</link>
<link title="3D Material Testers Demo">https://godotengine.org/asset-library/asset/123</link>
<link title="2D HDR Demo">https://godotengine.org/asset-library/asset/110</link>
@ -89,7 +89,7 @@
<member name="background_energy" type="float" setter="set_bg_energy" getter="get_bg_energy" default="1.0">
The power of the light emitted by the background.
</member>
<member name="background_mode" type="int" setter="set_background" getter="get_background" enum="Environment.BGMode" default="0">
<member name="background_mode" type="int" setter="set_background" getter="get_background" enum="Environment3D.BGMode" default="0">
The background mode. See [enum BGMode] for possible values.
</member>
<member name="background_sky" type="Sky" setter="set_sky" getter="get_sky">
@ -116,7 +116,7 @@
<member name="dof_blur_far_enabled" type="bool" setter="set_dof_blur_far_enabled" getter="is_dof_blur_far_enabled" default="false">
If [code]true[/code], enables the depth-of-field far blur effect.
</member>
<member name="dof_blur_far_quality" type="int" setter="set_dof_blur_far_quality" getter="get_dof_blur_far_quality" enum="Environment.DOFBlurQuality" default="1">
<member name="dof_blur_far_quality" type="int" setter="set_dof_blur_far_quality" getter="get_dof_blur_far_quality" enum="Environment3D.DOFBlurQuality" default="1">
The depth-of-field far blur's quality. Higher values can mitigate the visible banding effect seen at higher strengths, but are much slower.
</member>
<member name="dof_blur_far_transition" type="float" setter="set_dof_blur_far_transition" getter="get_dof_blur_far_transition" default="5.0">
@ -131,7 +131,7 @@
<member name="dof_blur_near_enabled" type="bool" setter="set_dof_blur_near_enabled" getter="is_dof_blur_near_enabled" default="false">
If [code]true[/code], enables the depth-of-field near blur effect.
</member>
<member name="dof_blur_near_quality" type="int" setter="set_dof_blur_near_quality" getter="get_dof_blur_near_quality" enum="Environment.DOFBlurQuality" default="1">
<member name="dof_blur_near_quality" type="int" setter="set_dof_blur_near_quality" getter="get_dof_blur_near_quality" enum="Environment3D.DOFBlurQuality" default="1">
The depth-of-field near blur's quality. Higher values can mitigate the visible banding effect seen at higher strengths, but are much slower.
</member>
<member name="dof_blur_near_transition" type="float" setter="set_dof_blur_near_transition" getter="get_dof_blur_near_transition" default="1.0">
@ -183,7 +183,7 @@
Smooths out the blockiness created by sampling higher levels, at the cost of performance.
[b]Note:[/b] When using the GLES2 renderer, this is only available if the GPU supports the [code]GL_EXT_gpu_shader4[/code] extension.
</member>
<member name="glow_blend_mode" type="int" setter="set_glow_blend_mode" getter="get_glow_blend_mode" enum="Environment.GlowBlendMode" default="2">
<member name="glow_blend_mode" type="int" setter="set_glow_blend_mode" getter="get_glow_blend_mode" enum="Environment3D.GlowBlendMode" default="2">
The glow blending mode.
</member>
<member name="glow_bloom" type="float" setter="set_glow_bloom" getter="get_glow_bloom" default="0.0">
@ -257,7 +257,7 @@
<member name="ssao_bias" type="float" setter="set_ssao_bias" getter="get_ssao_bias" default="0.01">
The screen-space ambient occlusion bias. This should be kept high enough to prevent "smooth" curves from being affected by ambient occlusion.
</member>
<member name="ssao_blur" type="int" setter="set_ssao_blur" getter="get_ssao_blur" enum="Environment.SSAOBlur" default="3">
<member name="ssao_blur" type="int" setter="set_ssao_blur" getter="get_ssao_blur" enum="Environment3D.SSAOBlur" default="3">
The screen-space ambient occlusion blur quality. See [enum SSAOBlur] for possible values.
</member>
<member name="ssao_color" type="Color" setter="set_ssao_color" getter="get_ssao_color" default="Color( 0, 0, 0, 1 )">
@ -278,7 +278,7 @@
<member name="ssao_light_affect" type="float" setter="set_ssao_direct_light_affect" getter="get_ssao_direct_light_affect" default="0.0">
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 [code]0[/code] will make the SSAO effect visible in direct light.
</member>
<member name="ssao_quality" type="int" setter="set_ssao_quality" getter="get_ssao_quality" enum="Environment.SSAOQuality" default="1">
<member name="ssao_quality" type="int" setter="set_ssao_quality" getter="get_ssao_quality" enum="Environment3D.SSAOQuality" default="1">
The screen-space ambient occlusion quality. Higher qualities will make better use of small objects for ambient occlusion, but are slower.
</member>
<member name="ssao_radius" type="float" setter="set_ssao_radius" getter="get_ssao_radius" default="1.0">
@ -290,7 +290,7 @@
<member name="tonemap_exposure" type="float" setter="set_tonemap_exposure" getter="get_tonemap_exposure" default="1.0">
The default exposure used for tonemapping.
</member>
<member name="tonemap_mode" type="int" setter="set_tonemapper" getter="get_tonemapper" enum="Environment.ToneMapper" default="0">
<member name="tonemap_mode" type="int" setter="set_tonemapper" getter="get_tonemapper" enum="Environment3D.ToneMapper" default="0">
The tonemapping mode to use. Tonemapping is the process that "converts" HDR values to be suitable for rendering on a SDR display. (Godot doesn't support rendering on HDR displays yet.)
</member>
<member name="tonemap_white" type="float" setter="set_tonemap_white" getter="get_tonemap_white" default="1.0">

View File

@ -15,7 +15,7 @@
The [Gradient] that will be used to fill the texture.
</member>
<member name="use_hdr" type="bool" setter="set_use_hdr" getter="is_using_hdr" default="false">
If [code]true[/code], the generated texture will support high dynamic range ([constant Image.FORMAT_RGBAF] format). This allows for glow effects to work if [member Environment.glow_enabled] is [code]true[/code]. If [code]false[/code], the generated texture will use low dynamic range; overbright colors will be clamped ([constant Image.FORMAT_RGBA8] format).
If [code]true[/code], the generated texture will support high dynamic range ([constant Image.FORMAT_RGBAF] format). This allows for glow effects to work if [member Environment3D.glow_enabled] is [code]true[/code]. If [code]false[/code], the generated texture will use low dynamic range; overbright colors will be clamped ([constant Image.FORMAT_RGBA8] format).
</member>
<member name="width" type="int" setter="set_width" getter="get_width" default="2048">
The number of color samples that will be obtained from the [Gradient].

View File

@ -31,7 +31,7 @@
The gradient repeat type, one of the [enum Repeat] values. The texture is filled starting from [member fill_from] to [member fill_to] offsets by default, but the gradient fill can be repeated to cover the entire texture.
</member>
<member name="use_hdr" type="bool" setter="set_use_hdr" getter="is_using_hdr" default="false">
If [code]true[/code], the generated texture will support high dynamic range ([constant Image.FORMAT_RGBAF] format). This allows for glow effects to work if [member Environment.glow_enabled] is [code]true[/code]. If [code]false[/code], the generated texture will use low dynamic range; overbright colors will be clamped ([constant Image.FORMAT_RGBA8] format).
If [code]true[/code], the generated texture will support high dynamic range ([constant Image.FORMAT_RGBAF] format). This allows for glow effects to work if [member Environment3D.glow_enabled] is [code]true[/code]. If [code]false[/code], the generated texture will use low dynamic range; overbright colors will be clamped ([constant Image.FORMAT_RGBA8] format).
</member>
<member name="width" type="int" setter="set_width" getter="get_width" default="64">
The number of horizontal color samples that will be obtained from the [Gradient], which also represents the texture's width.

View File

@ -86,7 +86,7 @@
[b]Note:[/b] This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).
</member>
<member name="shaded" type="bool" setter="set_draw_flag" getter="get_draw_flag" default="false">
If [code]true[/code], the [Light] in the [Environment] has effects on the label.
If [code]true[/code], the [Light] in the [Environment3D] has effects on the label.
</member>
<member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
The text to display on screen.

View File

@ -4,7 +4,7 @@
A type of [Sky] used to draw a background texture.
</brief_description>
<description>
A resource referenced in an [Environment] that is used to draw a background. The Panorama sky functions similar to skyboxes in other engines, except it uses an equirectangular sky map instead of a cube map.
A resource referenced in an [Environment3D] that is used to draw a background. The Panorama sky functions similar to skyboxes in other engines, except it uses an equirectangular sky map instead of a cube map.
Using an HDR panorama is strongly recommended for accurate, high-quality reflections. Godot supports the Radiance HDR ([code].hdr[/code]) and OpenEXR ([code].exr[/code]) image formats for this purpose.
You can use [url=https://danilw.github.io/GLSL-howto/cubemap_to_panorama_js/cubemap_to_panorama.html]this tool[/url] to convert a cube map to an equirectangular sky map.
</description>

View File

@ -1606,10 +1606,10 @@
Use the default unless correcting for a problem on particular hardware.
</member>
<member name="rendering/environment/default_clear_color" type="Color" setter="" getter="" default="Color( 0.3, 0.3, 0.3, 1 )">
Default background clear color. Overridable per [Viewport] using its [Environment]. See [member Environment.background_mode] and [member Environment.background_color] in particular. To change this default color programmatically, use [method RenderingServer.set_default_clear_color].
Default background clear color. Overridable per [Viewport] using its [Environment3D]. See [member Environment3D.background_mode] and [member Environment3D.background_color] in particular. To change this default color programmatically, use [method RenderingServer.set_default_clear_color].
</member>
<member name="rendering/environment/default_environment" type="String" setter="" getter="" default="&quot;&quot;">
[Environment] that will be used as a fallback environment in case a scene does not specify its own environment. The default environment is loaded in at scene load time regardless of whether you have set an environment or not. If you do not rely on the fallback environment, it is best to delete [code]default_env.tres[/code], or to specify a different default environment here.
[Environment3D] that will be used as a fallback environment in case a scene does not specify its own environment. The default environment is loaded in at scene load time regardless of whether you have set an environment or not. If you do not rely on the fallback environment, it is best to delete [code]default_env.tres[/code], or to specify a different default environment here.
</member>
<member name="rendering/gles2/compatibility/disable_half_float" type="bool" setter="" getter="" default="false">
The use of half-float vertex compression may be producing rendering errors on some platforms (especially iOS). These have been seen particularly in particles. Disabling half-float may resolve these problems.
@ -1713,11 +1713,11 @@
[b]Note:[/b] Generally you should only use this option if you encounter bugs when it is set to [code]false[/code], i.e. there are problems with the default method.
</member>
<member name="rendering/quality/depth/hdr" type="bool" setter="" getter="" default="true">
If [code]true[/code], allocates the root [Viewport]'s framebuffer with high dynamic range. High dynamic range allows the use of [Color] values greater than 1. This must be set to [code]true[/code] for glow rendering to work if [member Environment.glow_hdr_threshold] is greater than or equal to [code]1.0[/code].
If [code]true[/code], allocates the root [Viewport]'s framebuffer with high dynamic range. High dynamic range allows the use of [Color] values greater than 1. This must be set to [code]true[/code] for glow rendering to work if [member Environment3D.glow_hdr_threshold] is greater than or equal to [code]1.0[/code].
[b]Note:[/b] Only available on the GLES3 backend.
</member>
<member name="rendering/quality/depth/hdr.mobile" type="bool" setter="" getter="" default="false">
Lower-end override for [member rendering/quality/depth/hdr] on mobile devices, due to performance concerns or driver support. This must be set to [code]true[/code] for glow rendering to work if [member Environment.glow_hdr_threshold] is greater than or equal to [code]1.0[/code].
Lower-end override for [member rendering/quality/depth/hdr] on mobile devices, due to performance concerns or driver support. This must be set to [code]true[/code] for glow rendering to work if [member Environment3D.glow_hdr_threshold] is greater than or equal to [code]1.0[/code].
[b]Note:[/b] Only available on the GLES3 backend.
</member>
<member name="rendering/quality/depth/use_32_bpc_depth" type="bool" setter="" getter="" default="false">
@ -1767,7 +1767,7 @@
If [code]true[/code], uses nearest-neighbor mipmap filtering when using mipmaps (also called "bilinear filtering"), which will result in visible seams appearing between mipmap stages. This may increase performance in mobile as less memory bandwidth is used. If [code]false[/code], linear mipmap filtering (also called "trilinear filtering") is used.
</member>
<member name="rendering/quality/intended_usage/framebuffer_allocation" type="int" setter="" getter="" default="2">
Strategy used for framebuffer allocation. The simpler it is, the less resources it uses (but the less features it supports). If set to "2D Without Sampling" or "3D Without Effects", sample buffers will not be allocated. This means [code]SCREEN_TEXTURE[/code] and [code]DEPTH_TEXTURE[/code] will not be available in shaders and post-processing effects such as glow will not be available in [Environment].
Strategy used for framebuffer allocation. The simpler it is, the less resources it uses (but the less features it supports). If set to "2D Without Sampling" or "3D Without Effects", sample buffers will not be allocated. This means [code]SCREEN_TEXTURE[/code] and [code]DEPTH_TEXTURE[/code] will not be available in shaders and post-processing effects such as glow will not be available in [Environment3D].
</member>
<member name="rendering/quality/intended_usage/framebuffer_allocation.mobile" type="int" setter="" getter="" default="3">
Lower-end override for [member rendering/quality/intended_usage/framebuffer_allocation] on mobile devices, due to performance concerns or driver support.

View File

@ -5,8 +5,8 @@
</brief_description>
<description>
Capture its surroundings as a dual paraboloid image, and stores versions of it with increasing levels of blur to simulate different material roughnesses.
The [ReflectionProbe] is used to create high-quality reflections at a low performance cost (when [member update_mode] is [constant UPDATE_ONCE]). [ReflectionProbe]s can be blended together and with the rest of the scene smoothly. [ReflectionProbe]s can also be combined with [GIProbe] and screen-space reflections ([member Environment.ss_reflections_enabled]) to get more accurate reflections in specific areas. [ReflectionProbe]s render all objects within their [member cull_mask], so updating them can be quite expensive. It is best to update them once with the important static objects and then leave them as-is.
[b]Note:[/b] Unlike [GIProbe], [ReflectionProbe]s only source their environment from a [WorldEnvironment] node. If you specify an [Environment] resource within a [Camera] node, it will be ignored by the [ReflectionProbe]. This can lead to incorrect lighting within the [ReflectionProbe].
The [ReflectionProbe] is used to create high-quality reflections at a low performance cost (when [member update_mode] is [constant UPDATE_ONCE]). [ReflectionProbe]s can be blended together and with the rest of the scene smoothly. [ReflectionProbe]s can also be combined with [GIProbe] and screen-space reflections ([member Environment3D.ss_reflections_enabled]) to get more accurate reflections in specific areas. [ReflectionProbe]s render all objects within their [member cull_mask], so updating them can be quite expensive. It is best to update them once with the important static objects and then leave them as-is.
[b]Note:[/b] Unlike [GIProbe], [ReflectionProbe]s only source their environment from a [WorldEnvironment3D] node. If you specify an [Environment3D] resource within a [Camera] node, it will be ignored by the [ReflectionProbe]. This can lead to incorrect lighting within the [ReflectionProbe].
[b]Note:[/b] By default, Godot will only render 16 reflection probes. If you need more, increase the number of atlas subdivisions. This setting can be found in [member ProjectSettings.rendering/quality/reflections/atlas_subdiv].
[b]Note:[/b] The GLES2 backend will only display two reflection probes at the same time for a single mesh. If possible, split up large meshes that span over multiple reflection probes into smaller ones.
</description>

View File

@ -734,7 +734,7 @@
<argument index="4" name="saturation" type="float" />
<argument index="5" name="ramp" type="RID" />
<description>
Sets the values to be used with the "Adjustment" post-process effect. See [Environment] for more details.
Sets the values to be used with the "Adjustment" post-process effect. See [Environment3D] for more details.
</description>
</method>
<method name="environment_set_ambient_light">
@ -744,15 +744,15 @@
<argument index="2" name="energy" type="float" default="1.0" />
<argument index="3" name="sky_contibution" type="float" default="0.0" />
<description>
Sets the ambient light parameters. See [Environment] for more details.
Sets the ambient light parameters. See [Environment3D] for more details.
</description>
</method>
<method name="environment_set_background">
<return type="void" />
<argument index="0" name="env" type="RID" />
<argument index="1" name="bg" type="int" enum="RenderingServer.EnvironmentBG" />
<argument index="1" name="bg" type="int" enum="RenderingServer.Environment3DBG" />
<description>
Sets the [i]BGMode[/i] of the environment. Equivalent to [member Environment.background_mode].
Sets the [i]BGMode[/i] of the environment. Equivalent to [member Environment3D.background_mode].
</description>
</method>
<method name="environment_set_bg_color">
@ -786,9 +786,9 @@
<argument index="2" name="distance" type="float" />
<argument index="3" name="transition" type="float" />
<argument index="4" name="far_amount" type="float" />
<argument index="5" name="quality" type="int" enum="RenderingServer.EnvironmentDOFBlurQuality" />
<argument index="5" name="quality" type="int" enum="RenderingServer.Environment3DDOFBlurQuality" />
<description>
Sets the values to be used with the "DoF Far Blur" post-process effect. See [Environment] for more details.
Sets the values to be used with the "DoF Far Blur" post-process effect. See [Environment3D] for more details.
</description>
</method>
<method name="environment_set_dof_blur_near">
@ -798,9 +798,9 @@
<argument index="2" name="distance" type="float" />
<argument index="3" name="transition" type="float" />
<argument index="4" name="far_amount" type="float" />
<argument index="5" name="quality" type="int" enum="RenderingServer.EnvironmentDOFBlurQuality" />
<argument index="5" name="quality" type="int" enum="RenderingServer.Environment3DDOFBlurQuality" />
<description>
Sets the values to be used with the "DoF Near Blur" post-process effect. See [Environment] for more details.
Sets the values to be used with the "DoF Near Blur" post-process effect. See [Environment3D] for more details.
</description>
</method>
<method name="environment_set_fog">
@ -811,7 +811,7 @@
<argument index="3" name="sun_color" type="Color" />
<argument index="4" name="sun_amount" type="float" />
<description>
Sets the variables to be used with the scene fog. See [Environment] for more details.
Sets the variables to be used with the scene fog. See [Environment3D] for more details.
</description>
</method>
<method name="environment_set_fog_depth">
@ -824,7 +824,7 @@
<argument index="5" name="transmit" type="bool" />
<argument index="6" name="transmit_curve" type="float" />
<description>
Sets the variables to be used with the fog depth effect. See [Environment] for more details.
Sets the variables to be used with the fog depth effect. See [Environment3D] for more details.
</description>
</method>
<method name="environment_set_fog_height">
@ -835,7 +835,7 @@
<argument index="3" name="max_height" type="float" />
<argument index="4" name="height_curve" type="float" />
<description>
Sets the variables to be used with the fog height effect. See [Environment] for more details.
Sets the variables to be used with the fog height effect. See [Environment3D] for more details.
</description>
</method>
<method name="environment_set_glow">
@ -846,14 +846,14 @@
<argument index="3" name="intensity" type="float" />
<argument index="4" name="strength" type="float" />
<argument index="5" name="bloom_threshold" type="float" />
<argument index="6" name="blend_mode" type="int" enum="RenderingServer.EnvironmentGlowBlendMode" />
<argument index="6" name="blend_mode" type="int" enum="RenderingServer.Environment3DGlowBlendMode" />
<argument index="7" name="hdr_bleed_threshold" type="float" />
<argument index="8" name="hdr_bleed_scale" type="float" />
<argument index="9" name="hdr_luminance_cap" type="float" />
<argument index="10" name="bicubic_upscale" type="bool" />
<argument index="11" name="high_quality" type="bool" />
<description>
Sets the variables to be used with the "glow" post-process effect. See [Environment] for more details.
Sets the variables to be used with the "glow" post-process effect. See [Environment3D] for more details.
</description>
</method>
<method name="environment_set_sky">
@ -861,7 +861,7 @@
<argument index="0" name="env" type="RID" />
<argument index="1" name="sky" type="RID" />
<description>
Sets the [Sky] to be used as the environment's background when using [i]BGMode[/i] sky. Equivalent to [member Environment.background_sky].
Sets the [Sky] to be used as the environment's background when using [i]BGMode[/i] sky. Equivalent to [member Environment3D.background_sky].
</description>
</method>
<method name="environment_set_sky_custom_fov">
@ -869,7 +869,7 @@
<argument index="0" name="env" type="RID" />
<argument index="1" name="scale" type="float" />
<description>
Sets a custom field of view for the background [Sky]. Equivalent to [member Environment.background_sky_custom_fov].
Sets a custom field of view for the background [Sky]. Equivalent to [member Environment3D.background_sky_custom_fov].
</description>
</method>
<method name="environment_set_sky_orientation">
@ -877,7 +877,7 @@
<argument index="0" name="env" type="RID" />
<argument index="1" name="orientation" type="Basis" />
<description>
Sets the rotation of the background [Sky] expressed as a [Basis]. Equivalent to [member Environment.background_sky_orientation].
Sets the rotation of the background [Sky] expressed as a [Basis]. Equivalent to [member Environment3D.background_sky_orientation].
</description>
</method>
<method name="environment_set_ssao">
@ -892,11 +892,11 @@
<argument index="7" name="light_affect" type="float" />
<argument index="8" name="ao_channel_affect" type="float" />
<argument index="9" name="color" type="Color" />
<argument index="10" name="quality" type="int" enum="RenderingServer.EnvironmentSSAOQuality" />
<argument index="11" name="blur" type="int" enum="RenderingServer.EnvironmentSSAOBlur" />
<argument index="10" name="quality" type="int" enum="RenderingServer.Environment3DSSAOQuality" />
<argument index="11" name="blur" type="int" enum="RenderingServer.Environment3DSSAOBlur" />
<argument index="12" name="bilateral_sharpness" type="float" />
<description>
Sets the variables to be used with the "Screen Space Ambient Occlusion (SSAO)" post-process effect. See [Environment] for more details.
Sets the variables to be used with the "Screen Space Ambient Occlusion (SSAO)" post-process effect. See [Environment3D] for more details.
</description>
</method>
<method name="environment_set_ssr">
@ -909,13 +909,13 @@
<argument index="5" name="depth_tolerance" type="float" />
<argument index="6" name="roughness" type="bool" />
<description>
Sets the variables to be used with the "screen space reflections" post-process effect. See [Environment] for more details.
Sets the variables to be used with the "screen space reflections" post-process effect. See [Environment3D] for more details.
</description>
</method>
<method name="environment_set_tonemap">
<return type="void" />
<argument index="0" name="env" type="RID" />
<argument index="1" name="tone_mapper" type="int" enum="RenderingServer.EnvironmentToneMapper" />
<argument index="1" name="tone_mapper" type="int" enum="RenderingServer.Environment3DToneMapper" />
<argument index="2" name="exposure" type="float" />
<argument index="3" name="white" type="float" />
<argument index="4" name="auto_exposure" type="bool" />
@ -924,7 +924,7 @@
<argument index="7" name="auto_exp_speed" type="float" />
<argument index="8" name="auto_exp_grey" type="float" />
<description>
Sets the variables to be used with the "tonemap" post-process effect. See [Environment] for more details.
Sets the variables to be used with the "tonemap" post-process effect. See [Environment3D] for more details.
</description>
</method>
<method name="finish">
@ -3273,83 +3273,83 @@
<constant name="REFLECTION_PROBE_UPDATE_ALWAYS" value="1" enum="ReflectionProbeUpdateMode">
Reflection probe will update each frame. This mode is necessary to capture moving objects.
</constant>
<constant name="ENV_BG_CLEAR_COLOR" value="0" enum="EnvironmentBG">
<constant name="ENV_BG_CLEAR_COLOR" value="0" enum="Environment3DBG">
Use the clear color as background.
</constant>
<constant name="ENV_BG_COLOR" value="1" enum="EnvironmentBG">
<constant name="ENV_BG_COLOR" value="1" enum="Environment3DBG">
Use a specified color as the background.
</constant>
<constant name="ENV_BG_SKY" value="2" enum="EnvironmentBG">
<constant name="ENV_BG_SKY" value="2" enum="Environment3DBG">
Use a sky resource for the background.
</constant>
<constant name="ENV_BG_COLOR_SKY" value="3" enum="EnvironmentBG">
<constant name="ENV_BG_COLOR_SKY" value="3" enum="Environment3DBG">
Use a custom color for background, but use a sky for shading and reflections.
</constant>
<constant name="ENV_BG_CANVAS" value="4" enum="EnvironmentBG">
<constant name="ENV_BG_CANVAS" value="4" enum="Environment3DBG">
Use a specified canvas layer as the background. This can be useful for instantiating a 2D scene in a 3D world.
</constant>
<constant name="ENV_BG_KEEP" value="5" enum="EnvironmentBG">
<constant name="ENV_BG_KEEP" value="5" enum="Environment3DBG">
Do not clear the background, use whatever was rendered last frame as the background.
</constant>
<constant name="ENV_BG_MAX" value="7" enum="EnvironmentBG">
Represents the size of the [enum EnvironmentBG] enum.
<constant name="ENV_BG_MAX" value="7" enum="Environment3DBG">
Represents the size of the [enum Environment3DBG] enum.
</constant>
<constant name="ENV_DOF_BLUR_QUALITY_LOW" value="0" enum="EnvironmentDOFBlurQuality">
<constant name="ENV_DOF_BLUR_QUALITY_LOW" value="0" enum="Environment3DDOFBlurQuality">
Use lowest blur quality. Fastest, but may look bad.
</constant>
<constant name="ENV_DOF_BLUR_QUALITY_MEDIUM" value="1" enum="EnvironmentDOFBlurQuality">
<constant name="ENV_DOF_BLUR_QUALITY_MEDIUM" value="1" enum="Environment3DDOFBlurQuality">
Use medium blur quality.
</constant>
<constant name="ENV_DOF_BLUR_QUALITY_HIGH" value="2" enum="EnvironmentDOFBlurQuality">
<constant name="ENV_DOF_BLUR_QUALITY_HIGH" value="2" enum="Environment3DDOFBlurQuality">
Used highest blur quality. Looks the best, but is the slowest.
</constant>
<constant name="GLOW_BLEND_MODE_ADDITIVE" value="0" enum="EnvironmentGlowBlendMode">
<constant name="GLOW_BLEND_MODE_ADDITIVE" value="0" enum="Environment3DGlowBlendMode">
Add the effect of the glow on top of the scene.
</constant>
<constant name="GLOW_BLEND_MODE_SCREEN" value="1" enum="EnvironmentGlowBlendMode">
<constant name="GLOW_BLEND_MODE_SCREEN" value="1" enum="Environment3DGlowBlendMode">
Blends the glow effect with the screen. Does not get as bright as additive.
</constant>
<constant name="GLOW_BLEND_MODE_SOFTLIGHT" value="2" enum="EnvironmentGlowBlendMode">
<constant name="GLOW_BLEND_MODE_SOFTLIGHT" value="2" enum="Environment3DGlowBlendMode">
Produces a subtle color disturbance around objects.
</constant>
<constant name="GLOW_BLEND_MODE_REPLACE" value="3" enum="EnvironmentGlowBlendMode">
<constant name="GLOW_BLEND_MODE_REPLACE" value="3" enum="Environment3DGlowBlendMode">
Shows the glow effect by itself without the underlying scene.
</constant>
<constant name="ENV_TONE_MAPPER_LINEAR" value="0" enum="EnvironmentToneMapper">
<constant name="ENV_TONE_MAPPER_LINEAR" value="0" enum="Environment3DToneMapper">
Output color as they came in. This can cause bright lighting to look blown out, with noticeable clipping in the output colors.
</constant>
<constant name="ENV_TONE_MAPPER_REINHARD" value="1" enum="EnvironmentToneMapper">
<constant name="ENV_TONE_MAPPER_REINHARD" value="1" enum="Environment3DToneMapper">
Use the Reinhard tonemapper. Performs a variation on rendered pixels' colors by this formula: [code]color = color / (1 + color)[/code]. This avoids clipping bright highlights, but the resulting image can look a bit dull.
</constant>
<constant name="ENV_TONE_MAPPER_FILMIC" value="2" enum="EnvironmentToneMapper">
<constant name="ENV_TONE_MAPPER_FILMIC" value="2" enum="Environment3DToneMapper">
Use the filmic tonemapper. This avoids clipping bright highlights, with a resulting image that usually looks more vivid than [constant ENV_TONE_MAPPER_REINHARD].
</constant>
<constant name="ENV_TONE_MAPPER_ACES" value="3" enum="EnvironmentToneMapper">
<constant name="ENV_TONE_MAPPER_ACES" value="3" enum="Environment3DToneMapper">
Use the legacy Godot version of the Academy Color Encoding System tonemapper. Unlike [constant ENV_TONE_MAPPER_ACES_FITTED], this version of ACES does not handle bright lighting in a physically accurate way. ACES typically has a more contrasted output compared to [constant ENV_TONE_MAPPER_REINHARD] and [constant ENV_TONE_MAPPER_FILMIC].
[b]Note:[/b] This tonemapping operator will be removed in Godot 4.0 in favor of the more accurate [constant ENV_TONE_MAPPER_ACES_FITTED].
</constant>
<constant name="ENV_TONE_MAPPER_ACES_FITTED" value="4" enum="EnvironmentToneMapper">
<constant name="ENV_TONE_MAPPER_ACES_FITTED" value="4" enum="Environment3DToneMapper">
Use the Academy Color Encoding System tonemapper. ACES is slightly more expensive than other options, but it handles bright lighting in a more realistic fashion by desaturating it as it becomes brighter. ACES typically has a more contrasted output compared to [constant ENV_TONE_MAPPER_REINHARD] and [constant ENV_TONE_MAPPER_FILMIC].
</constant>
<constant name="ENV_SSAO_QUALITY_LOW" value="0" enum="EnvironmentSSAOQuality">
<constant name="ENV_SSAO_QUALITY_LOW" value="0" enum="Environment3DSSAOQuality">
Lowest quality of screen space ambient occlusion.
</constant>
<constant name="ENV_SSAO_QUALITY_MEDIUM" value="1" enum="EnvironmentSSAOQuality">
<constant name="ENV_SSAO_QUALITY_MEDIUM" value="1" enum="Environment3DSSAOQuality">
Medium quality screen space ambient occlusion.
</constant>
<constant name="ENV_SSAO_QUALITY_HIGH" value="2" enum="EnvironmentSSAOQuality">
<constant name="ENV_SSAO_QUALITY_HIGH" value="2" enum="Environment3DSSAOQuality">
Highest quality screen space ambient occlusion.
</constant>
<constant name="ENV_SSAO_BLUR_DISABLED" value="0" enum="EnvironmentSSAOBlur">
<constant name="ENV_SSAO_BLUR_DISABLED" value="0" enum="Environment3DSSAOBlur">
Disables the blur set for SSAO. Will make SSAO look noisier.
</constant>
<constant name="ENV_SSAO_BLUR_1x1" value="1" enum="EnvironmentSSAOBlur">
<constant name="ENV_SSAO_BLUR_1x1" value="1" enum="Environment3DSSAOBlur">
Perform a 1x1 blur on the SSAO output.
</constant>
<constant name="ENV_SSAO_BLUR_2x2" value="2" enum="EnvironmentSSAOBlur">
<constant name="ENV_SSAO_BLUR_2x2" value="2" enum="Environment3DSSAOBlur">
Performs a 2x2 blur on the SSAO output.
</constant>
<constant name="ENV_SSAO_BLUR_3x3" value="3" enum="EnvironmentSSAOBlur">
<constant name="ENV_SSAO_BLUR_3x3" value="3" enum="Environment3DSSAOBlur">
Performs a 3x3 blur on the SSAO output. Use this for smoothest SSAO.
</constant>
<constant name="CHANGED_PRIORITY_ANY" value="0" enum="ChangedPriority">

View File

@ -83,7 +83,7 @@
[b]Note:[/b] This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).
</member>
<member name="shaded" type="bool" setter="set_draw_flag" getter="get_draw_flag" default="false">
If [code]true[/code], the [Light] in the [Environment] has effects on the sprite.
If [code]true[/code], the [Light] in the [Environment3D] has effects on the sprite.
</member>
<member name="transparent" type="bool" setter="set_draw_flag" getter="get_draw_flag" default="true">
If [code]true[/code], the texture's transparency and the opacity are used to make those parts of the sprite invisible.

View File

@ -15,11 +15,11 @@
<member name="direct_space_state" type="PhysicsDirectSpaceState" setter="" getter="get_direct_space_state">
Direct access to the world's physics 3D space state. Used for querying current and potential collisions.
</member>
<member name="environment" type="Environment" setter="set_environment" getter="get_environment">
The World's [Environment].
<member name="environment" type="Environment3D" setter="set_environment" getter="get_environment">
The World's [Environment3D].
</member>
<member name="fallback_environment" type="Environment" setter="set_fallback_environment" getter="get_fallback_environment">
The World's fallback_environment will be used if the World's [Environment] fails or is missing.
<member name="fallback_environment" type="Environment3D" setter="set_fallback_environment" getter="get_fallback_environment">
The World's fallback_environment will be used if the World's [Environment3D] fails or is missing.
</member>
<member name="navigation_map" type="RID" setter="" getter="get_navigation_map">
The [RID] of this world's navigation map. Used by the [NavigationServer].

View File

@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="WorldEnvironment" inherits="Node" version="3.8">
<class name="WorldEnvironment3D" inherits="Node" version="3.8">
<brief_description>
Default environment properties for the entire scene (post-processing effects, lighting and background settings).
</brief_description>
<description>
The [WorldEnvironment] node is used to configure the default [Environment] for the scene.
The parameters defined in the [WorldEnvironment] can be overridden by an [Environment] node set on the current [Camera]. Additionally, only one [WorldEnvironment] may be instanced in a given scene at a time.
The [WorldEnvironment] allows the user to specify default lighting parameters (e.g. ambient lighting), various post-processing effects (e.g. SSAO, DOF, Tonemapping), and how to draw the background (e.g. solid color, skybox). Usually, these are added in order to improve the realism/color balance of the scene.
The [WorldEnvironment3D] node is used to configure the default [Environment3D] for the scene.
The parameters defined in the [WorldEnvironment3D] can be overridden by an [Environment3D] node set on the current [Camera]. Additionally, only one [WorldEnvironment3D] may be instanced in a given scene at a time.
The [WorldEnvironment3D] allows the user to specify default lighting parameters (e.g. ambient lighting), various post-processing effects (e.g. SSAO, DOF, Tonemapping), and how to draw the background (e.g. solid color, skybox). Usually, these are added in order to improve the realism/color balance of the scene.
</description>
<tutorials>
<link title="Environment and post-processing">$DOCS_URL/tutorials/3d/environment_and_post_processing.html</link>
@ -17,8 +17,8 @@
<methods>
</methods>
<members>
<member name="environment" type="Environment" setter="set_environment" getter="get_environment">
The [Environment] resource used by this [WorldEnvironment], defining the default properties.
<member name="environment" type="Environment3D" setter="set_environment" getter="get_environment">
The [Environment3D] resource used by this [WorldEnvironment3D], defining the default properties.
</member>
</members>
<constants>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -52,7 +52,7 @@ public:
RID environment_create() { return RID(); }
void environment_set_background(RID p_env, RS::EnvironmentBG p_bg) {}
void environment_set_background(RID p_env, RS::Environment3DBG p_bg) {}
void environment_set_sky(RID p_env, RID p_sky) {}
void environment_set_sky_custom_fov(RID p_env, float p_scale) {}
void environment_set_sky_orientation(RID p_env, const Basis &p_orientation) {}
@ -61,16 +61,16 @@ public:
void environment_set_canvas_max_layer(RID p_env, int p_max_layer) {}
void environment_set_ambient_light(RID p_env, const Color &p_color, float p_energy = 1.0, float p_sky_contribution = 0.0) {}
void environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, RS::EnvironmentDOFBlurQuality p_quality) {}
void environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, RS::EnvironmentDOFBlurQuality p_quality) {}
void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale, bool p_high_quality) {}
void environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, RS::Environment3DDOFBlurQuality p_quality) {}
void environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, RS::Environment3DDOFBlurQuality p_quality) {}
void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, RS::Environment3DGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale, bool p_high_quality) {}
void environment_set_fog(RID p_env, bool p_enable, float p_begin, float p_end, RID p_gradient_texture) {}
void environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_fade_int, float p_fade_out, float p_depth_tolerance, bool p_roughness) {}
void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, float p_ao_channel_affect, const Color &p_color, RS::EnvironmentSSAOQuality p_quality, RS::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness) {}
void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, float p_ao_channel_affect, const Color &p_color, RS::Environment3DSSAOQuality p_quality, RS::Environment3DSSAOBlur p_blur, float p_bilateral_sharpness) {}
void environment_set_tonemap(RID p_env, RS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale) {}
void environment_set_tonemap(RID p_env, RS::Environment3DToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale) {}
void environment_set_adjustment(RID p_env, bool p_enable, float p_brightness, float p_contrast, float p_saturation, RID p_ramp) {}
@ -79,7 +79,7 @@ public:
void environment_set_fog_height(RID p_env, bool p_enable, float p_min_height, float p_max_height, float p_height_curve) {}
bool is_environment(RID p_env) { return false; }
RS::EnvironmentBG environment_get_background(RID p_env) { return RS::ENV_BG_KEEP; }
RS::Environment3DBG environment_get_background(RID p_env) { return RS::ENV_BG_KEEP; }
int environment_get_canvas_max_layer(RID p_env) { return 0; }
RID light_instance_create(RID p_light) { return RID(); }

View File

@ -738,61 +738,61 @@ bool RasterizerSceneGLES2::reflection_probe_instance_postprocess_step(RID p_inst
/* ENVIRONMENT API */
RID RasterizerSceneGLES2::environment_create() {
Environment *env = memnew(Environment);
Environment3D *env = memnew(Environment3D);
return environment_owner.make_rid(env);
}
void RasterizerSceneGLES2::environment_set_background(RID p_env, RS::EnvironmentBG p_bg) {
Environment *env = environment_owner.getornull(p_env);
void RasterizerSceneGLES2::environment_set_background(RID p_env, RS::Environment3DBG p_bg) {
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->bg_mode = p_bg;
}
void RasterizerSceneGLES2::environment_set_sky(RID p_env, RID p_sky) {
Environment *env = environment_owner.getornull(p_env);
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->sky = p_sky;
}
void RasterizerSceneGLES2::environment_set_sky_custom_fov(RID p_env, float p_scale) {
Environment *env = environment_owner.getornull(p_env);
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->sky_custom_fov = p_scale;
}
void RasterizerSceneGLES2::environment_set_sky_orientation(RID p_env, const Basis &p_orientation) {
Environment *env = environment_owner.getornull(p_env);
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->sky_orientation = p_orientation;
}
void RasterizerSceneGLES2::environment_set_bg_color(RID p_env, const Color &p_color) {
Environment *env = environment_owner.getornull(p_env);
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->bg_color = p_color;
}
void RasterizerSceneGLES2::environment_set_bg_energy(RID p_env, float p_energy) {
Environment *env = environment_owner.getornull(p_env);
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->bg_energy = p_energy;
}
void RasterizerSceneGLES2::environment_set_canvas_max_layer(RID p_env, int p_max_layer) {
Environment *env = environment_owner.getornull(p_env);
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->canvas_max_layer = p_max_layer;
}
void RasterizerSceneGLES2::environment_set_ambient_light(RID p_env, const Color &p_color, float p_energy, float p_sky_contribution) {
Environment *env = environment_owner.getornull(p_env);
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->ambient_color = p_color;
@ -800,8 +800,8 @@ void RasterizerSceneGLES2::environment_set_ambient_light(RID p_env, const Color
env->ambient_sky_contribution = p_sky_contribution;
}
void RasterizerSceneGLES2::environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, RS::EnvironmentDOFBlurQuality p_quality) {
Environment *env = environment_owner.getornull(p_env);
void RasterizerSceneGLES2::environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, RS::Environment3DDOFBlurQuality p_quality) {
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->dof_blur_far_enabled = p_enable;
@ -811,8 +811,8 @@ void RasterizerSceneGLES2::environment_set_dof_blur_far(RID p_env, bool p_enable
env->dof_blur_far_quality = p_quality;
}
void RasterizerSceneGLES2::environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, RS::EnvironmentDOFBlurQuality p_quality) {
Environment *env = environment_owner.getornull(p_env);
void RasterizerSceneGLES2::environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, RS::Environment3DDOFBlurQuality p_quality) {
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->dof_blur_near_enabled = p_enable;
@ -822,8 +822,8 @@ void RasterizerSceneGLES2::environment_set_dof_blur_near(RID p_env, bool p_enabl
env->dof_blur_near_quality = p_quality;
}
void RasterizerSceneGLES2::environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale, bool p_high_quality) {
Environment *env = environment_owner.getornull(p_env);
void RasterizerSceneGLES2::environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, RS::Environment3DGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale, bool p_high_quality) {
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->glow_enabled = p_enable;
@ -840,27 +840,27 @@ void RasterizerSceneGLES2::environment_set_glow(RID p_env, bool p_enable, int p_
}
void RasterizerSceneGLES2::environment_set_fog(RID p_env, bool p_enable, float p_begin, float p_end, RID p_gradient_texture) {
Environment *env = environment_owner.getornull(p_env);
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
}
void RasterizerSceneGLES2::environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_fade_in, float p_fade_out, float p_depth_tolerance, bool p_roughness) {
Environment *env = environment_owner.getornull(p_env);
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
}
void RasterizerSceneGLES2::environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, float p_ao_channel_affect, const Color &p_color, RS::EnvironmentSSAOQuality p_quality, RenderingServer::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness) {
Environment *env = environment_owner.getornull(p_env);
void RasterizerSceneGLES2::environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, float p_ao_channel_affect, const Color &p_color, RS::Environment3DSSAOQuality p_quality, RenderingServer::Environment3DSSAOBlur p_blur, float p_bilateral_sharpness) {
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
}
void RasterizerSceneGLES2::environment_set_tonemap(RID p_env, RS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale) {
Environment *env = environment_owner.getornull(p_env);
void RasterizerSceneGLES2::environment_set_tonemap(RID p_env, RS::Environment3DToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale) {
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
}
void RasterizerSceneGLES2::environment_set_adjustment(RID p_env, bool p_enable, float p_brightness, float p_contrast, float p_saturation, RID p_ramp) {
Environment *env = environment_owner.getornull(p_env);
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->adjustments_enabled = p_enable;
@ -871,7 +871,7 @@ void RasterizerSceneGLES2::environment_set_adjustment(RID p_env, bool p_enable,
}
void RasterizerSceneGLES2::environment_set_fog(RID p_env, bool p_enable, const Color &p_color, const Color &p_sun_color, float p_sun_amount) {
Environment *env = environment_owner.getornull(p_env);
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->fog_enabled = p_enable;
@ -881,7 +881,7 @@ void RasterizerSceneGLES2::environment_set_fog(RID p_env, bool p_enable, const C
}
void RasterizerSceneGLES2::environment_set_fog_depth(RID p_env, bool p_enable, float p_depth_begin, float p_depth_end, float p_depth_curve, bool p_transmit, float p_transmit_curve) {
Environment *env = environment_owner.getornull(p_env);
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->fog_depth_enabled = p_enable;
@ -893,7 +893,7 @@ void RasterizerSceneGLES2::environment_set_fog_depth(RID p_env, bool p_enable, f
}
void RasterizerSceneGLES2::environment_set_fog_height(RID p_env, bool p_enable, float p_min_height, float p_max_height, float p_height_curve) {
Environment *env = environment_owner.getornull(p_env);
Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND(!env);
env->fog_height_enabled = p_enable;
@ -905,15 +905,15 @@ bool RasterizerSceneGLES2::is_environment(RID p_env) {
return environment_owner.owns(p_env);
}
RS::EnvironmentBG RasterizerSceneGLES2::environment_get_background(RID p_env) {
const Environment *env = environment_owner.getornull(p_env);
RS::Environment3DBG RasterizerSceneGLES2::environment_get_background(RID p_env) {
const Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND_V(!env, RS::ENV_BG_MAX);
return env->bg_mode;
}
int RasterizerSceneGLES2::environment_get_canvas_max_layer(RID p_env) {
const Environment *env = environment_owner.getornull(p_env);
const Environment3D *env = environment_owner.getornull(p_env);
ERR_FAIL_COND_V(!env, -1);
return env->canvas_max_layer;
@ -2172,7 +2172,7 @@ void RasterizerSceneGLES2::_setup_light(LightInstance *light, ShadowAtlas *shado
}
}
void RasterizerSceneGLES2::_setup_refprobes(ReflectionProbeInstance *p_refprobe1, ReflectionProbeInstance *p_refprobe2, const Transform &p_view_transform, Environment *p_env) {
void RasterizerSceneGLES2::_setup_refprobes(ReflectionProbeInstance *p_refprobe1, ReflectionProbeInstance *p_refprobe2, const Transform &p_view_transform, Environment3D *p_env) {
if (p_refprobe1) {
state.scene_shader.set_uniform(SceneShaderGLES2::REFPROBE1_USE_BOX_PROJECT, p_refprobe1->probe_ptr->box_projection);
state.scene_shader.set_uniform(SceneShaderGLES2::REFPROBE1_BOX_EXTENTS, p_refprobe1->probe_ptr->extents);
@ -2220,7 +2220,7 @@ void RasterizerSceneGLES2::_setup_refprobes(ReflectionProbeInstance *p_refprobe1
}
}
void RasterizerSceneGLES2::_render_render_list(RenderList::Element **p_elements, int p_element_count, const Transform &p_view_transform, const Projection &p_projection, const int p_eye, RID p_shadow_atlas, Environment *p_env, GLuint p_base_env, float p_shadow_bias, float p_shadow_normal_bias, bool p_reverse_cull, bool p_alpha_pass, bool p_shadow) {
void RasterizerSceneGLES2::_render_render_list(RenderList::Element **p_elements, int p_element_count, const Transform &p_view_transform, const Projection &p_projection, const int p_eye, RID p_shadow_atlas, Environment3D *p_env, GLuint p_base_env, float p_shadow_bias, float p_shadow_normal_bias, bool p_reverse_cull, bool p_alpha_pass, bool p_shadow) {
ShadowAtlas *shadow_atlas = shadow_atlas_owner.getornull(p_shadow_atlas);
Vector2 viewport_size = state.viewport_size;
@ -2708,7 +2708,7 @@ void RasterizerSceneGLES2::_draw_sky(RasterizerStorageGLES2::Sky *p_sky, const P
storage->shaders.copy.set_conditional(CopyShaderGLES2::OUTPUT_LINEAR, false);
}
void RasterizerSceneGLES2::_post_process(Environment *env, const Projection &p_cam_projection) {
void RasterizerSceneGLES2::_post_process(Environment3D *env, const Projection &p_cam_projection) {
//copy to front buffer
glDepthMask(GL_FALSE);
@ -3164,7 +3164,7 @@ void RasterizerSceneGLES2::render_scene(const Transform &p_cam_transform, const
storage->info.render.object_count += p_cull_count;
GLuint current_fb = 0;
Environment *env = nullptr;
Environment3D *env = nullptr;
int viewport_width, viewport_height;
int viewport_x = 0;
@ -3831,7 +3831,7 @@ bool RasterizerSceneGLES2::free(RID p_rid) {
memdelete(reflection_instance);
} else if (environment_owner.owns(p_rid)) {
Environment *environment = environment_owner.get(p_rid);
Environment3D *environment = environment_owner.get(p_rid);
environment_owner.free(p_rid);
memdelete(environment);

View File

@ -164,7 +164,7 @@ public:
GLuint scene_ubo;
struct EnvironmentRadianceUBO {
struct Environment3DRadianceUBO {
float transform[16];
float ambient_contribution;
@ -350,8 +350,8 @@ public:
/* ENVIRONMENT API */
struct Environment : public RID_Data {
RS::EnvironmentBG bg_mode;
struct Environment3D : public RID_Data {
RS::Environment3DBG bg_mode;
RID sky;
float sky_custom_fov;
@ -372,7 +372,7 @@ public:
float glow_intensity;
float glow_strength;
float glow_bloom;
RS::EnvironmentGlowBlendMode glow_blend_mode;
RS::Environment3DGlowBlendMode glow_blend_mode;
float glow_hdr_bleed_threshold;
float glow_hdr_bleed_scale;
float glow_hdr_luminance_cap;
@ -383,13 +383,13 @@ public:
float dof_blur_far_distance;
float dof_blur_far_transition;
float dof_blur_far_amount;
RS::EnvironmentDOFBlurQuality dof_blur_far_quality;
RS::Environment3DDOFBlurQuality dof_blur_far_quality;
bool dof_blur_near_enabled;
float dof_blur_near_distance;
float dof_blur_near_transition;
float dof_blur_near_amount;
RS::EnvironmentDOFBlurQuality dof_blur_near_quality;
RS::Environment3DDOFBlurQuality dof_blur_near_quality;
bool adjustments_enabled;
float adjustments_brightness;
@ -413,7 +413,7 @@ public:
float fog_height_max;
float fog_height_curve;
Environment() :
Environment3D() :
bg_mode(RS::ENV_BG_CLEAR_COLOR),
sky_custom_fov(0.0),
bg_energy(1.0),
@ -463,11 +463,11 @@ public:
}
};
mutable RID_Owner<Environment> environment_owner;
mutable RID_Owner<Environment3D> environment_owner;
virtual RID environment_create();
virtual void environment_set_background(RID p_env, RS::EnvironmentBG p_bg);
virtual void environment_set_background(RID p_env, RS::Environment3DBG p_bg);
virtual void environment_set_sky(RID p_env, RID p_sky);
virtual void environment_set_sky_custom_fov(RID p_env, float p_scale);
virtual void environment_set_sky_orientation(RID p_env, const Basis &p_orientation);
@ -476,16 +476,16 @@ public:
virtual void environment_set_canvas_max_layer(RID p_env, int p_max_layer);
virtual void environment_set_ambient_light(RID p_env, const Color &p_color, float p_energy = 1.0, float p_sky_contribution = 0.0);
virtual void environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, RS::EnvironmentDOFBlurQuality p_quality);
virtual void environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, RS::EnvironmentDOFBlurQuality p_quality);
virtual void environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, RS::Environment3DDOFBlurQuality p_quality);
virtual void environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_amount, RS::Environment3DDOFBlurQuality p_quality);
virtual void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale, bool p_high_quality);
virtual void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, RS::Environment3DGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale, bool p_high_quality);
virtual void environment_set_fog(RID p_env, bool p_enable, float p_begin, float p_end, RID p_gradient_texture);
virtual void environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_fade_in, float p_fade_out, float p_depth_tolerance, bool p_roughness);
virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, float p_ao_channel_affect, const Color &p_color, RS::EnvironmentSSAOQuality p_quality, RS::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness);
virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, float p_ao_channel_affect, const Color &p_color, RS::Environment3DSSAOQuality p_quality, RS::Environment3DSSAOBlur p_blur, float p_bilateral_sharpness);
virtual void environment_set_tonemap(RID p_env, RS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale);
virtual void environment_set_tonemap(RID p_env, RS::Environment3DToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale);
virtual void environment_set_adjustment(RID p_env, bool p_enable, float p_brightness, float p_contrast, float p_saturation, RID p_ramp);
@ -495,7 +495,7 @@ public:
virtual bool is_environment(RID p_env);
virtual RS::EnvironmentBG environment_get_background(RID p_env);
virtual RS::Environment3DBG environment_get_background(RID p_env);
virtual int environment_get_canvas_max_layer(RID p_env);
/* LIGHT INSTANCE */
@ -732,7 +732,7 @@ public:
const Projection &p_projection,
const int p_eye,
RID p_shadow_atlas,
Environment *p_env,
Environment3D *p_env,
GLuint p_base_env,
float p_shadow_bias,
float p_shadow_normal_bias,
@ -747,10 +747,10 @@ public:
_FORCE_INLINE_ void _setup_geometry(RenderList::Element *p_element, RasterizerStorageGLES2::Skeleton *p_skeleton);
_FORCE_INLINE_ void _setup_light_type(LightInstance *p_light, ShadowAtlas *shadow_atlas);
_FORCE_INLINE_ void _setup_light(LightInstance *p_light, ShadowAtlas *shadow_atlas, const Transform &p_view_transform, bool accum_pass);
_FORCE_INLINE_ void _setup_refprobes(ReflectionProbeInstance *p_refprobe1, ReflectionProbeInstance *p_refprobe2, const Transform &p_view_transform, Environment *p_env);
_FORCE_INLINE_ void _setup_refprobes(ReflectionProbeInstance *p_refprobe1, ReflectionProbeInstance *p_refprobe2, const Transform &p_view_transform, Environment3D *p_env);
_FORCE_INLINE_ void _render_geometry(RenderList::Element *p_element);
void _post_process(Environment *env, const Projection &p_cam_projection);
void _post_process(Environment3D *env, const Projection &p_cam_projection);
virtual void render_scene(const Transform &p_cam_transform, const Projection &p_cam_projection, const int p_eye, bool p_cam_ortogonal, InstanceBase **p_cull_result, int p_cull_count, RID *p_light_cull_result, int p_light_cull_count, RID *p_reflection_probe_cull_result, int p_reflection_probe_cull_count, RID p_environment, RID p_shadow_atlas, RID p_reflection_atlas, RID p_reflection_probe, int p_reflection_probe_pass);
virtual void render_shadow(RID p_light, RID p_shadow_atlas, int p_pass, InstanceBase **p_cull_result, int p_cull_count);

View File

@ -1894,7 +1894,7 @@ void EditorNode::push_item(Object *p_object, const String &p_property, bool p_in
}
void EditorNode::_save_default_environment() {
Ref<Environment> fallback = get_tree()->get_root()->get_world()->get_fallback_environment();
Ref<Environment3D> fallback = get_tree()->get_root()->get_world()->get_fallback_environment();
if (fallback.is_valid() && fallback->get_path().is_resource_file()) {
Map<RES, bool> processed;

View File

Before

Width:  |  Height:  |  Size: 400 B

After

Width:  |  Height:  |  Size: 400 B

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -94,7 +94,7 @@ void MaterialEditor::_notification(int p_what) {
}
}
void MaterialEditor::edit(Ref<Material> p_material, const Ref<Environment> &p_env) {
void MaterialEditor::edit(Ref<Material> p_material, const Ref<Environment3D> &p_env) {
material = p_material;
camera->set_environment(p_env);
if (!material.is_null()) {
@ -261,7 +261,7 @@ EditorInspectorPluginMaterial::EditorInspectorPluginMaterial() {
env.instance();
Ref<ProceduralSky> proc_sky = memnew(ProceduralSky(true));
env->set_sky(proc_sky);
env->set_background(Environment::BG_COLOR_SKY);
env->set_background(Environment3D::BG_COLOR_SKY);
}
MaterialEditorPlugin::MaterialEditorPlugin(EditorNode *p_node) {

View File

@ -85,14 +85,14 @@ protected:
static void _bind_methods();
public:
void edit(Ref<Material> p_material, const Ref<Environment> &p_env);
void edit(Ref<Material> p_material, const Ref<Environment3D> &p_env);
MaterialEditor();
~MaterialEditor();
};
class EditorInspectorPluginMaterial : public EditorInspectorPlugin {
GDCLASS(EditorInspectorPluginMaterial, EditorInspectorPlugin);
Ref<Environment> env;
Ref<Environment3D> env;
public:
virtual bool can_handle(Object *p_object);

View File

@ -4426,7 +4426,7 @@ SpatialEditorViewport::SpatialEditorViewport(SpatialEditor *p_spatial_editor, Ed
view_menu->get_popup()->add_radio_check_shortcut(ED_SHORTCUT("spatial_editor/view_display_unshaded", TTR("Display Unshaded")), VIEW_DISPLAY_SHADELESS);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_DISPLAY_NORMAL), true);
view_menu->get_popup()->add_separator();
view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_environment", TTR("View Environment")), VIEW_ENVIRONMENT);
view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_environment", TTR("View Environment3D")), VIEW_ENVIRONMENT);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_ENVIRONMENT), true);
view_menu->get_popup()->add_check_shortcut(ED_SHORTCUT("spatial_editor/view_gizmos", TTR("View Gizmos")), VIEW_GIZMOS);
view_menu->get_popup()->set_item_checked(view_menu->get_popup()->get_item_index(VIEW_GIZMOS), true);
@ -5292,7 +5292,7 @@ void SpatialEditor::set_state(const Dictionary &p_state) {
}
}
Ref<Environment> SpatialEditor::get_viewport_environment() {
Ref<Environment3D> SpatialEditor::get_viewport_environment() {
return viewport_environment;
}
@ -7042,7 +7042,7 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) {
gizmo.visible = true;
gizmo.scale = 1.0;
viewport_environment = Ref<Environment>(memnew(Environment));
viewport_environment = Ref<Environment3D>(memnew(Environment3D));
undo_redo = p_editor->get_undo_redo();
VBoxContainer *vbc = this;

View File

@ -71,7 +71,7 @@ class EditorSpatialGizmoPlugin;
class EditorSpatialGizmo;
class ViewportContainer;
class SpatialEditorViewport;
class Environment;
class Environment3D;
class AcceptDialog;
class CheckBox;
class ConfirmationDialog;
@ -710,7 +710,7 @@ private:
Object *_get_editor_data(Object *p_what);
Ref<Environment> viewport_environment;
Ref<Environment3D> viewport_environment;
Spatial *selected;
@ -775,7 +775,7 @@ public:
Dictionary get_state() const;
void set_state(const Dictionary &p_state);
Ref<Environment> get_viewport_environment();
Ref<Environment3D> get_viewport_environment();
UndoRedo *get_undo_redo() { return undo_redo; }

View File

@ -513,7 +513,7 @@ private:
if (!f) {
set_message(TTR("Couldn't create project.pandemonium in project path."), MESSAGE_ERROR);
} else {
f->store_line("[gd_resource type=\"Environment\" load_steps=2 format=2]");
f->store_line("[gd_resource type=\"Environment3D\" load_steps=2 format=2]");
f->store_line("");
f->store_line("[sub_resource type=\"ProceduralSky\" id=1]");
f->store_line("");
@ -2248,7 +2248,7 @@ void ProjectManager::_language_selected(int p_id) {
String lang = language_btn->get_item_metadata(p_id);
EditorSettings::get_singleton()->set("interface/editor/editor_language", lang);
language_btn->set_text(lang);
language_btn->set_icon(get_theme_icon("Environment", "EditorIcons"));
language_btn->set_icon(get_theme_icon("Environment3D", "EditorIcons"));
language_restart_ask->set_text(TTR("Language changed.\nThe interface will update after restarting the editor or project manager."));
language_restart_ask->popup_centered();
@ -2653,7 +2653,7 @@ ProjectManager::ProjectManager() {
language_btn->set_text(lang);
}
}
language_btn->set_icon(get_theme_icon("Environment", "EditorIcons"));
language_btn->set_icon(get_theme_icon("Environment3D", "EditorIcons"));
settings_hb->add_child(language_btn);
language_btn->connect("item_selected", this, "_language_selected");

View File

@ -7824,7 +7824,7 @@ msgid "Display Unshaded"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Environment"
msgid "View Environment3D"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@ -14415,18 +14415,18 @@ msgstr ""
#: scene/3d/world_environment.cpp
msgid ""
"WorldEnvironment requires its \"Environment\" property to contain an "
"Environment to have a visible effect."
"WorldEnvironment3D requires its \"Environment3D\" property to contain an "
"Environment3D to have a visible effect."
msgstr ""
#: scene/3d/world_environment.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
"Only one WorldEnvironment3D is allowed per scene (or set of instanced scenes)."
msgstr ""
#: scene/3d/world_environment.cpp
msgid ""
"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
"This WorldEnvironment3D is ignored. Either add a Camera (for 3D scenes) or set "
"this environment's Background Mode to Canvas (for 2D scenes)."
msgstr ""
@ -14562,8 +14562,8 @@ msgstr ""
#: scene/main/scene_tree.cpp
msgid ""
"Default Environment as specified in Project Settings (Rendering -> "
"Environment -> Default Environment) could not be loaded."
"Default Environment3D as specified in Project Settings (Rendering -> "
"Environment3D -> Default Environment3D) could not be loaded."
msgstr ""
#: scene/main/timer.cpp

View File

@ -8190,7 +8190,7 @@ msgid "Display Unshaded"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
msgid "View Environment"
msgid "View Environment3D"
msgstr ""
#: editor/plugins/spatial_editor_plugin.cpp
@ -14981,18 +14981,18 @@ msgstr ""
#: scene/3d/world_environment.cpp
msgid ""
"WorldEnvironment requires its \"Environment\" property to contain an "
"Environment to have a visible effect."
"WorldEnvironment3D requires its \"Environment3D\" property to contain an "
"Environment3D to have a visible effect."
msgstr ""
#: scene/3d/world_environment.cpp
msgid ""
"Only one WorldEnvironment is allowed per scene (or set of instanced scenes)."
"Only one WorldEnvironment3D is allowed per scene (or set of instanced scenes)."
msgstr ""
#: scene/3d/world_environment.cpp
msgid ""
"This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set "
"This WorldEnvironment3D is ignored. Either add a Camera (for 3D scenes) or set "
"this environment's Background Mode to Canvas (for 2D scenes)."
msgstr ""
@ -15128,8 +15128,8 @@ msgstr "(Más)"
#: scene/main/scene_tree.cpp
msgid ""
"Default Environment as specified in Project Settings (Rendering -> "
"Environment -> Default Environment) could not be loaded."
"Default Environment3D as specified in Project Settings (Rendering -> "
"Environment3D -> Default Environment3D) could not be loaded."
msgstr ""
#: scene/main/timer.cpp

View File

@ -9,7 +9,7 @@
<methods>
<method name="_setup" qualifiers="virtual">
<return type="void" />
<argument index="0" name="world_environment" type="WorldEnvironment" />
<argument index="0" name="world_environment" type="WorldEnvironment3D" />
<argument index="1" name="primary_light" type="DirectionalLight" />
<argument index="2" name="secondary_light" type="DirectionalLight" />
<description>
@ -64,7 +64,7 @@
</method>
</methods>
<members>
<member name="environment" type="Environment" setter="set_environment" getter="get_environment">
<member name="environment" type="Environment3D" setter="set_environment" getter="get_environment">
</member>
<member name="primary_light_color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )">
</member>

View File

@ -24,10 +24,10 @@ SOFTWARE.
#include "scene/resources/environment.h"
Ref<Environment> TerrainEnvironmentData::get_environment() {
Ref<Environment3D> TerrainEnvironmentData::get_environment() {
return _environment;
}
void TerrainEnvironmentData::set_environment(const Ref<Environment> &value) {
void TerrainEnvironmentData::set_environment(const Ref<Environment3D> &value) {
_environment = value;
}
@ -62,13 +62,13 @@ void TerrainEnvironmentData::set_indirect_energy(const int index, const float va
_indirect_energies[index] = value;
}
void TerrainEnvironmentData::setup(WorldEnvironment *world_environment, DirectionalLight *primary_light, DirectionalLight *secondary_light) {
void TerrainEnvironmentData::setup(WorldEnvironment3D *world_environment, DirectionalLight *primary_light, DirectionalLight *secondary_light) {
if (has_method("_setup")) {
call("_setup", world_environment, primary_light, secondary_light);
}
}
void TerrainEnvironmentData::setup_bind(Node *world_environment, Node *primary_light, Node *secondary_light) {
setup(Object::cast_to<WorldEnvironment>(world_environment), Object::cast_to<DirectionalLight>(primary_light), Object::cast_to<DirectionalLight>(secondary_light));
setup(Object::cast_to<WorldEnvironment3D>(world_environment), Object::cast_to<DirectionalLight>(primary_light), Object::cast_to<DirectionalLight>(secondary_light));
}
TerrainEnvironmentData::TerrainEnvironmentData() {
@ -87,11 +87,11 @@ TerrainEnvironmentData::~TerrainEnvironmentData() {
}
void TerrainEnvironmentData::_bind_methods() {
BIND_VMETHOD(MethodInfo("_setup", PropertyInfo(Variant::OBJECT, "world_environment", PROPERTY_HINT_RESOURCE_TYPE, "WorldEnvironment"), PropertyInfo(Variant::OBJECT, "primary_light", PROPERTY_HINT_RESOURCE_TYPE, "DirectionalLight"), PropertyInfo(Variant::OBJECT, "secondary_light", PROPERTY_HINT_RESOURCE_TYPE, "DirectionalLight")));
BIND_VMETHOD(MethodInfo("_setup", PropertyInfo(Variant::OBJECT, "world_environment", PROPERTY_HINT_RESOURCE_TYPE, "WorldEnvironment3D"), PropertyInfo(Variant::OBJECT, "primary_light", PROPERTY_HINT_RESOURCE_TYPE, "DirectionalLight"), PropertyInfo(Variant::OBJECT, "secondary_light", PROPERTY_HINT_RESOURCE_TYPE, "DirectionalLight")));
ClassDB::bind_method(D_METHOD("get_environment"), &TerrainEnvironmentData::get_environment);
ClassDB::bind_method(D_METHOD("set_environment", "value"), &TerrainEnvironmentData::set_environment);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_environment", "get_environment");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment3D"), "set_environment", "get_environment");
ClassDB::bind_method(D_METHOD("get_color", "index"), &TerrainEnvironmentData::get_color);
ClassDB::bind_method(D_METHOD("set_color", "index", "value"), &TerrainEnvironmentData::set_color);

View File

@ -36,8 +36,8 @@ class TerrainEnvironmentData : public Resource {
GDCLASS(TerrainEnvironmentData, Resource);
public:
Ref<Environment> get_environment();
void set_environment(const Ref<Environment> &value);
Ref<Environment3D> get_environment();
void set_environment(const Ref<Environment3D> &value);
Color get_color(const int index);
void set_color(const int index, const Color &value);
@ -46,7 +46,7 @@ public:
float get_indirect_energy(const int index);
void set_indirect_energy(const int index, const float value);
void setup(WorldEnvironment *world_environment, DirectionalLight *primary_light, DirectionalLight *secondary_light);
void setup(WorldEnvironment3D *world_environment, DirectionalLight *primary_light, DirectionalLight *secondary_light);
void setup_bind(Node *world_environment, Node *primary_light, Node *secondary_light);
TerrainEnvironmentData();
@ -61,7 +61,7 @@ protected:
static void _bind_methods();
private:
Ref<Environment> _environment;
Ref<Environment3D> _environment;
Color _colors[LIGHT_COUNT];
float _energies[LIGHT_COUNT];

View File

@ -9,7 +9,7 @@
<methods>
<method name="_setup" qualifiers="virtual">
<return type="void" />
<argument index="0" name="world_environment" type="WorldEnvironment" />
<argument index="0" name="world_environment" type="WorldEnvironment3D" />
<argument index="1" name="primary_light" type="DirectionalLight" />
<argument index="2" name="secondary_light" type="DirectionalLight" />
<description>
@ -64,7 +64,7 @@
</method>
</methods>
<members>
<member name="environment" type="Environment" setter="set_environment" getter="get_environment">
<member name="environment" type="Environment3D" setter="set_environment" getter="get_environment">
</member>
<member name="primary_light_color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )">
</member>

View File

@ -24,10 +24,10 @@ SOFTWARE.
#include "scene/resources/environment.h"
Ref<Environment> Terrain2DEnvironmentData::get_environment() {
Ref<Environment3D> Terrain2DEnvironmentData::get_environment() {
return _environment;
}
void Terrain2DEnvironmentData::set_environment(const Ref<Environment> &value) {
void Terrain2DEnvironmentData::set_environment(const Ref<Environment3D> &value) {
_environment = value;
}
@ -62,13 +62,13 @@ void Terrain2DEnvironmentData::set_indirect_energy(const int index, const float
_indirect_energies[index] = value;
}
void Terrain2DEnvironmentData::setup(WorldEnvironment *world_environment, DirectionalLight *primary_light, DirectionalLight *secondary_light) {
void Terrain2DEnvironmentData::setup(WorldEnvironment3D *world_environment, DirectionalLight *primary_light, DirectionalLight *secondary_light) {
if (has_method("_setup")) {
call("_setup", world_environment, primary_light, secondary_light);
}
}
void Terrain2DEnvironmentData::setup_bind(Node *world_environment, Node *primary_light, Node *secondary_light) {
setup(Object::cast_to<WorldEnvironment>(world_environment), Object::cast_to<DirectionalLight>(primary_light), Object::cast_to<DirectionalLight>(secondary_light));
setup(Object::cast_to<WorldEnvironment3D>(world_environment), Object::cast_to<DirectionalLight>(primary_light), Object::cast_to<DirectionalLight>(secondary_light));
}
Terrain2DEnvironmentData::Terrain2DEnvironmentData() {
@ -87,11 +87,11 @@ Terrain2DEnvironmentData::~Terrain2DEnvironmentData() {
}
void Terrain2DEnvironmentData::_bind_methods() {
BIND_VMETHOD(MethodInfo("_setup", PropertyInfo(Variant::OBJECT, "world_environment", PROPERTY_HINT_RESOURCE_TYPE, "WorldEnvironment"), PropertyInfo(Variant::OBJECT, "primary_light", PROPERTY_HINT_RESOURCE_TYPE, "DirectionalLight"), PropertyInfo(Variant::OBJECT, "secondary_light", PROPERTY_HINT_RESOURCE_TYPE, "DirectionalLight")));
BIND_VMETHOD(MethodInfo("_setup", PropertyInfo(Variant::OBJECT, "world_environment", PROPERTY_HINT_RESOURCE_TYPE, "WorldEnvironment3D"), PropertyInfo(Variant::OBJECT, "primary_light", PROPERTY_HINT_RESOURCE_TYPE, "DirectionalLight"), PropertyInfo(Variant::OBJECT, "secondary_light", PROPERTY_HINT_RESOURCE_TYPE, "DirectionalLight")));
ClassDB::bind_method(D_METHOD("get_environment"), &Terrain2DEnvironmentData::get_environment);
ClassDB::bind_method(D_METHOD("set_environment", "value"), &Terrain2DEnvironmentData::set_environment);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_environment", "get_environment");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment3D"), "set_environment", "get_environment");
ClassDB::bind_method(D_METHOD("get_color", "index"), &Terrain2DEnvironmentData::get_color);
ClassDB::bind_method(D_METHOD("set_color", "index", "value"), &Terrain2DEnvironmentData::set_color);

View File

@ -36,8 +36,8 @@ class Terrain2DEnvironmentData : public Resource {
GDCLASS(Terrain2DEnvironmentData, Resource);
public:
Ref<Environment> get_environment();
void set_environment(const Ref<Environment> &value);
Ref<Environment3D> get_environment();
void set_environment(const Ref<Environment3D> &value);
Color get_color(const int index);
void set_color(const int index, const Color &value);
@ -46,7 +46,7 @@ public:
float get_indirect_energy(const int index);
void set_indirect_energy(const int index, const float value);
void setup(WorldEnvironment *world_environment, DirectionalLight *primary_light, DirectionalLight *secondary_light);
void setup(WorldEnvironment3D *world_environment, DirectionalLight *primary_light, DirectionalLight *secondary_light);
void setup_bind(Node *world_environment, Node *primary_light, Node *secondary_light);
Terrain2DEnvironmentData();
@ -61,7 +61,7 @@ protected:
static void _bind_methods();
private:
Ref<Environment> _environment;
Ref<Environment3D> _environment;
Color _colors[LIGHT_COUNT];
float _energies[LIGHT_COUNT];

View File

@ -9,7 +9,7 @@
<methods>
<method name="_setup" qualifiers="virtual">
<return type="void" />
<argument index="0" name="world_environment" type="WorldEnvironment" />
<argument index="0" name="world_environment" type="WorldEnvironment3D" />
<argument index="1" name="primary_light" type="DirectionalLight" />
<argument index="2" name="secondary_light" type="DirectionalLight" />
<description>
@ -64,7 +64,7 @@
</method>
</methods>
<members>
<member name="environment" type="Environment" setter="set_environment" getter="get_environment">
<member name="environment" type="Environment3D" setter="set_environment" getter="get_environment">
</member>
<member name="primary_light_color" type="Color" setter="set_color" getter="get_color" default="Color( 1, 1, 1, 1 )">
</member>

View File

@ -24,10 +24,10 @@ SOFTWARE.
#include "scene/resources/environment.h"
Ref<Environment> EnvironmentData::get_environment() {
Ref<Environment3D> EnvironmentData::get_environment() {
return _environment;
}
void EnvironmentData::set_environment(const Ref<Environment> &value) {
void EnvironmentData::set_environment(const Ref<Environment3D> &value) {
_environment = value;
}
@ -62,13 +62,13 @@ void EnvironmentData::set_indirect_energy(const int index, const float value) {
_indirect_energies[index] = value;
}
void EnvironmentData::setup(WorldEnvironment *world_environment, DirectionalLight *primary_light, DirectionalLight *secondary_light) {
void EnvironmentData::setup(WorldEnvironment3D *world_environment, DirectionalLight *primary_light, DirectionalLight *secondary_light) {
if (has_method("_setup")) {
call("_setup", world_environment, primary_light, secondary_light);
}
}
void EnvironmentData::setup_bind(Node *world_environment, Node *primary_light, Node *secondary_light) {
setup(Object::cast_to<WorldEnvironment>(world_environment), Object::cast_to<DirectionalLight>(primary_light), Object::cast_to<DirectionalLight>(secondary_light));
setup(Object::cast_to<WorldEnvironment3D>(world_environment), Object::cast_to<DirectionalLight>(primary_light), Object::cast_to<DirectionalLight>(secondary_light));
}
EnvironmentData::EnvironmentData() {
@ -87,11 +87,11 @@ EnvironmentData::~EnvironmentData() {
}
void EnvironmentData::_bind_methods() {
BIND_VMETHOD(MethodInfo("_setup", PropertyInfo(Variant::OBJECT, "world_environment", PROPERTY_HINT_RESOURCE_TYPE, "WorldEnvironment"), PropertyInfo(Variant::OBJECT, "primary_light", PROPERTY_HINT_RESOURCE_TYPE, "DirectionalLight"), PropertyInfo(Variant::OBJECT, "secondary_light", PROPERTY_HINT_RESOURCE_TYPE, "DirectionalLight")));
BIND_VMETHOD(MethodInfo("_setup", PropertyInfo(Variant::OBJECT, "world_environment", PROPERTY_HINT_RESOURCE_TYPE, "WorldEnvironment3D"), PropertyInfo(Variant::OBJECT, "primary_light", PROPERTY_HINT_RESOURCE_TYPE, "DirectionalLight"), PropertyInfo(Variant::OBJECT, "secondary_light", PROPERTY_HINT_RESOURCE_TYPE, "DirectionalLight")));
ClassDB::bind_method(D_METHOD("get_environment"), &EnvironmentData::get_environment);
ClassDB::bind_method(D_METHOD("set_environment", "value"), &EnvironmentData::set_environment);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_environment", "get_environment");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment3D"), "set_environment", "get_environment");
ClassDB::bind_method(D_METHOD("get_color", "index"), &EnvironmentData::get_color);
ClassDB::bind_method(D_METHOD("set_color", "index", "value"), &EnvironmentData::set_color);

View File

@ -40,8 +40,8 @@ class EnvironmentData : public Resource {
GDCLASS(EnvironmentData, Resource);
public:
Ref<Environment> get_environment();
void set_environment(const Ref<Environment> &value);
Ref<Environment3D> get_environment();
void set_environment(const Ref<Environment3D> &value);
Color get_color(const int index);
void set_color(const int index, const Color &value);
@ -50,7 +50,7 @@ public:
float get_indirect_energy(const int index);
void set_indirect_energy(const int index, const float value);
void setup(WorldEnvironment *world_environment, DirectionalLight *primary_light, DirectionalLight *secondary_light);
void setup(WorldEnvironment3D *world_environment, DirectionalLight *primary_light, DirectionalLight *secondary_light);
void setup_bind(Node *world_environment, Node *primary_light, Node *secondary_light);
EnvironmentData();
@ -65,7 +65,7 @@ protected:
static void _bind_methods();
private:
Ref<Environment> _environment;
Ref<Environment3D> _environment;
Color _colors[LIGHT_COUNT];
float _energies[LIGHT_COUNT];

View File

@ -430,7 +430,7 @@ void Camera::_camera_make_current(Node *p_camera) {
}
*/
void Camera::set_environment(const Ref<Environment> &p_environment) {
void Camera::set_environment(const Ref<Environment3D> &p_environment) {
environment = p_environment;
if (environment.is_valid()) {
RS::get_singleton()->camera_set_environment(camera, environment->get_rid());
@ -440,7 +440,7 @@ void Camera::set_environment(const Ref<Environment> &p_environment) {
_update_camera_mode();
}
Ref<Environment> Camera::get_environment() const {
Ref<Environment3D> Camera::get_environment() const {
return environment;
}
@ -523,7 +523,7 @@ void Camera::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::INT, "keep_aspect", PROPERTY_HINT_ENUM, "Keep Width,Keep Height"), "set_keep_aspect_mode", "get_keep_aspect_mode");
ADD_PROPERTY(PropertyInfo(Variant::INT, "cull_mask", PROPERTY_HINT_LAYERS_3D_RENDER), "set_cull_mask", "get_cull_mask");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_environment", "get_environment");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment3D"), "set_environment", "get_environment");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "h_offset"), "set_h_offset", "get_h_offset");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "v_offset"), "set_v_offset", "get_v_offset");
ADD_PROPERTY(PropertyInfo(Variant::INT, "doppler_tracking", PROPERTY_HINT_ENUM, "Disabled,Idle,Physics"), "set_doppler_tracking", "get_doppler_tracking");

View File

@ -35,7 +35,7 @@
class SpatialVelocityTracker;
class Viewport;
class Environment;
class Environment3D;
class Camera : public Spatial {
GDCLASS(Camera, Spatial);
@ -81,7 +81,7 @@ private:
uint32_t layers;
Ref<Environment> environment;
Ref<Environment3D> environment;
//void _camera_make_current(Node *p_camera);
friend class Viewport;
@ -154,8 +154,8 @@ public:
virtual Vector<Plane> get_frustum() const;
void set_environment(const Ref<Environment> &p_environment);
Ref<Environment> get_environment() const;
void set_environment(const Ref<Environment3D> &p_environment);
Ref<Environment3D> get_environment() const;
void set_keep_aspect_mode(KeepAspect p_aspect);
KeepAspect get_keep_aspect_mode() const;

View File

@ -35,11 +35,11 @@
#include "scene/resources/environment.h"
#include "scene/resources/world.h"
void WorldEnvironment::_notification(int p_what) {
void WorldEnvironment3D::_notification(int p_what) {
if (p_what == Spatial::NOTIFICATION_ENTER_WORLD || p_what == Spatial::NOTIFICATION_ENTER_TREE) {
if (environment.is_valid()) {
if (get_viewport()->find_world()->get_environment().is_valid()) {
WARN_PRINT("World already has an environment (Another WorldEnvironment?), overriding.");
WARN_PRINT("World already has an environment (Another WorldEnvironment3D?), overriding.");
}
get_viewport()->find_world()->set_environment(environment);
add_to_group("_world_environment_" + itos(get_viewport()->find_world()->get_scenario().get_id()));
@ -47,15 +47,15 @@ void WorldEnvironment::_notification(int p_what) {
} else if (p_what == Spatial::NOTIFICATION_EXIT_WORLD || p_what == Spatial::NOTIFICATION_EXIT_TREE) {
if (environment.is_valid() && get_viewport()->find_world()->get_environment() == environment) {
get_viewport()->find_world()->set_environment(Ref<Environment>());
get_viewport()->find_world()->set_environment(Ref<Environment3D>());
remove_from_group("_world_environment_" + itos(get_viewport()->find_world()->get_scenario().get_id()));
}
}
}
void WorldEnvironment::set_environment(const Ref<Environment> &p_environment) {
void WorldEnvironment3D::set_environment(const Ref<Environment3D> &p_environment) {
if (is_inside_tree() && environment.is_valid() && get_viewport()->find_world()->get_environment() == environment) {
get_viewport()->find_world()->set_environment(Ref<Environment>());
get_viewport()->find_world()->set_environment(Ref<Environment3D>());
remove_from_group("_world_environment_" + itos(get_viewport()->find_world()->get_scenario().get_id()));
//clean up
}
@ -63,7 +63,7 @@ void WorldEnvironment::set_environment(const Ref<Environment> &p_environment) {
environment = p_environment;
if (is_inside_tree() && environment.is_valid()) {
if (get_viewport()->find_world()->get_environment().is_valid()) {
WARN_PRINT("World already has an environment (Another WorldEnvironment?), overriding.");
WARN_PRINT("World already has an environment (Another WorldEnvironment3D?), overriding.");
}
get_viewport()->find_world()->set_environment(environment);
add_to_group("_world_environment_" + itos(get_viewport()->find_world()->get_scenario().get_id()));
@ -72,17 +72,17 @@ void WorldEnvironment::set_environment(const Ref<Environment> &p_environment) {
update_configuration_warning();
}
Ref<Environment> WorldEnvironment::get_environment() const {
Ref<Environment3D> WorldEnvironment3D::get_environment() const {
return environment;
}
String WorldEnvironment::get_configuration_warning() const {
String WorldEnvironment3D::get_configuration_warning() const {
String warning = Node::get_configuration_warning();
if (!environment.is_valid()) {
if (warning != String()) {
warning += "\n\n";
}
warning += TTR("WorldEnvironment requires its \"Environment\" property to contain an Environment to have a visible effect.");
warning += TTR("WorldEnvironment3D requires its \"Environment3D\" property to contain an Environment3D to have a visible effect.");
return warning;
}
@ -97,22 +97,22 @@ String WorldEnvironment::get_configuration_warning() const {
if (warning != String()) {
warning += "\n\n";
}
warning += TTR("Only one WorldEnvironment is allowed per scene (or set of instanced scenes).");
warning += TTR("Only one WorldEnvironment3D is allowed per scene (or set of instanced scenes).");
}
// Commenting this warning for now, I think it makes no sense. If anyone can figure out what its supposed to do, feedback welcome. Else it should be deprecated.
//if (environment.is_valid() && get_viewport() && !get_viewport()->get_camera() && environment->get_background() != Environment::BG_CANVAS) {
// return TTR("This WorldEnvironment is ignored. Either add a Camera (for 3D scenes) or set this environment's Background Mode to Canvas (for 2D scenes).");
//if (environment.is_valid() && get_viewport() && !get_viewport()->get_camera() && environment->get_background() != Environment3D::BG_CANVAS) {
// return TTR("This WorldEnvironment3D is ignored. Either add a Camera (for 3D scenes) or set this environment's Background Mode to Canvas (for 2D scenes).");
//}
return warning;
}
void WorldEnvironment::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_environment", "env"), &WorldEnvironment::set_environment);
ClassDB::bind_method(D_METHOD("get_environment"), &WorldEnvironment::get_environment);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_environment", "get_environment");
void WorldEnvironment3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_environment", "env"), &WorldEnvironment3D::set_environment);
ClassDB::bind_method(D_METHOD("get_environment"), &WorldEnvironment3D::get_environment);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment3D"), "set_environment", "get_environment");
}
WorldEnvironment::WorldEnvironment() {
WorldEnvironment3D::WorldEnvironment3D() {
}

View File

@ -33,24 +33,24 @@
#include "core/object/reference.h"
#include "scene/main/node.h"
class Environment;
class Environment3D;
class WorldEnvironment : public Node {
GDCLASS(WorldEnvironment, Node);
class WorldEnvironment3D : public Node {
GDCLASS(WorldEnvironment3D, Node);
Ref<Environment> environment;
Ref<Environment3D> environment;
protected:
void _notification(int p_what);
static void _bind_methods();
public:
void set_environment(const Ref<Environment> &p_environment);
Ref<Environment> get_environment() const;
void set_environment(const Ref<Environment3D> &p_environment);
Ref<Environment3D> get_environment() const;
String get_configuration_warning() const;
WorldEnvironment();
WorldEnvironment3D();
};
#endif

View File

@ -684,7 +684,7 @@ bool SceneTree::idle(float p_time) {
String env_path = ProjectSettings::get_singleton()->get("rendering/environment/default_environment");
env_path = env_path.strip_edges(); //user may have added a space or two
String cpath;
Ref<Environment> fallback = get_root()->get_world()->get_fallback_environment();
Ref<Environment3D> fallback = get_root()->get_world()->get_fallback_environment();
if (fallback.is_valid()) {
cpath = fallback->get_path();
}
@ -2260,7 +2260,7 @@ SceneTree::SceneTree() {
{ //load default fallback environment
//get possible extensions
List<String> exts;
ResourceLoader::get_recognized_extensions_for_type("Environment", &exts);
ResourceLoader::get_recognized_extensions_for_type("Environment3D", &exts);
String ext_hint;
for (List<String>::Element *E = exts.front(); E; E = E->next()) {
if (ext_hint != String()) {
@ -2274,7 +2274,7 @@ SceneTree::SceneTree() {
ProjectSettings::get_singleton()->set_custom_property_info("rendering/environment/default_environment", PropertyInfo(Variant::STRING, "rendering/viewport/default_environment", PROPERTY_HINT_FILE, ext_hint));
env_path = env_path.strip_edges();
if (env_path != String()) {
Ref<Environment> env = ResourceLoader::load(env_path);
Ref<Environment3D> env = ResourceLoader::load(env_path);
if (env.is_valid()) {
root->get_world()->set_fallback_environment(env);
} else {

View File

@ -1059,7 +1059,7 @@ void Viewport::_propagate_enter_world(Node *p_node) {
return;
}
if (Object::cast_to<Spatial>(p_node) || Object::cast_to<WorldEnvironment>(p_node)) {
if (Object::cast_to<Spatial>(p_node) || Object::cast_to<WorldEnvironment3D>(p_node)) {
p_node->notification(Spatial::NOTIFICATION_ENTER_WORLD);
} else {
Viewport *v = Object::cast_to<Viewport>(p_node);
@ -1093,7 +1093,7 @@ void Viewport::_propagate_exit_world(Node *p_node) {
return;
}
if (Object::cast_to<Spatial>(p_node) || Object::cast_to<WorldEnvironment>(p_node)) {
if (Object::cast_to<Spatial>(p_node) || Object::cast_to<WorldEnvironment3D>(p_node)) {
p_node->notification(Spatial::NOTIFICATION_EXIT_WORLD);
} else {
Viewport *v = Object::cast_to<Viewport>(p_node);

View File

@ -474,7 +474,7 @@ void register_scene_types() {
ClassDB::register_class<PathFollow>();
ClassDB::register_class<VisibilityNotifier>();
ClassDB::register_class<VisibilityEnabler>();
ClassDB::register_class<WorldEnvironment>();
ClassDB::register_class<WorldEnvironment3D>();
ClassDB::register_class<RemoteTransform>();
ClassDB::register_virtual_class<Joint>();
@ -602,7 +602,7 @@ void register_scene_types() {
#endif
ClassDB::register_class<PhysicsMaterial>();
ClassDB::register_class<World3D>();
ClassDB::register_class<Environment>();
ClassDB::register_class<Environment3D>();
ClassDB::register_class<World2D>();
ClassDB::register_virtual_class<Texture>();
ClassDB::register_virtual_class<Sky>();

File diff suppressed because it is too large Load Diff

View File

@ -35,8 +35,8 @@
class Sky;
class Texture;
class Environment : public Resource {
GDCLASS(Environment, Resource);
class Environment3D : public Resource {
GDCLASS(Environment3D, Resource);
public:
enum BGMode {
@ -407,15 +407,15 @@ public:
virtual RID get_rid() const;
Environment();
~Environment();
Environment3D();
~Environment3D();
};
VARIANT_ENUM_CAST(Environment::BGMode)
VARIANT_ENUM_CAST(Environment::ToneMapper)
VARIANT_ENUM_CAST(Environment::GlowBlendMode)
VARIANT_ENUM_CAST(Environment::DOFBlurQuality)
VARIANT_ENUM_CAST(Environment::SSAOQuality)
VARIANT_ENUM_CAST(Environment::SSAOBlur)
VARIANT_ENUM_CAST(Environment3D::BGMode)
VARIANT_ENUM_CAST(Environment3D::ToneMapper)
VARIANT_ENUM_CAST(Environment3D::GlowBlendMode)
VARIANT_ENUM_CAST(Environment3D::DOFBlurQuality)
VARIANT_ENUM_CAST(Environment3D::SSAOQuality)
VARIANT_ENUM_CAST(Environment3D::SSAOBlur)
#endif // ENVIRONMENT_H

View File

@ -266,7 +266,7 @@ RID World3D::get_navigation_map() const {
return navigation_map;
}
void World3D::set_environment(const Ref<Environment> &p_environment) {
void World3D::set_environment(const Ref<Environment3D> &p_environment) {
if (environment == p_environment) {
return;
}
@ -281,11 +281,11 @@ void World3D::set_environment(const Ref<Environment> &p_environment) {
emit_changed();
}
Ref<Environment> World3D::get_environment() const {
Ref<Environment3D> World3D::get_environment() const {
return environment;
}
void World3D::set_fallback_environment(const Ref<Environment> &p_environment) {
void World3D::set_fallback_environment(const Ref<Environment3D> &p_environment) {
if (fallback_environment == p_environment) {
return;
}
@ -300,7 +300,7 @@ void World3D::set_fallback_environment(const Ref<Environment> &p_environment) {
emit_changed();
}
Ref<Environment> World3D::get_fallback_environment() const {
Ref<Environment3D> World3D::get_fallback_environment() const {
return fallback_environment;
}
@ -323,8 +323,8 @@ void World3D::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_fallback_environment", "env"), &World3D::set_fallback_environment);
ClassDB::bind_method(D_METHOD("get_fallback_environment"), &World3D::get_fallback_environment);
ClassDB::bind_method(D_METHOD("get_direct_space_state"), &World3D::get_direct_space_state);
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_environment", "get_environment");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "fallback_environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment"), "set_fallback_environment", "get_fallback_environment");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment3D"), "set_environment", "get_environment");
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "fallback_environment", PROPERTY_HINT_RESOURCE_TYPE, "Environment3D"), "set_fallback_environment", "get_fallback_environment");
ADD_PROPERTY(PropertyInfo(Variant::RID, "space", PROPERTY_HINT_NONE, "", 0), "", "get_space");
ADD_PROPERTY(PropertyInfo(Variant::RID, "scenario", PROPERTY_HINT_NONE, "", 0), "", "get_scenario");
ADD_PROPERTY(PropertyInfo(Variant::RID, "navigation_map", PROPERTY_HINT_NONE, "", 0), "", "get_navigation_map");

View File

@ -49,8 +49,8 @@ private:
RID scenario;
RID navigation_map;
SpatialIndexer *indexer;
Ref<Environment> environment;
Ref<Environment> fallback_environment;
Ref<Environment3D> environment;
Ref<Environment3D> fallback_environment;
protected:
static void _bind_methods();
@ -73,11 +73,11 @@ public:
RID get_scenario() const;
RID get_navigation_map() const;
void set_environment(const Ref<Environment> &p_environment);
Ref<Environment> get_environment() const;
void set_environment(const Ref<Environment3D> &p_environment);
Ref<Environment3D> get_environment() const;
void set_fallback_environment(const Ref<Environment> &p_environment);
Ref<Environment> get_fallback_environment() const;
void set_fallback_environment(const Ref<Environment3D> &p_environment);
Ref<Environment3D> get_fallback_environment() const;
void get_camera_list(List<Camera *> *r_cameras);

View File

@ -52,7 +52,7 @@ public:
virtual RID environment_create() = 0;
virtual void environment_set_background(RID p_env, RS::EnvironmentBG p_bg) = 0;
virtual void environment_set_background(RID p_env, RS::Environment3DBG p_bg) = 0;
virtual void environment_set_sky(RID p_env, RID p_sky) = 0;
virtual void environment_set_sky_custom_fov(RID p_env, float p_scale) = 0;
virtual void environment_set_sky_orientation(RID p_env, const Basis &p_orientation) = 0;
@ -61,15 +61,15 @@ public:
virtual void environment_set_canvas_max_layer(RID p_env, int p_max_layer) = 0;
virtual void environment_set_ambient_light(RID p_env, const Color &p_color, float p_energy = 1.0, float p_sky_contribution = 0.0) = 0;
virtual void environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, RS::EnvironmentDOFBlurQuality p_quality) = 0;
virtual void environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, RS::EnvironmentDOFBlurQuality p_quality) = 0;
virtual void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, RS::EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale, bool p_high_quality) = 0;
virtual void environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, RS::Environment3DDOFBlurQuality p_quality) = 0;
virtual void environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, RS::Environment3DDOFBlurQuality p_quality) = 0;
virtual void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, RS::Environment3DGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale, bool p_high_quality) = 0;
virtual void environment_set_fog(RID p_env, bool p_enable, float p_begin, float p_end, RID p_gradient_texture) = 0;
virtual void environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_fade_int, float p_fade_out, float p_depth_tolerance, bool p_roughness) = 0;
virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, float p_ao_channel_affect, const Color &p_color, RS::EnvironmentSSAOQuality p_quality, RS::EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness) = 0;
virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, float p_ao_channel_affect, const Color &p_color, RS::Environment3DSSAOQuality p_quality, RS::Environment3DSSAOBlur p_blur, float p_bilateral_sharpness) = 0;
virtual void environment_set_tonemap(RID p_env, RS::EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale) = 0;
virtual void environment_set_tonemap(RID p_env, RS::Environment3DToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_scale) = 0;
virtual void environment_set_adjustment(RID p_env, bool p_enable, float p_brightness, float p_contrast, float p_saturation, RID p_ramp) = 0;
@ -78,7 +78,7 @@ public:
virtual void environment_set_fog_height(RID p_env, bool p_enable, float p_min_height, float p_max_height, float p_height_curve) = 0;
virtual bool is_environment(RID p_env) = 0;
virtual RS::EnvironmentBG environment_get_background(RID p_env) = 0;
virtual RS::Environment3DBG environment_get_background(RID p_env) = 0;
virtual int environment_get_canvas_max_layer(RID p_env) = 0;
struct InstanceBase : RID_Data {

View File

@ -432,7 +432,7 @@ public:
BIND0R(RID, environment_create)
BIND2(environment_set_background, RID, EnvironmentBG)
BIND2(environment_set_background, RID, Environment3DBG)
BIND2(environment_set_sky, RID, RID)
BIND2(environment_set_sky_custom_fov, RID, float)
BIND2(environment_set_sky_orientation, RID, const Basis &)
@ -441,13 +441,13 @@ public:
BIND2(environment_set_canvas_max_layer, RID, int)
BIND4(environment_set_ambient_light, RID, const Color &, float, float)
BIND7(environment_set_ssr, RID, bool, int, float, float, float, bool)
BIND13(environment_set_ssao, RID, bool, float, float, float, float, float, float, float, const Color &, EnvironmentSSAOQuality, EnvironmentSSAOBlur, float)
BIND13(environment_set_ssao, RID, bool, float, float, float, float, float, float, float, const Color &, Environment3DSSAOQuality, Environment3DSSAOBlur, float)
BIND6(environment_set_dof_blur_near, RID, bool, float, float, float, EnvironmentDOFBlurQuality)
BIND6(environment_set_dof_blur_far, RID, bool, float, float, float, EnvironmentDOFBlurQuality)
BIND12(environment_set_glow, RID, bool, int, float, float, float, EnvironmentGlowBlendMode, float, float, float, bool, bool)
BIND6(environment_set_dof_blur_near, RID, bool, float, float, float, Environment3DDOFBlurQuality)
BIND6(environment_set_dof_blur_far, RID, bool, float, float, float, Environment3DDOFBlurQuality)
BIND12(environment_set_glow, RID, bool, int, float, float, float, Environment3DGlowBlendMode, float, float, float, bool, bool)
BIND9(environment_set_tonemap, RID, EnvironmentToneMapper, float, float, bool, float, float, float, float)
BIND9(environment_set_tonemap, RID, Environment3DToneMapper, float, float, bool, float, float, float, float)
BIND6(environment_set_adjustment, RID, bool, float, float, float, RID)

View File

@ -354,7 +354,7 @@ public:
FUNCRID(environment)
FUNC2(environment_set_background, RID, EnvironmentBG)
FUNC2(environment_set_background, RID, Environment3DBG)
FUNC2(environment_set_sky, RID, RID)
FUNC2(environment_set_sky_custom_fov, RID, float)
FUNC2(environment_set_sky_orientation, RID, const Basis &)
@ -363,13 +363,13 @@ public:
FUNC2(environment_set_canvas_max_layer, RID, int)
FUNC4(environment_set_ambient_light, RID, const Color &, float, float)
FUNC7(environment_set_ssr, RID, bool, int, float, float, float, bool)
FUNC13(environment_set_ssao, RID, bool, float, float, float, float, float, float, float, const Color &, EnvironmentSSAOQuality, EnvironmentSSAOBlur, float)
FUNC13(environment_set_ssao, RID, bool, float, float, float, float, float, float, float, const Color &, Environment3DSSAOQuality, Environment3DSSAOBlur, float)
FUNC6(environment_set_dof_blur_near, RID, bool, float, float, float, EnvironmentDOFBlurQuality)
FUNC6(environment_set_dof_blur_far, RID, bool, float, float, float, EnvironmentDOFBlurQuality)
FUNC12(environment_set_glow, RID, bool, int, float, float, float, EnvironmentGlowBlendMode, float, float, float, bool, bool)
FUNC6(environment_set_dof_blur_near, RID, bool, float, float, float, Environment3DDOFBlurQuality)
FUNC6(environment_set_dof_blur_far, RID, bool, float, float, float, Environment3DDOFBlurQuality)
FUNC12(environment_set_glow, RID, bool, int, float, float, float, Environment3DGlowBlendMode, float, float, float, bool, bool)
FUNC9(environment_set_tonemap, RID, EnvironmentToneMapper, float, float, bool, float, float, float, float)
FUNC9(environment_set_tonemap, RID, Environment3DToneMapper, float, float, bool, float, float, float, float)
FUNC6(environment_set_adjustment, RID, bool, float, float, float, RID)

View File

@ -644,7 +644,7 @@ public:
virtual RID environment_create() = 0;
enum EnvironmentBG {
enum Environment3DBG {
ENV_BG_CLEAR_COLOR,
ENV_BG_COLOR,
@ -656,7 +656,7 @@ public:
ENV_BG_MAX
};
virtual void environment_set_background(RID p_env, EnvironmentBG p_bg) = 0;
virtual void environment_set_background(RID p_env, Environment3DBG p_bg) = 0;
virtual void environment_set_sky(RID p_env, RID p_sky) = 0;
virtual void environment_set_sky_custom_fov(RID p_env, float p_scale) = 0;
virtual void environment_set_sky_orientation(RID p_env, const Basis &p_orientation) = 0;
@ -669,24 +669,24 @@ public:
//set default SSR options
//set default SSSSS options
enum EnvironmentDOFBlurQuality {
enum Environment3DDOFBlurQuality {
ENV_DOF_BLUR_QUALITY_LOW,
ENV_DOF_BLUR_QUALITY_MEDIUM,
ENV_DOF_BLUR_QUALITY_HIGH,
};
virtual void environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, EnvironmentDOFBlurQuality p_quality) = 0;
virtual void environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, EnvironmentDOFBlurQuality p_quality) = 0;
virtual void environment_set_dof_blur_near(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, Environment3DDOFBlurQuality p_quality) = 0;
virtual void environment_set_dof_blur_far(RID p_env, bool p_enable, float p_distance, float p_transition, float p_far_amount, Environment3DDOFBlurQuality p_quality) = 0;
enum EnvironmentGlowBlendMode {
enum Environment3DGlowBlendMode {
GLOW_BLEND_MODE_ADDITIVE,
GLOW_BLEND_MODE_SCREEN,
GLOW_BLEND_MODE_SOFTLIGHT,
GLOW_BLEND_MODE_REPLACE,
};
virtual void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, EnvironmentGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale, bool p_high_quality) = 0;
virtual void environment_set_glow(RID p_env, bool p_enable, int p_level_flags, float p_intensity, float p_strength, float p_bloom_threshold, Environment3DGlowBlendMode p_blend_mode, float p_hdr_bleed_threshold, float p_hdr_bleed_scale, float p_hdr_luminance_cap, bool p_bicubic_upscale, bool p_high_quality) = 0;
enum EnvironmentToneMapper {
enum Environment3DToneMapper {
ENV_TONE_MAPPER_LINEAR,
ENV_TONE_MAPPER_REINHARD,
ENV_TONE_MAPPER_FILMIC,
@ -694,25 +694,25 @@ public:
ENV_TONE_MAPPER_ACES_FITTED
};
virtual void environment_set_tonemap(RID p_env, EnvironmentToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_grey) = 0;
virtual void environment_set_tonemap(RID p_env, Environment3DToneMapper p_tone_mapper, float p_exposure, float p_white, bool p_auto_exposure, float p_min_luminance, float p_max_luminance, float p_auto_exp_speed, float p_auto_exp_grey) = 0;
virtual void environment_set_adjustment(RID p_env, bool p_enable, float p_brightness, float p_contrast, float p_saturation, RID p_ramp) = 0;
virtual void environment_set_ssr(RID p_env, bool p_enable, int p_max_steps, float p_fade_in, float p_fade_out, float p_depth_tolerance, bool p_roughness) = 0;
enum EnvironmentSSAOQuality {
enum Environment3DSSAOQuality {
ENV_SSAO_QUALITY_LOW,
ENV_SSAO_QUALITY_MEDIUM,
ENV_SSAO_QUALITY_HIGH,
};
enum EnvironmentSSAOBlur {
enum Environment3DSSAOBlur {
ENV_SSAO_BLUR_DISABLED,
ENV_SSAO_BLUR_1x1,
ENV_SSAO_BLUR_2x2,
ENV_SSAO_BLUR_3x3,
};
virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, float p_ao_channel_affect, const Color &p_color, EnvironmentSSAOQuality p_quality, EnvironmentSSAOBlur p_blur, float p_bilateral_sharpness) = 0;
virtual void environment_set_ssao(RID p_env, bool p_enable, float p_radius, float p_intensity, float p_radius2, float p_intensity2, float p_bias, float p_light_affect, float p_ao_channel_affect, const Color &p_color, Environment3DSSAOQuality p_quality, Environment3DSSAOBlur p_blur, float p_bilateral_sharpness) = 0;
virtual void environment_set_fog(RID p_env, bool p_enable, const Color &p_color, const Color &p_sun_color, float p_sun_amount) = 0;
virtual void environment_set_fog_depth(RID p_env, bool p_enable, float p_depth_begin, float p_depth_end, float p_depth_curve, bool p_transmit, float p_transmit_curve) = 0;
@ -1125,12 +1125,12 @@ VARIANT_ENUM_CAST(RenderingServer::LightOmniShadowDetail);
VARIANT_ENUM_CAST(RenderingServer::LightDirectionalShadowMode);
VARIANT_ENUM_CAST(RenderingServer::LightDirectionalShadowDepthRangeMode);
VARIANT_ENUM_CAST(RenderingServer::ReflectionProbeUpdateMode);
VARIANT_ENUM_CAST(RenderingServer::EnvironmentBG);
VARIANT_ENUM_CAST(RenderingServer::EnvironmentDOFBlurQuality);
VARIANT_ENUM_CAST(RenderingServer::EnvironmentGlowBlendMode);
VARIANT_ENUM_CAST(RenderingServer::EnvironmentToneMapper);
VARIANT_ENUM_CAST(RenderingServer::EnvironmentSSAOQuality);
VARIANT_ENUM_CAST(RenderingServer::EnvironmentSSAOBlur);
VARIANT_ENUM_CAST(RenderingServer::Environment3DBG);
VARIANT_ENUM_CAST(RenderingServer::Environment3DDOFBlurQuality);
VARIANT_ENUM_CAST(RenderingServer::Environment3DGlowBlendMode);
VARIANT_ENUM_CAST(RenderingServer::Environment3DToneMapper);
VARIANT_ENUM_CAST(RenderingServer::Environment3DSSAOQuality);
VARIANT_ENUM_CAST(RenderingServer::Environment3DSSAOBlur);
VARIANT_ENUM_CAST(RenderingServer::InstanceFlags);
VARIANT_ENUM_CAST(RenderingServer::ShadowCastingSetting);
VARIANT_ENUM_CAST(RenderingServer::TextureType);