diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-02-19 03:44:52 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-02-19 03:57:06 +0300 |
commit | e82827bf6ed54a1d1552ac9176df9e309b4d29e2 (patch) | |
tree | 10b10084cc42f21d77ed7aca8cf0f424bc37c58f /source/blender/makesrna/intern/rna_scene.c | |
parent | 77619f527403608a349b3037d18f71893d4484d1 (diff) |
DRW: New High Quality Normal & Tangent extract
This patch adds a dedicated path to extract 16bit normals instead of packing them into 10bits/comp.
The tangents are also packed to 10bits/comp if not using the new High Quality Normal option.
Fix T61024 Degraded texture shading on dense meshes
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D6614
Diffstat (limited to 'source/blender/makesrna/intern/rna_scene.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 5e5bafdc178..d2a17967de9 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1654,6 +1654,20 @@ static void rna_Scene_world_update(Main *bmain, Scene *scene, PointerRNA *ptr) DEG_relations_tag_update(bmain); } +static void rna_Scene_mesh_quality_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr) +{ + Scene *scene = (Scene *)ptr->owner_id; + + FOREACH_SCENE_OBJECT_BEGIN (scene, ob) { + if (ob->type == OB_MESH) { + DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); + } + } + FOREACH_SCENE_OBJECT_END; + + rna_Scene_glsl_update(bmain, scene, ptr); +} + void rna_Scene_freestyle_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr) { Scene *scene = (Scene *)ptr->owner_id; @@ -5762,6 +5776,14 @@ static void rna_def_scene_render_data(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Additional Subdiv", "Additional subdivision along the hair"); RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update"); + /* Performance */ + prop = RNA_def_property(srna, "use_high_quality_normals", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "perf_flag", SCE_PERF_HQ_NORMALS); + RNA_def_property_ui_text(prop, + "High Quality Normals", + "Use high quality tangent space at the cost of lower performance"); + RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_mesh_quality_update"); + /* border */ prop = RNA_def_property(srna, "use_border", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", R_BORDER); |