diff options
author | Alexander Romanov <a.romanov@blend4web.com> | 2016-01-27 12:06:57 +0300 |
---|---|---|
committer | Alexander Romanov <a.romanov@blend4web.com> | 2016-01-27 12:06:57 +0300 |
commit | 771f73b6bedbdd1c1e2993bd8d3680d53fa67b7c (patch) | |
tree | 1e1593c722640fc00a1755d1acd3a4263ff396b0 /source/blender/blenloader | |
parent | f6ff8f27e35d7b9596bbb2c55c3cf464f6e6ffc0 (diff) |
World textures displaying for viewport in BI.
This patch supports "Image or Movie" and "Environment map" types of world texture for the viewport.
It supports:
- "View", "AngMap" and "Equirectangular" types of mapping.
- Different types of texture blending (according to BI world render).
- Same color blending as when it lacked textures (but render via glsl).
{F207734}
{F207735}
Example: {F275180}
Original author: @valentin_b4w
Regards,
Alexander (Blend4Web Team).
Reviewers: sergey, valentin_b4w, brecht, merwin
Reviewed By: merwin
Subscribers: campbellbarton, merwin, blueprintrandom, youle, a.romanov, yurikovelenov, AlexKowel, Evgeny_Rodygin
Projects: #rendering, #opengl_gfx, #bf_blender:_next
Differential Revision: https://developer.blender.org/D1414
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 8899af1d755..b8470b16e14 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -1565,8 +1565,9 @@ void blo_make_image_pointer_map(FileData *fd, Main *oldmain) for (; ima; ima = ima->id.next) { if (ima->cache) oldnewmap_insert(fd->imamap, ima->cache, ima->cache, 0); - if (ima->gputexture) - oldnewmap_insert(fd->imamap, ima->gputexture, ima->gputexture, 0); + for (a = 0; a < TEXTARGET_COUNT; a++) + if (ima->gputexture[a]) + oldnewmap_insert(fd->imamap, ima->gputexture[a], ima->gputexture[a], 0); if (ima->rr) oldnewmap_insert(fd->imamap, ima->rr, ima->rr, 0); for (a=0; a < IMA_MAX_RENDER_SLOT; a++) @@ -1602,15 +1603,18 @@ void blo_end_image_pointer_map(FileData *fd, Main *oldmain) for (; ima; ima = ima->id.next) { ima->cache = newimaadr(fd, ima->cache); if (ima->cache == NULL) { - ima->bindcode = 0; ima->tpageflag &= ~IMA_GLBIND_IS_DATA; - ima->gputexture = NULL; + for (i = 0; i < TEXTARGET_COUNT; i++) { + ima->bindcode[i] = 0; + ima->gputexture[i] = NULL; + } ima->rr = NULL; } for (i = 0; i < IMA_MAX_RENDER_SLOT; i++) ima->renders[i] = newimaadr(fd, ima->renders[i]); - ima->gputexture = newimaadr(fd, ima->gputexture); + for (i = 0; i < TEXTARGET_COUNT; i++) + ima->gputexture[i] = newimaadr(fd, ima->gputexture[i]); ima->rr = newimaadr(fd, ima->rr); } for (; sce; sce = sce->id.next) { @@ -3644,9 +3648,11 @@ static void direct_link_image(FileData *fd, Image *ima) /* if not restored, we keep the binded opengl index */ if (!ima->cache) { - ima->bindcode = 0; ima->tpageflag &= ~IMA_GLBIND_IS_DATA; - ima->gputexture = NULL; + for (int i = 0; i < TEXTARGET_COUNT; i++) { + ima->bindcode[i] = 0; + ima->gputexture[i] = NULL; + } ima->rr = NULL; } |