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-12 20:54:41 +0300
committerAntony Riakiotakis <kalast@gmail.com>2015-02-12 20:54:41 +0300
commit5e613198e59124986ab3e4bdb8829f77e2284450 (patch)
tree6659b06236acf73a8c687ea15867a83f1c63983c /source/blender/blenloader
parentd40ac45610edef50885ce73034f7c035f48cc9c1 (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/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c8
-rw-r--r--source/blender/blenloader/intern/versioning_270.c11
-rw-r--r--source/blender/blenloader/intern/writefile.c5
3 files changed, 23 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 66fbca395a8..204a7af69ef 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6421,6 +6421,7 @@ static void direct_link_region(FileData *fd, ARegion *ar, int spacetype)
rv3d->render_engine = NULL;
rv3d->sms = NULL;
rv3d->smooth_timer = NULL;
+ rv3d->compositor = NULL;
}
}
}
@@ -6528,7 +6529,7 @@ static bool direct_link_screen(FileData *fd, bScreen *sc)
/* add local view3d too */
else if (sa->spacetype == SPACE_VIEW3D)
blo_do_versions_view3d_split_250(sa->spacedata.first, &sa->regionbase);
-
+
/* incase we set above */
sa->butspacetype = sa->spacetype;
@@ -6575,6 +6576,11 @@ static bool direct_link_screen(FileData *fd, bScreen *sc)
/* render can be quite heavy, set to solid on load */
if (v3d->drawtype == OB_RENDER)
v3d->drawtype = OB_SOLID;
+
+ if (v3d->fx_settings.dof)
+ v3d->fx_settings.dof = newdataadr(fd, v3d->fx_settings.dof);
+ if (v3d->fx_settings.ssao)
+ v3d->fx_settings.ssao = newdataadr(fd, v3d->fx_settings.ssao);
blo_do_versions_view3d_split_250(v3d, &sl->regionbase);
}
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 572566df6a2..23bf291b981 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -35,6 +35,7 @@
#define DNA_DEPRECATED_ALLOW
#include "DNA_brush_types.h"
+#include "DNA_camera_types.h"
#include "DNA_cloth_types.h"
#include "DNA_constraint_types.h"
#include "DNA_sdna_types.h"
@@ -562,6 +563,16 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
}
FOREACH_NODETREE_END
}
+
+ if (!DNA_struct_elem_find(fd->filesdna, "Camera", "GPUDOFSettings", "gpu_dof")) {
+ Camera *ca;
+ for (ca = main->camera.first; ca; ca = ca->id.next) {
+ ca->gpu_dof.fstop = 128.0f;
+ ca->gpu_dof.focal_length = 1.0f;
+ ca->gpu_dof.focus_distance = 1.0f;
+ ca->gpu_dof.sensor = 1.0f;
+ }
+ }
}
if (!MAIN_VERSION_ATLEAST(main, 273, 7)) {
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 6031400684c..308ab448fcd 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2682,6 +2682,11 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
for (bgpic= v3d->bgpicbase.first; bgpic; bgpic= bgpic->next)
writestruct(wd, DATA, "BGpic", 1, bgpic);
if (v3d->localvd) writestruct(wd, DATA, "View3D", 1, v3d->localvd);
+
+ if (v3d->fx_settings.ssao)
+ writestruct(wd, DATA, "GPUSSAOSettings", 1, v3d->fx_settings.ssao);
+ if (v3d->fx_settings.dof)
+ writestruct(wd, DATA, "GPUDOFSettings", 1, v3d->fx_settings.dof);
}
else if (sl->spacetype==SPACE_IPO) {
SpaceIpo *sipo= (SpaceIpo *)sl;