feat: updated godot version
This commit is contained in:
parent
0c508b0831
commit
42b028dbb5
4694 changed files with 236470 additions and 401376 deletions
|
|
@ -30,13 +30,8 @@
|
|||
|
||||
#include "environment.h"
|
||||
|
||||
#include "core/config/engine.h"
|
||||
#include "core/config/project_settings.h"
|
||||
#include "core/object/callable_mp.h"
|
||||
#include "core/object/class_db.h"
|
||||
#include "core/os/os.h"
|
||||
#include "scene/resources/gradient_texture.h"
|
||||
#include "scene/resources/sky.h"
|
||||
#include "servers/rendering/rendering_server.h"
|
||||
|
||||
RID Environment::get_rid() const {
|
||||
|
|
@ -47,7 +42,7 @@ RID Environment::get_rid() const {
|
|||
|
||||
void Environment::set_background(BGMode p_bg) {
|
||||
bg_mode = p_bg;
|
||||
RS::get_singleton()->environment_set_background(environment, RSE::EnvironmentBG(p_bg));
|
||||
RS::get_singleton()->environment_set_background(environment, RS::EnvironmentBG(p_bg));
|
||||
notify_property_list_changed();
|
||||
if (bg_mode != BG_SKY) {
|
||||
set_fog_aerial_perspective(0.0);
|
||||
|
|
@ -197,9 +192,9 @@ void Environment::_update_ambient_light() {
|
|||
RS::get_singleton()->environment_set_ambient_light(
|
||||
environment,
|
||||
ambient_color,
|
||||
RSE::EnvironmentAmbientSource(ambient_source),
|
||||
RS::EnvironmentAmbientSource(ambient_source),
|
||||
ambient_energy,
|
||||
ambient_sky_contribution, RSE::EnvironmentReflectionSource(reflection_source));
|
||||
ambient_sky_contribution, RS::EnvironmentReflectionSource(reflection_source));
|
||||
}
|
||||
|
||||
// Tonemap
|
||||
|
|
@ -253,7 +248,7 @@ float Environment::get_tonemap_agx_contrast() const {
|
|||
void Environment::_update_tonemap() {
|
||||
RS::get_singleton()->environment_set_tonemap(
|
||||
environment,
|
||||
RSE::EnvironmentToneMapper(tone_mapper),
|
||||
RS::EnvironmentToneMapper(tone_mapper),
|
||||
tonemap_exposure,
|
||||
tone_mapper == TONE_MAPPER_AGX ? tonemap_agx_white : tonemap_white);
|
||||
}
|
||||
|
|
@ -594,7 +589,7 @@ void Environment::_update_sdfgi() {
|
|||
sdfgi_enabled,
|
||||
sdfgi_cascades,
|
||||
sdfgi_min_cell_size,
|
||||
RSE::EnvironmentSDFGIYScale(sdfgi_y_scale),
|
||||
RS::EnvironmentSDFGIYScale(sdfgi_y_scale),
|
||||
sdfgi_use_occlusion,
|
||||
sdfgi_bounce_feedback,
|
||||
sdfgi_read_sky_light,
|
||||
|
|
@ -615,7 +610,7 @@ bool Environment::is_glow_enabled() const {
|
|||
}
|
||||
|
||||
void Environment::set_glow_level(int p_level, float p_intensity) {
|
||||
ERR_FAIL_INDEX(p_level, RSE::MAX_GLOW_LEVELS);
|
||||
ERR_FAIL_INDEX(p_level, RS::MAX_GLOW_LEVELS);
|
||||
|
||||
glow_levels.write[p_level] = p_intensity;
|
||||
|
||||
|
|
@ -623,7 +618,7 @@ void Environment::set_glow_level(int p_level, float p_intensity) {
|
|||
}
|
||||
|
||||
float Environment::get_glow_level(int p_level) const {
|
||||
ERR_FAIL_INDEX_V(p_level, RSE::MAX_GLOW_LEVELS, 0.0);
|
||||
ERR_FAIL_INDEX_V(p_level, RS::MAX_GLOW_LEVELS, 0.0);
|
||||
|
||||
return glow_levels[p_level];
|
||||
}
|
||||
|
|
@ -761,7 +756,7 @@ void Environment::_update_glow() {
|
|||
glow_strength,
|
||||
glow_mix,
|
||||
glow_bloom,
|
||||
RSE::EnvironmentGlowBlendMode(glow_blend_mode),
|
||||
RS::EnvironmentGlowBlendMode(glow_blend_mode),
|
||||
glow_hdr_bleed_threshold,
|
||||
glow_hdr_bleed_scale,
|
||||
glow_hdr_luminance_cap,
|
||||
|
|
@ -867,7 +862,7 @@ void Environment::_update_fog() {
|
|||
fog_height_density,
|
||||
fog_aerial_perspective,
|
||||
fog_sky_affect,
|
||||
RSE::EnvironmentFogMode(fog_mode));
|
||||
RS::EnvironmentFogMode(fog_mode));
|
||||
}
|
||||
|
||||
// Depth Fog
|
||||
|
|
@ -1112,75 +1107,56 @@ void Environment::_validate_property(PropertyInfo &p_property) const {
|
|||
if (bg_mode != BG_SKY && ambient_source != AMBIENT_SOURCE_SKY && reflection_source != REFLECTION_SOURCE_SKY) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "fog_depth_curve" || p_property.name == "fog_depth_begin" || p_property.name == "fog_depth_end") {
|
||||
if (fog_mode == FOG_MODE_EXPONENTIAL) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "ambient_light_color" || p_property.name == "ambient_light_energy") {
|
||||
if (ambient_source == AMBIENT_SOURCE_DISABLED) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "ambient_light_sky_contribution") {
|
||||
if (ambient_source == AMBIENT_SOURCE_DISABLED || ambient_source == AMBIENT_SOURCE_COLOR) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "fog_aerial_perspective") {
|
||||
if (bg_mode != BG_SKY) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "tonemap_white") {
|
||||
if (tone_mapper == TONE_MAPPER_LINEAR || tone_mapper == TONE_MAPPER_AGX) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
if (p_property.name == "tonemap_white" && (tone_mapper == TONE_MAPPER_LINEAR || tone_mapper == TONE_MAPPER_AGX)) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
|
||||
if (p_property.name == "tonemap_agx_white") {
|
||||
if (tone_mapper != TONE_MAPPER_AGX) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
if (p_property.name == "tonemap_agx_white" && tone_mapper != TONE_MAPPER_AGX) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
|
||||
if (p_property.name == "tonemap_agx_contrast") {
|
||||
if (tone_mapper != TONE_MAPPER_AGX) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
if (p_property.name == "tonemap_agx_contrast" && tone_mapper != TONE_MAPPER_AGX) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
|
||||
if (p_property.name == "glow_intensity") {
|
||||
if (glow_blend_mode == GLOW_BLEND_MODE_MIX && OS::get_singleton()->get_current_rendering_method() != "gl_compatibility") {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
if (p_property.name == "glow_intensity" && glow_blend_mode == GLOW_BLEND_MODE_MIX && OS::get_singleton()->get_current_rendering_method() != "gl_compatibility") {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
|
||||
if (OS::get_singleton()->get_current_rendering_method() == "gl_compatibility") {
|
||||
// Hide glow properties we do not support in GL Compatibility.
|
||||
if (p_property.name.begins_with("glow_levels") || p_property.name == "glow_normalized" || p_property.name == "glow_strength" || p_property.name == "glow_mix" || p_property.name == "glow_blend_mode" || p_property.name == "glow_map_strength" || p_property.name == "glow_map") {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (p_property.name == "glow_mix" && glow_blend_mode != GLOW_BLEND_MODE_MIX) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1190,7 +1166,6 @@ void Environment::_validate_property(PropertyInfo &p_property) const {
|
|||
if ((p_property.name != "ssao_enabled") && (p_property.name != "ssao_radius") && (p_property.name != "ssao_intensity")) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1198,21 +1173,18 @@ void Environment::_validate_property(PropertyInfo &p_property) const {
|
|||
if (bg_mode != BG_COLOR && ambient_source != AMBIENT_SOURCE_COLOR) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "background_canvas_max_layer") {
|
||||
if (bg_mode != BG_CANVAS) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "background_camera_feed_id") {
|
||||
if (bg_mode != BG_CAMERA_FEED) {
|
||||
p_property.usage = PROPERTY_USAGE_NO_EDITOR;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_property.name == "background_intensity" && !GLOBAL_GET_CACHED(bool, "rendering/lights_and_shadows/use_physical_light_units")) {
|
||||
|
|
@ -1271,7 +1243,7 @@ void Environment::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::INT, "background_camera_feed_id", PROPERTY_HINT_RANGE, "1,10,1"), "set_camera_feed_id", "get_camera_feed_id");
|
||||
|
||||
ADD_GROUP("Sky", "sky_");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "sky", PROPERTY_HINT_RESOURCE_TYPE, Sky::get_class_static()), "set_sky", "get_sky");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "sky", PROPERTY_HINT_RESOURCE_TYPE, "Sky"), "set_sky", "get_sky");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "sky_custom_fov", PROPERTY_HINT_RANGE, "0,180,0.1,degrees"), "set_sky_custom_fov", "get_sky_custom_fov");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::VECTOR3, "sky_rotation", PROPERTY_HINT_RANGE, "-360,360,0.1,or_less,or_greater,radians_as_degrees"), "set_sky_rotation", "get_sky_rotation");
|
||||
|
||||
|
|
@ -1478,7 +1450,7 @@ void Environment::_bind_methods() {
|
|||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "glow_hdr_scale", PROPERTY_HINT_RANGE, "0.0,4.0,0.01"), "set_glow_hdr_bleed_scale", "get_glow_hdr_bleed_scale");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "glow_hdr_luminance_cap", PROPERTY_HINT_RANGE, "0.0,256.0,0.01"), "set_glow_hdr_luminance_cap", "get_glow_hdr_luminance_cap");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "glow_map_strength", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"), "set_glow_map_strength", "get_glow_map_strength");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "glow_map", PROPERTY_HINT_RESOURCE_TYPE, Texture2D::get_class_static()), "set_glow_map", "get_glow_map");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "glow_map", PROPERTY_HINT_RESOURCE_TYPE, "Texture2D"), "set_glow_map", "get_glow_map");
|
||||
|
||||
// Fog
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue