[Bf-blender-cvs] [4ca9457] viewport_experiments: cleanup diffusion dof names and add blade count (will possibly be used in high quality)
Antony Riakiotakis
noreply at git.blender.org
Fri Jan 2 13:47:22 CET 2015
Commit: 4ca945778f9e23fd1957201ce987c3a3d11489b1
Author: Antony Riakiotakis
Date: Tue Dec 23 14:02:46 2014 +0100
Branches: viewport_experiments
https://developer.blender.org/rB4ca945778f9e23fd1957201ce987c3a3d11489b1
cleanup diffusion dof names and add blade count (will possibly be used in high quality)
===================================================================
M release/scripts/startup/bl_ui/properties_data_camera.py
M release/scripts/startup/bl_ui/space_view3d.py
M source/blender/gpu/intern/gpu_compositing.c
M source/blender/makesdna/DNA_gpu_types.h
M source/blender/makesrna/intern/rna_scene.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_data_camera.py b/release/scripts/startup/bl_ui/properties_data_camera.py
index c864f84..ddbcbc6 100644
--- a/release/scripts/startup/bl_ui/properties_data_camera.py
+++ b/release/scripts/startup/bl_ui/properties_data_camera.py
@@ -191,6 +191,8 @@ class DATA_PT_camera_gpu_dof(Panel):
col.prop(dof_options, "dof_focal_length")
col.prop(dof_options, "dof_sensor")
col.prop(dof_options, "dof_quality_mode")
+ if dof_options.dof_quality_mode == 'HIGH':
+ col.prop(dof_options, "dof_num_blades")
@classmethod
def poll(cls, context):
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 23baf78..5aa7ca0 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -2928,6 +2928,9 @@ class VIEW3D_PT_view3d_shading(Panel):
subcol.prop(dof_options, "dof_focal_length")
subcol.prop(dof_options, "dof_sensor")
subcol.prop(dof_options, "dof_quality_mode")
+ if dof_options.dof_quality_mode == 'HIGH':
+ subcol.prop(dof_options, "dof_num_blades")
+
col.prop(view, "ssao")
if view.ssao:
ssao_options = fxoptions.ssao_options
diff --git a/source/blender/gpu/intern/gpu_compositing.c b/source/blender/gpu/intern/gpu_compositing.c
index 2563579..f6464d0 100644
--- a/source/blender/gpu/intern/gpu_compositing.c
+++ b/source/blender/gpu/intern/gpu_compositing.c
@@ -78,10 +78,9 @@ struct GPUFX {
/* final near coc buffer. */
GPUTexture *dof_near_coc_final_buffer;
- /* diffusion depth of field */
- int num_diff_buffers;
- GPUTexture **dof_diffusion_buffers;
-
+ /* high quality dof texture downsamplers. 5 levels means 32 pixels wide */
+ GPUTexture *dof_nearfar_coc[5];
+
/* texture bound to the depth attachment of the gbuffer */
GPUTexture *depth_buffer;
@@ -126,17 +125,6 @@ static void cleanup_fx_dof_buffers(GPUFX *fx)
GPU_texture_free(fx->dof_near_coc_final_buffer);
fx->dof_near_coc_final_buffer = NULL;
}
-
- if (fx->dof_diffusion_buffers) {
- int i;
-
- for (i = 0; i < fx->num_diff_buffers; i++) {
- GPU_texture_free(fx->dof_diffusion_buffers[i]);
- MEM_freeN(fx->dof_diffusion_buffers);
- fx->dof_diffusion_buffers = NULL;
- fx->num_diff_buffers = 0;
- }
- }
}
static void cleanup_fx_gl_data(GPUFX *fx, bool do_fbo)
@@ -287,7 +275,10 @@ bool GPU_initialize_fx_passes(GPUFX *fx, rcti *rect, rcti *scissor_rect, int fxf
/* create textures for dof effect */
if (fxflags & GPU_FX_DEPTH_OF_FIELD) {
if (options->dof_options->dof_quality_mode == DOF_QUALITY_HIGH) {
- /* we need to generate a pyramid of images that will be operated */
+ /* we use a different scheme here */
+ if (!fx->dof_near_coc_buffer || !fx->dof_near_coc_blurred_buffer || !fx->dof_near_coc_final_buffer) {
+
+ }
}
else {
if (!fx->dof_near_coc_buffer || !fx->dof_near_coc_blurred_buffer || !fx->dof_near_coc_final_buffer) {
diff --git a/source/blender/makesdna/DNA_gpu_types.h b/source/blender/makesdna/DNA_gpu_types.h
index 58ad11f..7f1b86b 100644
--- a/source/blender/makesdna/DNA_gpu_types.h
+++ b/source/blender/makesdna/DNA_gpu_types.h
@@ -50,7 +50,7 @@ typedef struct GPUDOFOptions {
float dof_focal_length;
float dof_sensor;
int dof_quality_mode;
- int pad;
+ int dof_num_blades;
} GPUDOFOptions;
/* properties for SSAO effect */
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index b2ce1b3..8b263a3 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -3842,8 +3842,8 @@ static void rna_def_gpu_dof_fx(BlenderRNA *brna)
PropertyRNA *prop;
static EnumPropertyItem dof_quality_items[] = {
- {DOF_QUALITY_NORMAL, "NORMAL", 0, "Normal", "Use standard blurring depth of field"},
- {DOF_QUALITY_HIGH, "HIGH", 0, "High", "Use diffusion solver depth of field"},
+ {DOF_QUALITY_NORMAL, "NORMAL", 0, "Normal", "Use normal quality depth of field"},
+ {DOF_QUALITY_HIGH, "HIGH", 0, "High", "Use high quality blurring depth of field"},
{0, NULL, 0, NULL, NULL}
};
@@ -3880,6 +3880,11 @@ static void rna_def_gpu_dof_fx(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Quality", "Quality of the dof effect");
RNA_def_property_enum_items(prop, dof_quality_items);
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
+
+ prop = RNA_def_property(srna, "dof_num_blades", PROP_INT, PROP_NONE);
+ RNA_def_property_ui_text(prop, "Blades", "Number of blades in camera");
+ RNA_def_property_range(prop, 5, 8);
+ RNA_def_property_update(prop, NC_SPACE | ND_SPACE_VIEW3D, NULL);
}
static void rna_def_gpu_ssao_fx(BlenderRNA *brna)
More information about the Bf-blender-cvs
mailing list