diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2016-10-21 23:50:00 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2016-10-21 23:51:12 +0300 |
commit | 5ff586610a47aa26ed388270c9a26487c553f1f1 (patch) | |
tree | c152a29097278e1e52c29678eefc4dbff136e8d6 /source/blender/makesrna/intern | |
parent | deb77c0e7490ed300a7688bf462de85f36ee1ca3 (diff) |
Viewport: use depth shader to debug the depth
At the moment this already shows that the depth is the same after the solid plates and in the very end of drawing, while they should be different. Later on we can adapt this to show different buffers we want to debug.
I am using near=0.1, far=2.0 for my tests. I decided not to make a doversion for near/far because this is for debugging only
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index feec66ee3ed..a1e1c804873 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -2777,6 +2777,30 @@ static void rna_def_space_view3d(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Modern Viewport", "Use modern viewport"); RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + prop = RNA_def_property(srna, "show_scene_depth", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "tmp_compat_flag", V3D_DEBUG_SHOW_SCENE_DEPTH); + RNA_def_property_ui_text(prop, "Show Scene Depth", "Debug option to show the depth in the viewport"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + + prop = RNA_def_property(srna, "show_combined_depth", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "tmp_compat_flag", V3D_DEBUG_SHOW_COMBINED_DEPTH); + RNA_def_property_ui_text(prop, "Show Combined Depth", "Debug option to show the depth in the viewport"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + + prop = RNA_def_property(srna, "debug_near", PROP_FLOAT, PROP_DISTANCE); + RNA_def_property_float_sdna(prop, NULL, "debug.znear"); + RNA_def_property_ui_text(prop, "Near", "Near distance for depth debugging"); + RNA_def_property_range(prop, 1e-6f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + + prop = RNA_def_property(srna, "debug_far", PROP_FLOAT, PROP_DISTANCE); + RNA_def_property_float_sdna(prop, NULL, "debug.zfar"); + RNA_def_property_range(prop, 1e-6f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.001f, FLT_MAX, 10, 3); + RNA_def_property_ui_text(prop, "Far", "Far distance for depth debugging"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL); + /* *** Animated *** */ RNA_define_animate_sdna(true); /* region */ |