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/gameengine | |
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/gameengine')
-rw-r--r-- | source/gameengine/Ketsji/BL_Texture.cpp | 2 | ||||
-rw-r--r-- | source/gameengine/VideoTexture/Texture.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/source/gameengine/Ketsji/BL_Texture.cpp b/source/gameengine/Ketsji/BL_Texture.cpp index 0b0a0f5d403..730e49c4918 100644 --- a/source/gameengine/Ketsji/BL_Texture.cpp +++ b/source/gameengine/Ketsji/BL_Texture.cpp @@ -138,7 +138,7 @@ bool BL_Texture::InitFromImage(int unit, Image *img, bool mipmap) mipmap = mipmap && GPU_get_mipmap(); - mTexture = img->bindcode; + mTexture = img->bindcode[TEXTARGET_TEXTURE_2D]; mType = GL_TEXTURE_2D; mUnit = unit; diff --git a/source/gameengine/VideoTexture/Texture.cpp b/source/gameengine/VideoTexture/Texture.cpp index cc010f08b17..f1c7bc303ee 100644 --- a/source/gameengine/VideoTexture/Texture.cpp +++ b/source/gameengine/VideoTexture/Texture.cpp @@ -299,7 +299,7 @@ PyObject *Texture_close(Texture * self) self->m_matTexture->swapTexture(self->m_orgTex); else { - self->m_imgTexture->bindcode = self->m_orgTex; + self->m_imgTexture->bindcode[TEXTARGET_TEXTURE_2D] = self->m_orgTex; BKE_image_release_ibuf(self->m_imgTexture, self->m_imgBuf, NULL); self->m_imgBuf = NULL; } @@ -357,8 +357,8 @@ static PyObject *Texture_refresh(Texture *self, PyObject *args) // WARNING: GPU has a ImageUser to pass, we don't. Using NULL // works on image file, not necessarily on other type of image. self->m_imgBuf = BKE_image_acquire_ibuf(self->m_imgTexture, NULL, NULL); - self->m_orgTex = self->m_imgTexture->bindcode; - self->m_imgTexture->bindcode = self->m_actTex; + self->m_orgTex = self->m_imgTexture->bindcode[TEXTARGET_TEXTURE_2D]; + self->m_imgTexture->bindcode[TEXTARGET_TEXTURE_2D] = self->m_actTex; } } |