Fix light texture invisible when looking at a light
`sd->type` was set to `PRIMITIVE_TRIANGLE` when it should be `PRIMITIVE_LAMP`. Function #lights_intersect_impl sets `isect->prim` to `lamp`, which is passed to function #shader_setup_from_sample. There `prim != PRIM_NONE` is evaluated to `true`, thus setting `sd->type` to `PRIMITIVE_TRIANGLE` erroneously. This fix checks `lamp != LAMP_NONE` first, as in all other usages of #shader_setup_from_sample `LAMP_NONE` is passed as the value of `lamp`. Pull Request: https://projects.blender.org/blender/blender/pulls/108769
This commit is contained in:
parent
a7644fd5bb
commit
84863dae89
@ -155,12 +155,15 @@ ccl_device_inline void shader_setup_from_sample(KernelGlobals kg,
|
|||||||
sd->Ng = Ng;
|
sd->Ng = Ng;
|
||||||
sd->wi = I;
|
sd->wi = I;
|
||||||
sd->shader = shader;
|
sd->shader = shader;
|
||||||
if (prim != PRIM_NONE)
|
if (lamp != LAMP_NONE) {
|
||||||
sd->type = PRIMITIVE_TRIANGLE;
|
|
||||||
else if (lamp != LAMP_NONE)
|
|
||||||
sd->type = PRIMITIVE_LAMP;
|
sd->type = PRIMITIVE_LAMP;
|
||||||
else
|
}
|
||||||
|
else if (prim != PRIM_NONE) {
|
||||||
|
sd->type = PRIMITIVE_TRIANGLE;
|
||||||
|
}
|
||||||
|
else {
|
||||||
sd->type = PRIMITIVE_NONE;
|
sd->type = PRIMITIVE_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
/* primitive */
|
/* primitive */
|
||||||
sd->object = object;
|
sd->object = object;
|
||||||
|
Loading…
Reference in New Issue
Block a user