forked from bartvdbraak/blender
Fix #20922: image window draw z-buffer wasn't drawing the z-buffer
from the select render layer.
This commit is contained in:
parent
7f2b2929ff
commit
2cc02cdd9b
@ -1943,7 +1943,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
RenderResult rres;
|
RenderResult rres;
|
||||||
float *rectf;
|
float *rectf, *rectz;
|
||||||
unsigned int *rect;
|
unsigned int *rect;
|
||||||
float dither;
|
float dither;
|
||||||
int channels, layer, pass;
|
int channels, layer, pass;
|
||||||
@ -1956,6 +1956,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
|
|||||||
RE_AcquireResultImage(RE_GetRender(iuser->scene->id.name), &rres);
|
RE_AcquireResultImage(RE_GetRender(iuser->scene->id.name), &rres);
|
||||||
rect= (unsigned int *)rres.rect32;
|
rect= (unsigned int *)rres.rect32;
|
||||||
rectf= rres.rectf;
|
rectf= rres.rectf;
|
||||||
|
rectz= rres.rectz;
|
||||||
dither= iuser->scene->r.dither_intensity;
|
dither= iuser->scene->r.dither_intensity;
|
||||||
|
|
||||||
/* get compo/seq result by default */
|
/* get compo/seq result by default */
|
||||||
@ -1963,18 +1964,24 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
|
|||||||
else if(rr->layers.first) {
|
else if(rr->layers.first) {
|
||||||
RenderLayer *rl= BLI_findlink(&rr->layers, layer-(rr->rectf?1:0));
|
RenderLayer *rl= BLI_findlink(&rr->layers, layer-(rr->rectf?1:0));
|
||||||
if(rl) {
|
if(rl) {
|
||||||
|
RenderPass *rpass;
|
||||||
|
|
||||||
/* there's no combined pass, is in renderlayer itself */
|
/* there's no combined pass, is in renderlayer itself */
|
||||||
if(pass==0) {
|
if(pass==0) {
|
||||||
rectf= rl->rectf;
|
rectf= rl->rectf;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
RenderPass *rpass= BLI_findlink(&rl->passes, pass-1);
|
rpass= BLI_findlink(&rl->passes, pass-1);
|
||||||
if(rpass) {
|
if(rpass) {
|
||||||
channels= rpass->channels;
|
channels= rpass->channels;
|
||||||
rectf= rpass->rect;
|
rectf= rpass->rect;
|
||||||
dither= 0.0f; /* don't dither passes */
|
dither= 0.0f; /* don't dither passes */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(rpass= rl->passes.first; rpass; rpass= rpass->next)
|
||||||
|
if(rpass->passtype == SCE_PASS_Z)
|
||||||
|
rectz= rpass->rect;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1997,7 +2004,7 @@ static ImBuf *image_get_render_result(Image *ima, ImageUser *iuser, void **lock_
|
|||||||
ibuf->rect_float= rectf;
|
ibuf->rect_float= rectf;
|
||||||
ibuf->flags |= IB_rectfloat;
|
ibuf->flags |= IB_rectfloat;
|
||||||
ibuf->channels= channels;
|
ibuf->channels= channels;
|
||||||
ibuf->zbuf_float= rres.rectz;
|
ibuf->zbuf_float= rectz;
|
||||||
ibuf->flags |= IB_zbuffloat;
|
ibuf->flags |= IB_zbuffloat;
|
||||||
ibuf->dither= dither;
|
ibuf->dither= dither;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user