Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2015-02-10 13:36:55 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-02-10 13:49:22 +0300
commit9d1336b653c1c7a3dd59ab2372bac208e3f0f37d (patch)
treecba6ebfea63615508874469d36cf61e8bf4ec00c
parentb7c1d2e898a67e3adc5c0169fb69886f330c313d (diff)
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
-rw-r--r--source/blender/gpu/CMakeLists.txt2
-rw-r--r--source/blender/gpu/intern/gpu_compositing.c (renamed from source/blender/gpu/intern/gpu_compositing.cpp)5
2 files changed, 2 insertions, 5 deletions
diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt
index a9accfcb6ec..ca11a3c0da0 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
index d13fc92d0d2..a44dab78cde 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 */