forked from bartvdbraak/blender
Bugfix #17929
Old bug (2.42): when using node material, transparent shadow did not work. It was missing to set the proper 'pass flag'. Do note an important difference with non-node materials for 'transparent shadow'. If there are no nodes, it uses the color from the unshaded material. When it has nodes, it uses the color output from the entire node tree, which is typically from shaded materials. The latter is because node shaders have no support for shade passes yet (it only outputs rgb + a).
This commit is contained in:
parent
56b8ce2ec1
commit
03a0770df5
@ -262,13 +262,14 @@ static void shade_ray(Isect *is, ShadeInput *shi, ShadeResult *shr)
|
|||||||
|
|
||||||
shade_input_set_shade_texco(shi);
|
shade_input_set_shade_texco(shi);
|
||||||
|
|
||||||
if(is->mode==RE_RAY_SHADOW_TRA)
|
if(is->mode==RE_RAY_SHADOW_TRA) {
|
||||||
if(shi->mat->nodetree && shi->mat->use_nodes) {
|
if(shi->mat->nodetree && shi->mat->use_nodes) {
|
||||||
ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
|
ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
|
||||||
shi->mat= vlr->mat; /* shi->mat is being set in nodetree */
|
shi->mat= vlr->mat; /* shi->mat is being set in nodetree */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
shade_color(shi, shr);
|
shade_color(shi, shr);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
if(shi->mat->nodetree && shi->mat->use_nodes) {
|
if(shi->mat->nodetree && shi->mat->use_nodes) {
|
||||||
ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
|
ntreeShaderExecTree(shi->mat->nodetree, shi, shr);
|
||||||
@ -1292,15 +1293,8 @@ static void ray_trace_shadow_tra(Isect *is, int thread, int depth, int traflag)
|
|||||||
shi.depth= 1; /* only used to indicate tracing */
|
shi.depth= 1; /* only used to indicate tracing */
|
||||||
shi.mask= 1;
|
shi.mask= 1;
|
||||||
shi.thread= thread;
|
shi.thread= thread;
|
||||||
|
shi.passflag= SCE_PASS_COMBINED;
|
||||||
/*shi.osatex= 0;
|
shi.combinedflag= 0xFFFFFF; /* ray trace does all options */
|
||||||
shi.thread= shi.sample= 0;
|
|
||||||
shi.lay= 0;
|
|
||||||
shi.passflag= 0;
|
|
||||||
shi.combinedflag= 0;
|
|
||||||
shi.do_preview= 0;
|
|
||||||
shi.light_override= NULL;
|
|
||||||
shi.mat_override= NULL;*/
|
|
||||||
|
|
||||||
shade_ray(is, &shi, &shr);
|
shade_ray(is, &shi, &shr);
|
||||||
if (traflag & RAY_TRA)
|
if (traflag & RAY_TRA)
|
||||||
|
Loading…
Reference in New Issue
Block a user