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:
authorClément Foucault <foucault.clem@gmail.com>2020-03-11 19:12:01 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-03-11 19:12:16 +0300
commit7dd0be9554ae7a728ded1a95d4709a93b68301b4 (patch)
tree52a097fd8edd1128def41fcda6bed64e8c6b39b7 /source/blender/blenloader/intern
parentc476c36e400883d929a7149def8dcb6ad6157a86 (diff)
EEVEE: Replace octahedron reflection probe by cubemap array
We implement cubemap array support for EEVEE's lightcache reflection probes. This removes stretched texels and bottom hemisphere seams artifacts caused by the octahedral projection previously used. This introduce versioning code for the lightcache which will discard any lightcache version that is not compatible. Differential Revision: https://developer.blender.org/D7066
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r--source/blender/blenloader/intern/readfile.c19
-rw-r--r--source/blender/blenloader/intern/writefile.c6
2 files changed, 14 insertions, 11 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index f73dc9a5466..49b51c34562 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -157,6 +157,8 @@
#include "RE_engine.h"
+#include "engines/eevee/eevee_lightcache.h"
+
#include "readfile.h"
#include <errno.h>
@@ -1852,8 +1854,8 @@ void blo_make_scene_pointer_map(FileData *fd, Main *oldmain)
fd->scenemap = oldnewmap_new();
for (; sce; sce = sce->id.next) {
- if (sce->eevee.light_cache) {
- struct LightCache *light_cache = sce->eevee.light_cache;
+ if (sce->eevee.light_cache_data) {
+ struct LightCache *light_cache = sce->eevee.light_cache_data;
oldnewmap_insert(fd->scenemap, light_cache, light_cache, 0);
}
}
@@ -1873,7 +1875,7 @@ void blo_end_scene_pointer_map(FileData *fd, Main *oldmain)
}
for (; sce; sce = sce->id.next) {
- sce->eevee.light_cache = newsceadr(fd, sce->eevee.light_cache);
+ sce->eevee.light_cache_data = newsceadr(fd, sce->eevee.light_cache_data);
}
}
@@ -6927,19 +6929,20 @@ static void direct_link_scene(FileData *fd, Scene *sce)
if (fd->memfile) {
/* If it's undo try to recover the cache. */
if (fd->scenemap) {
- sce->eevee.light_cache = newsceadr(fd, sce->eevee.light_cache);
+ sce->eevee.light_cache_data = newsceadr(fd, sce->eevee.light_cache_data);
}
else {
- sce->eevee.light_cache = NULL;
+ sce->eevee.light_cache_data = NULL;
}
}
else {
/* else try to read the cache from file. */
- sce->eevee.light_cache = newdataadr(fd, sce->eevee.light_cache);
- if (sce->eevee.light_cache) {
- direct_link_lightcache(fd, sce->eevee.light_cache);
+ sce->eevee.light_cache_data = newdataadr(fd, sce->eevee.light_cache_data);
+ if (sce->eevee.light_cache_data) {
+ direct_link_lightcache(fd, sce->eevee.light_cache_data);
}
}
+ EEVEE_lightcache_info_update(&sce->eevee);
direct_link_view3dshading(fd, &sce->display.shading);
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 81df00ebdef..a9c5008062b 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -2767,9 +2767,9 @@ static void write_scene(WriteData *wd, Scene *sce)
}
/* Eevee Lightcache */
- if (sce->eevee.light_cache && !wd->use_memfile) {
- writestruct(wd, DATA, LightCache, 1, sce->eevee.light_cache);
- write_lightcache(wd, sce->eevee.light_cache);
+ if (sce->eevee.light_cache_data && !wd->use_memfile) {
+ writestruct(wd, DATA, LightCache, 1, sce->eevee.light_cache_data);
+ write_lightcache(wd, sce->eevee.light_cache_data);
}
write_view3dshading(wd, &sce->display.shading);