Cycles: make light UV available for Texture Coordinate node #108691
|
@ -47,7 +47,9 @@ shader node_texture_coordinate(
|
|||
if (!getattribute("geom:generated", Generated)) {
|
||||
Generated = transform("object", P);
|
||||
}
|
||||
getattribute("geom:uv", UV);
|
||||
if (!getattribute("geom:uv", UV)) {
|
||||
UV = point(1.0 - u - v, u, 0.0);
|
||||
}
|
||||
}
|
||||
|
||||
if (use_transform) {
|
||||
|
|
|
@ -71,6 +71,11 @@ ccl_device_noinline void svm_node_attr(KernelGlobals kg,
|
|||
}
|
||||
#endif
|
||||
|
||||
if (sd->type == PRIMITIVE_LAMP && node.y == ATTR_STD_UV) {
|
||||
stack_store_float3(stack, out_offset, make_float3(1.0f - sd->u - sd->v, sd->u, 0.0f));
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.y == ATTR_STD_GENERATED && desc.element == ATTR_ELEMENT_NONE) {
|
||||
/* No generated attribute, fall back to object coordinates. */
|
||||
float3 f = sd->P;
|
||||
|
|
Loading…
Reference in New Issue