[Bf-blender-cvs] [9d1336b] viewport_experiments: Framebuffer effects:

Antony Riakiotakis noreply at git.blender.org
Thu Feb 12 16:40:15 CET 2015


Commit: 9d1336b653c1c7a3dd59ab2372bac208e3f0f37d
Author: Antony Riakiotakis
Date:   Tue Feb 10 11:36:55 2015 +0100
Branches: viewport_experiments
https://developer.blender.org/rB9d1336b653c1c7a3dd59ab2372bac208e3f0f37d

Framebuffer effects:

This includes offscreen processing for the 3D viewport and OpenGL rendering.

Included effects are a depth of field shader and a Screen Space Ambient
Occlusion shader.

The system is simplistic and duplicates some code. I am in the process of making abstractions
so the effects can be used in a node system, but we can probably give users
access to the early system right now.

Reviewers: sergey, campbellbarton, jwilkins, merwin

Differential Revision: https://developer.blender.org/D1092

===================================================================

M	source/blender/gpu/CMakeLists.txt
A	source/blender/gpu/intern/gpu_compositing.c
D	source/blender/gpu/intern/gpu_compositing.cpp

===================================================================

diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt
index a9accfc..ca11a3c 100644
--- a/source/blender/gpu/CMakeLists.txt
+++ b/source/blender/gpu/CMakeLists.txt
@@ -54,7 +54,7 @@ set(SRC
 	intern/gpu_material.c
 	intern/gpu_simple_shader.c
 	intern/gpu_select.c
-	intern/gpu_compositing.cpp
+	intern/gpu_compositing.c
 	intern/gpu_renderer.c
 
 	shaders/gpu_shader_fx_lib.glsl
diff --git a/source/blender/gpu/intern/gpu_compositing.cpp b/source/blender/gpu/intern/gpu_compositing.c
similarity index 99%
rename from source/blender/gpu/intern/gpu_compositing.cpp
rename to source/blender/gpu/intern/gpu_compositing.c
index d13fc92..a44dab7 100644
--- a/source/blender/gpu/intern/gpu_compositing.cpp
+++ b/source/blender/gpu/intern/gpu_compositing.c
@@ -37,9 +37,7 @@
 #include "BLI_listbase.h"
 #include "BLI_linklist.h"
 
-extern "C" {
 #include "BLI_rand.h"
-}
 #include "BLI_listbase.h"
 
 #include "DNA_vec_types.h"
@@ -576,6 +574,7 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
 	/* second pass, dof */
 	if (fx->effects & GPU_FX_DEPTH_OF_FIELD) {
 		GPUDOFOptions *options = fx->options.dof_options;
+		GPUShader *dof_shader_pass1, *dof_shader_pass2, *dof_shader_pass3, *dof_shader_pass4, *dof_shader_pass5;
 		float dof_params[4];
 		float scale = scene->unit.system ? scene->unit.scale_length : 1.0f;
 		float scale_camera = 0.001f / scale;
@@ -586,8 +585,6 @@ bool GPU_fx_do_composite_pass(GPUFX *fx, float projmat[4][4], bool is_persp, str
 		dof_params[2] = fx->gbuffer_dim[0] / (scale_camera * options->dof_sensor);
 		dof_params[3] = 0.0f;
 
-		GPUShader *dof_shader_pass1, *dof_shader_pass2, *dof_shader_pass3, *dof_shader_pass4, *dof_shader_pass5;
-
 		/* DOF effect has many passes but most of them are performed on a texture whose dimensions are 4 times less than the original
 			 * (16 times lower than original screen resolution). Technique used is not very exact but should be fast enough and is based
 			 * on "Practical Post-Process Depth of Field" see http://http.developer.nvidia.com/GPUGems3/gpugems3_ch28.html */




More information about the Bf-blender-cvs mailing list