Hide Tonemap White property when tonemapper is Linear in Environment

The whitepoint property isn't used when the tonemapper is Linear.
This commit is contained in:
Hugo Locurcio 2022-04-10 23:50:14 +02:00 committed by Relintai
parent 371b5513d3
commit 08f0acd056

View File

@ -150,6 +150,7 @@ float Environment::get_ambient_light_sky_contribution() const {
void Environment::set_tonemapper(ToneMapper p_tone_mapper) { void Environment::set_tonemapper(ToneMapper p_tone_mapper) {
tone_mapper = p_tone_mapper; tone_mapper = p_tone_mapper;
VS::get_singleton()->environment_set_tonemap(environment, VS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey); VS::get_singleton()->environment_set_tonemap(environment, VS::EnvironmentToneMapper(tone_mapper), tonemap_exposure, tonemap_white, tonemap_auto_exposure, tonemap_auto_exposure_min, tonemap_auto_exposure_max, tonemap_auto_exposure_speed, tonemap_auto_exposure_grey);
_change_notify();
} }
Environment::ToneMapper Environment::get_tonemapper() const { Environment::ToneMapper Environment::get_tonemapper() const {
@ -275,6 +276,12 @@ void Environment::_validate_property(PropertyInfo &property) const {
} }
} }
if (property.name == "tonemap_white") {
if (tone_mapper == TONE_MAPPER_LINEAR) {
property.usage = PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL;
}
}
static const char *hide_prefixes[] = { static const char *hide_prefixes[] = {
"fog_", "fog_",
"auto_exposure_", "auto_exposure_",