mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Replace OIDN denoiser with a JNLM denoiser compute shader implementation.
This commit is contained in:
@@ -1080,7 +1080,7 @@ LightmapGI::BakeError LightmapGI::bake(Node *p_from_node, String p_image_data_pa
|
||||
}
|
||||
}
|
||||
|
||||
Lightmapper::BakeError bake_err = lightmapper->bake(Lightmapper::BakeQuality(bake_quality), use_denoiser, bounces, bias, max_texture_size, directional, Lightmapper::GenerateProbes(gen_probes), environment_image, environment_transform, _lightmap_bake_step_function, &bsud, exposure_normalization);
|
||||
Lightmapper::BakeError bake_err = lightmapper->bake(Lightmapper::BakeQuality(bake_quality), use_denoiser, denoiser_strength, bounces, bias, max_texture_size, directional, Lightmapper::GenerateProbes(gen_probes), environment_image, environment_transform, _lightmap_bake_step_function, &bsud, exposure_normalization);
|
||||
|
||||
if (bake_err == Lightmapper::BAKE_ERROR_LIGHTMAP_TOO_SMALL) {
|
||||
return BAKE_ERROR_TEXTURE_SIZE_TOO_SMALL;
|
||||
@@ -1362,12 +1362,21 @@ AABB LightmapGI::get_aabb() const {
|
||||
|
||||
void LightmapGI::set_use_denoiser(bool p_enable) {
|
||||
use_denoiser = p_enable;
|
||||
notify_property_list_changed();
|
||||
}
|
||||
|
||||
bool LightmapGI::is_using_denoiser() const {
|
||||
return use_denoiser;
|
||||
}
|
||||
|
||||
void LightmapGI::set_denoiser_strength(float p_denoiser_strength) {
|
||||
denoiser_strength = p_denoiser_strength;
|
||||
}
|
||||
|
||||
float LightmapGI::get_denoiser_strength() const {
|
||||
return denoiser_strength;
|
||||
}
|
||||
|
||||
void LightmapGI::set_directional(bool p_enable) {
|
||||
directional = p_enable;
|
||||
}
|
||||
@@ -1482,6 +1491,9 @@ void LightmapGI::_validate_property(PropertyInfo &p_property) const {
|
||||
if (p_property.name == "environment_custom_energy" && environment_mode != ENVIRONMENT_MODE_CUSTOM_COLOR && environment_mode != ENVIRONMENT_MODE_CUSTOM_SKY) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
if (p_property.name == "denoiser_strength" && !use_denoiser) {
|
||||
p_property.usage = PROPERTY_USAGE_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
void LightmapGI::_bind_methods() {
|
||||
@@ -1518,6 +1530,9 @@ void LightmapGI::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("set_use_denoiser", "use_denoiser"), &LightmapGI::set_use_denoiser);
|
||||
ClassDB::bind_method(D_METHOD("is_using_denoiser"), &LightmapGI::is_using_denoiser);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_denoiser_strength", "denoiser_strength"), &LightmapGI::set_denoiser_strength);
|
||||
ClassDB::bind_method(D_METHOD("get_denoiser_strength"), &LightmapGI::get_denoiser_strength);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_interior", "enable"), &LightmapGI::set_interior);
|
||||
ClassDB::bind_method(D_METHOD("is_interior"), &LightmapGI::is_interior);
|
||||
|
||||
@@ -1535,6 +1550,7 @@ void LightmapGI::_bind_methods() {
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "directional"), "set_directional", "is_directional");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "interior"), "set_interior", "is_interior");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "use_denoiser"), "set_use_denoiser", "is_using_denoiser");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "denoiser_strength", PROPERTY_HINT_RANGE, "0.001,0.2,0.001,or_greater"), "set_denoiser_strength", "get_denoiser_strength");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "bias", PROPERTY_HINT_RANGE, "0.00001,0.1,0.00001,or_greater"), "set_bias", "get_bias");
|
||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "max_texture_size", PROPERTY_HINT_RANGE, "2048,16384,1"), "set_max_texture_size", "get_max_texture_size");
|
||||
ADD_GROUP("Environment", "environment_");
|
||||
|
||||
Reference in New Issue
Block a user