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:
authorJeroen Bakker <j.bakker@atmind.nl>2012-10-23 11:20:37 +0400
committerJeroen Bakker <j.bakker@atmind.nl>2012-10-23 11:20:37 +0400
commit0c1b6ac3b30a5fc85e238cd9ab2f5e93d84c8dd2 (patch)
tree82b054523dfe0533b8889b3449115508ea70b64c /source/blender/render
parent13940cc78ece7b592a323123f31669034d73a833 (diff)
Fix for [#28927] Z-Transp disables Material Pass Index
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/source/zbuf.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c
index 4d91a7d9d11..a9a6a90f834 100644
--- a/source/blender/render/intern/source/zbuf.c
+++ b/source/blender/render/intern/source/zbuf.c
@@ -3517,7 +3517,7 @@ static void add_transp_obindex(RenderLayer *rl, int offset, Object *ob)
RenderPass *rpass;
for (rpass= rl->passes.first; rpass; rpass= rpass->next) {
- if (rpass->passtype == SCE_PASS_INDEXOB||rpass->passtype == SCE_PASS_INDEXMA) {
+ if (rpass->passtype == SCE_PASS_INDEXOB) {
float *fp= rpass->rect + offset;
*fp= (float)ob->index;
break;
@@ -3525,6 +3525,19 @@ static void add_transp_obindex(RenderLayer *rl, int offset, Object *ob)
}
}
+static void add_transp_material_index(RenderLayer *rl, int offset, Material *mat)
+{
+ RenderPass *rpass;
+
+ for (rpass= rl->passes.first; rpass; rpass= rpass->next) {
+ if (rpass->passtype == SCE_PASS_INDEXMA) {
+ float *fp= rpass->rect + offset;
+ *fp= (float)mat->index;
+ break;
+ }
+ }
+}
+
/* ONLY OSA! merge all shaderesult samples to one */
/* target should have been cleared */
static void merge_transp_passes(RenderLayer *rl, ShadeResult *shr)
@@ -4129,10 +4142,12 @@ unsigned short *zbuffer_transp_shade(RenderPart *pa, RenderLayer *rl, float *pas
}
}
if (addpassflag & SCE_PASS_INDEXMA) {
- ObjectRen *obr= R.objectinstance[zrow[totface-1].obi].obr;
- if (obr->ob) {
+ ObjectRen *obr = R.objectinstance[zrow[totface-1].obi].obr;
+ VlakRen *vr = obr->vlaknodes->vlak;
+ Material *mat = vr->mat;
+ if (mat) {
for (a= 0; a<totfullsample; a++)
- add_transp_obindex(rlpp[a], od, obr->ob);
+ add_transp_material_index(rlpp[a], od, mat);
}
}