From a1dfd51fae3ff999cbf71feb94ab2068a98bb406 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 6 Nov 2024 10:49:58 +1100 Subject: [PATCH] Cleanup: rename SceneEEVEE::gtao_quality -> fast_gi_quality Avoid confusion from misleading/incorrect names, see: #129830. --- source/blender/blenloader/intern/versioning_280.cc | 4 ++-- .../draw/engines/eevee_next/eevee_ambient_occlusion.cc | 4 ++-- source/blender/makesdna/DNA_scene_defaults.h | 2 +- source/blender/makesdna/DNA_scene_types.h | 2 +- source/blender/makesdna/intern/dna_rename_defs.h | 1 + source/blender/makesrna/intern/rna_scene.cc | 4 +++- 6 files changed, 10 insertions(+), 7 deletions(-) diff --git a/source/blender/blenloader/intern/versioning_280.cc b/source/blender/blenloader/intern/versioning_280.cc index 03c0732e0f8..f55c58ba4f4 100644 --- a/source/blender/blenloader/intern/versioning_280.cc +++ b/source/blender/blenloader/intern/versioning_280.cc @@ -3441,7 +3441,7 @@ void blo_do_versions_280(FileData *fd, Library * /*lib*/, Main *bmain) scene->eevee.volumetric_shadow_samples = 16; scene->eevee.gtao_distance = 0.2f; - scene->eevee.gtao_quality = 0.25f; + scene->eevee.fast_gi_quality = 0.25f; scene->eevee.bokeh_max_size = 100.0f; scene->eevee.bokeh_threshold = 1.0f; @@ -3550,7 +3550,7 @@ void blo_do_versions_280(FileData *fd, Library * /*lib*/, Main *bmain) // EEVEE_GET_FLOAT(props, gtao_distance); // EEVEE_GET_FLOAT(props, gtao_factor); - EEVEE_GET_FLOAT(props, gtao_quality); + EEVEE_GET_FLOAT(props, fast_gi_quality); EEVEE_GET_FLOAT(props, bokeh_max_size); EEVEE_GET_FLOAT(props, bokeh_threshold); diff --git a/source/blender/draw/engines/eevee_next/eevee_ambient_occlusion.cc b/source/blender/draw/engines/eevee_next/eevee_ambient_occlusion.cc index 2fb2646f6f1..da292ac5ca2 100644 --- a/source/blender/draw/engines/eevee_next/eevee_ambient_occlusion.cc +++ b/source/blender/draw/engines/eevee_next/eevee_ambient_occlusion.cc @@ -43,9 +43,9 @@ void AmbientOcclusion::init() data_.distance = sce_eevee.gtao_distance; data_.gi_distance = (sce_eevee.fast_gi_distance > 0.0f) ? sce_eevee.fast_gi_distance : 1e16f; /* AO node uses its own number of samples. */ - data_.lod_factor_ao = 1.0f / (1.0f + sce_eevee.gtao_quality * 4.0f); + data_.lod_factor_ao = 1.0f / (1.0f + sce_eevee.fast_gi_quality * 4.0f); data_.lod_factor = (4.0f / sce_eevee.fast_gi_step_count) / - (1.0f + sce_eevee.gtao_quality * 4.0f); + (1.0f + sce_eevee.fast_gi_quality * 4.0f); data_.angle_bias = 1.0 / max_ff(1e-8f, 1.0 - sce_eevee.gtao_focus); data_.thickness_near = sce_eevee.fast_gi_thickness_near; data_.thickness_far = sce_eevee.fast_gi_thickness_far; diff --git a/source/blender/makesdna/DNA_scene_defaults.h b/source/blender/makesdna/DNA_scene_defaults.h index cdf476ba0ba..34febee01ab 100644 --- a/source/blender/makesdna/DNA_scene_defaults.h +++ b/source/blender/makesdna/DNA_scene_defaults.h @@ -195,13 +195,13 @@ .volumetric_shadow_samples = 16, \ \ .gtao_distance = 0.2f, \ - .gtao_quality = 0.25f, \ .gtao_thickness = 0.5f, \ .gtao_focus = 0.05f, \ .gtao_resolution = 2, \ \ .fast_gi_step_count = 8, \ .fast_gi_ray_count = 2, \ + .fast_gi_quality = 0.25f, \ .fast_gi_distance = 0.0f, \ .fast_gi_thickness_near = 0.25f, \ .fast_gi_thickness_far = DEG2RAD(45), \ diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index ffe43e18c87..e53ce4f7371 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1903,13 +1903,13 @@ typedef struct SceneEEVEE { int volumetric_ray_depth; float gtao_distance; - float gtao_quality; float gtao_thickness; float gtao_focus; int gtao_resolution; int fast_gi_step_count; int fast_gi_ray_count; + float fast_gi_quality; float fast_gi_distance; float fast_gi_thickness_near; float fast_gi_thickness_far; diff --git a/source/blender/makesdna/intern/dna_rename_defs.h b/source/blender/makesdna/intern/dna_rename_defs.h index e72f3fa361a..d542459a273 100644 --- a/source/blender/makesdna/intern/dna_rename_defs.h +++ b/source/blender/makesdna/intern/dna_rename_defs.h @@ -175,6 +175,7 @@ DNA_STRUCT_RENAME_MEMBER(RenderData, blurfac, motion_blur_shutter) DNA_STRUCT_RENAME_MEMBER(RigidBodyWorld, steps_per_second, substeps_per_frame) DNA_STRUCT_RENAME_MEMBER(SDefBind, numverts, verts_num) DNA_STRUCT_RENAME_MEMBER(SDefVert, numbinds, binds_num) +DNA_STRUCT_RENAME_MEMBER(SceneEEVEE, gtao_quality, fast_gi_quality) DNA_STRUCT_RENAME_MEMBER(SceneEEVEE, motion_blur_position, motion_blur_position_deprecated) DNA_STRUCT_RENAME_MEMBER(SceneEEVEE, motion_blur_shutter, motion_blur_shutter_deprecated) DNA_STRUCT_RENAME_MEMBER(SceneEEVEE, shadow_cube_size, shadow_cube_size_deprecated) diff --git a/source/blender/makesrna/intern/rna_scene.cc b/source/blender/makesrna/intern/rna_scene.cc index d3ae2391d08..a191f12016c 100644 --- a/source/blender/makesrna/intern/rna_scene.cc +++ b/source/blender/makesrna/intern/rna_scene.cc @@ -8128,7 +8128,10 @@ static void rna_def_scene_eevee(BlenderRNA *brna) RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, nullptr); + /* TODO: remove this, kept for EEVEE 4.2 compatibility, + * this is a duplicate of "fast_gi_quality"). */ prop = RNA_def_property(srna, "gtao_quality", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, nullptr, "fast_gi_quality"); RNA_def_property_ui_text(prop, "Trace Precision", "Precision of the horizon search"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY); @@ -8175,7 +8178,6 @@ static void rna_def_scene_eevee(BlenderRNA *brna) RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, nullptr); prop = RNA_def_property(srna, "fast_gi_quality", PROP_FLOAT, PROP_FACTOR); - RNA_def_property_float_sdna(prop, nullptr, "gtao_quality"); RNA_def_property_ui_text(prop, "Trace Precision", "Precision of the fast GI ray marching"); RNA_def_property_range(prop, 0.0f, 1.0f); RNA_def_property_override_flag(prop, PROPOVERRIDE_OVERRIDABLE_LIBRARY);