diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-02-12 20:54:41 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-02-12 20:54:41 +0300 |
commit | 5e613198e59124986ab3e4bdb8829f77e2284450 (patch) | |
tree | 6659b06236acf73a8c687ea15867a83f1c63983c /source/blender/blenkernel/intern/screen.c | |
parent | d40ac45610edef50885ce73034f7c035f48cc9c1 (diff) |
Viewport compositing - first code
This commit introduces a few ready made effects for the 3D viewport
and OpenGL rendering.
Included effects are Depth of Field, accessible from camera view
and screen space ambient occlusion. Those effects can be turned on and
tweaked from the shading panel in the 3D viewport.
Off screen rendering will use the settings of the current camera.
WIP documentation can be found here:
http://wiki.blender.org/index.php/User:Psy-Fi/Framebuffer_Post-processing
Diffstat (limited to 'source/blender/blenkernel/intern/screen.c')
-rw-r--r-- | source/blender/blenkernel/intern/screen.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c index c9dba38b713..a6ac4551f4a 100644 --- a/source/blender/blenkernel/intern/screen.c +++ b/source/blender/blenkernel/intern/screen.c @@ -39,6 +39,8 @@ #include "MEM_guardedalloc.h" +#include "GPU_compositing.h" + #include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "DNA_space_types.h" @@ -598,3 +600,26 @@ float BKE_screen_view3d_zoom_from_fac(float zoomfac) { return ((sqrtf(4.0f * zoomfac) - (float)M_SQRT2) * 50.0f); } + +void BKE_screen_gpu_fx_validate(GPUFXSettings *fx_settings) +{ + /* currently we use DOF from the camera _only_, + * so we never allocate this, only copy from the Camera */ +#if 0 + if ((fx_settings->dof == NULL) && + (fx_settings->fx_flag & GPU_FX_FLAG_DOF)) + { + GPUDOFSettings *fx_dof; + fx_dof = fx_settings->dof = MEM_callocN(sizeof(GPUDOFSettings), __func__); + } +#endif + + if ((fx_settings->ssao == NULL) && + (fx_settings->fx_flag & GPU_FX_FLAG_SSAO)) + { + GPUSSAOSettings *fx_ssao; + fx_ssao = fx_settings->ssao = MEM_callocN(sizeof(GPUSSAOSettings), __func__); + + GPU_fx_compositor_init_ssao_settings(fx_ssao); + } +} |