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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-06 18:00:28 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-06 18:00:28 +0400
commit7224513f578e3fbc5b10200ea7266054de802da7 (patch)
tree7fe0b58719c7bc715976b3e5f1445780633d735c
parent2a4ee23a2559a3b6b7d443ae706a567092d5da7d (diff)
Fix crash rendering material with "Face Textures" option.
Example file: lib/tests/materials/crystal_cube.blend
-rw-r--r--source/blender/render/intern/source/imagetexture.c4
-rw-r--r--source/blender/render/intern/source/render_texture.c1
2 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c
index 8bb44918fb6..65976668502 100644
--- a/source/blender/render/intern/source/imagetexture.c
+++ b/source/blender/render/intern/source/imagetexture.c
@@ -224,7 +224,7 @@ int imagewrap(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], TexResul
}
/* keep this before interpolation [#29761] */
- if ((tex->imaflag & TEX_USEALPHA) && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) {
+ if ((tex->imaflag & TEX_USEALPHA) && (ima->flag & IMA_IGNORE_ALPHA) == 0) {
if ((tex->imaflag & TEX_CALCALPHA) == 0) {
texres->talpha = TRUE;
}
@@ -1526,7 +1526,7 @@ int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const
/* mipmap test */
image_mipmap_test(tex, ibuf);
- if ((tex->imaflag & TEX_USEALPHA) && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) {
+ if ((tex->imaflag & TEX_USEALPHA) && (ima->flag & IMA_IGNORE_ALPHA) == 0) {
if ((tex->imaflag & TEX_CALCALPHA) == 0) {
texres->talpha = TRUE;
}
diff --git a/source/blender/render/intern/source/render_texture.c b/source/blender/render/intern/source/render_texture.c
index 48a64822aed..837dfb3d8dd 100644
--- a/source/blender/render/intern/source/render_texture.c
+++ b/source/blender/render/intern/source/render_texture.c
@@ -3475,6 +3475,7 @@ void render_realtime_texture(ShadeInput *shi, Image *ima)
tex= &imatex[shi->thread];
tex->iuser.ok= ima->ok;
+ tex->ima = ima;
texvec[0]= 0.5f+0.5f*suv->uv[0];
texvec[1]= 0.5f+0.5f*suv->uv[1];