You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
-Refactored post processing, re-added glow and added a mix blend mode.
This commit is contained in:
@@ -312,6 +312,14 @@ void Environment::_validate_property(PropertyInfo &property) const {
|
||||
}
|
||||
}
|
||||
|
||||
if (property.name == "glow_intensity" && glow_blend_mode == GLOW_BLEND_MODE_MIX) {
|
||||
property.usage = PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL;
|
||||
}
|
||||
|
||||
if (property.name == "glow_mix" && glow_blend_mode != GLOW_BLEND_MODE_MIX) {
|
||||
property.usage = PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL;
|
||||
}
|
||||
|
||||
if (property.name == "background_color") {
|
||||
if (bg_mode != BG_COLOR && ambient_source != AMBIENT_SOURCE_COLOR) {
|
||||
property.usage = PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL;
|
||||
@@ -571,7 +579,7 @@ float Environment::get_ssao_edge_sharpness() const {
|
||||
void Environment::set_glow_enabled(bool p_enabled) {
|
||||
|
||||
glow_enabled = p_enabled;
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
_change_notify();
|
||||
}
|
||||
|
||||
@@ -589,7 +597,7 @@ void Environment::set_glow_level(int p_level, bool p_enabled) {
|
||||
else
|
||||
glow_levels &= ~(1 << p_level);
|
||||
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
}
|
||||
bool Environment::is_glow_level_enabled(int p_level) const {
|
||||
|
||||
@@ -602,7 +610,7 @@ void Environment::set_glow_intensity(float p_intensity) {
|
||||
|
||||
glow_intensity = p_intensity;
|
||||
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
}
|
||||
float Environment::get_glow_intensity() const {
|
||||
|
||||
@@ -612,18 +620,28 @@ float Environment::get_glow_intensity() const {
|
||||
void Environment::set_glow_strength(float p_strength) {
|
||||
|
||||
glow_strength = p_strength;
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
}
|
||||
float Environment::get_glow_strength() const {
|
||||
|
||||
return glow_strength;
|
||||
}
|
||||
|
||||
void Environment::set_glow_mix(float p_mix) {
|
||||
|
||||
glow_mix = p_mix;
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
}
|
||||
float Environment::get_glow_mix() const {
|
||||
|
||||
return glow_mix;
|
||||
}
|
||||
|
||||
void Environment::set_glow_bloom(float p_threshold) {
|
||||
|
||||
glow_bloom = p_threshold;
|
||||
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
}
|
||||
float Environment::get_glow_bloom() const {
|
||||
|
||||
@@ -634,7 +652,8 @@ void Environment::set_glow_blend_mode(GlowBlendMode p_mode) {
|
||||
|
||||
glow_blend_mode = p_mode;
|
||||
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
_change_notify();
|
||||
}
|
||||
Environment::GlowBlendMode Environment::get_glow_blend_mode() const {
|
||||
|
||||
@@ -645,7 +664,7 @@ void Environment::set_glow_hdr_bleed_threshold(float p_threshold) {
|
||||
|
||||
glow_hdr_bleed_threshold = p_threshold;
|
||||
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
}
|
||||
float Environment::get_glow_hdr_bleed_threshold() const {
|
||||
|
||||
@@ -656,7 +675,7 @@ void Environment::set_glow_hdr_luminance_cap(float p_amount) {
|
||||
|
||||
glow_hdr_luminance_cap = p_amount;
|
||||
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
}
|
||||
float Environment::get_glow_hdr_luminance_cap() const {
|
||||
|
||||
@@ -667,7 +686,7 @@ void Environment::set_glow_hdr_bleed_scale(float p_scale) {
|
||||
|
||||
glow_hdr_bleed_scale = p_scale;
|
||||
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
}
|
||||
float Environment::get_glow_hdr_bleed_scale() const {
|
||||
|
||||
@@ -677,7 +696,7 @@ float Environment::get_glow_hdr_bleed_scale() const {
|
||||
void Environment::set_glow_bicubic_upscale(bool p_enable) {
|
||||
|
||||
glow_bicubic_upscale = p_enable;
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
VS::get_singleton()->environment_set_glow(environment, glow_enabled, glow_levels, glow_intensity, glow_strength, glow_mix, glow_bloom, VS::EnvironmentGlowBlendMode(glow_blend_mode), glow_hdr_bleed_threshold, glow_hdr_bleed_threshold, glow_hdr_luminance_cap, glow_bicubic_upscale);
|
||||
}
|
||||
|
||||
bool Environment::is_glow_bicubic_upscale_enabled() const {
|
||||
@@ -1224,6 +1243,9 @@ void Environment::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_glow_strength", "strength"), &Environment::set_glow_strength);
|
||||
ClassDB::bind_method(D_METHOD("get_glow_strength"), &Environment::get_glow_strength);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_glow_mix", "mix"), &Environment::set_glow_mix);
|
||||
ClassDB::bind_method(D_METHOD("get_glow_mix"), &Environment::get_glow_mix);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_glow_bloom", "amount"), &Environment::set_glow_bloom);
|
||||
ClassDB::bind_method(D_METHOD("get_glow_bloom"), &Environment::get_glow_bloom);
|
||||
|
||||
@@ -1253,9 +1275,10 @@ void Environment::_bind_methods() {
|
||||
ADD_PROPERTYI(PropertyInfo(Variant::BOOL, "glow_levels/7"), "set_glow_level", "is_glow_level_enabled", 6);
|
||||
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "glow_intensity", PROPERTY_HINT_RANGE, "0.0,8.0,0.01"), "set_glow_intensity", "get_glow_intensity");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "glow_mix", PROPERTY_HINT_RANGE, "0.0,1.0,0.001"), "set_glow_mix", "get_glow_mix");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "glow_strength", PROPERTY_HINT_RANGE, "0.0,2.0,0.01"), "set_glow_strength", "get_glow_strength");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "glow_bloom", PROPERTY_HINT_RANGE, "0.0,1.0,0.01"), "set_glow_bloom", "get_glow_bloom");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "glow_blend_mode", PROPERTY_HINT_ENUM, "Additive,Screen,Softlight,Replace"), "set_glow_blend_mode", "get_glow_blend_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "glow_blend_mode", PROPERTY_HINT_ENUM, "Additive,Screen,Softlight,Replace,Mix"), "set_glow_blend_mode", "get_glow_blend_mode");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "glow_hdr_threshold", PROPERTY_HINT_RANGE, "0.0,4.0,0.01"), "set_glow_hdr_bleed_threshold", "get_glow_hdr_bleed_threshold");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "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::REAL, "glow_hdr_scale", PROPERTY_HINT_RANGE, "0.0,4.0,0.01"), "set_glow_hdr_bleed_scale", "get_glow_hdr_bleed_scale");
|
||||
@@ -1304,6 +1327,7 @@ void Environment::_bind_methods() {
|
||||
BIND_ENUM_CONSTANT(GLOW_BLEND_MODE_SCREEN);
|
||||
BIND_ENUM_CONSTANT(GLOW_BLEND_MODE_SOFTLIGHT);
|
||||
BIND_ENUM_CONSTANT(GLOW_BLEND_MODE_REPLACE);
|
||||
BIND_ENUM_CONSTANT(GLOW_BLEND_MODE_MIX);
|
||||
|
||||
BIND_ENUM_CONSTANT(TONE_MAPPER_LINEAR);
|
||||
BIND_ENUM_CONSTANT(TONE_MAPPER_REINHARDT);
|
||||
@@ -1387,6 +1411,7 @@ Environment::Environment() :
|
||||
glow_levels = (1 << 2) | (1 << 4);
|
||||
glow_intensity = 0.8;
|
||||
glow_strength = 1.0;
|
||||
glow_mix = 0.05;
|
||||
glow_bloom = 0.0;
|
||||
glow_blend_mode = GLOW_BLEND_MODE_SOFTLIGHT;
|
||||
glow_hdr_bleed_threshold = 1.0;
|
||||
|
||||
Reference in New Issue
Block a user