This patch adds texture coordinates to point and area lights in Cycles. Using the Geometry Node/Parametric output, one can now apply procedural and image textures in planar mapping to area lights and in spherical coordinates to point lights.
Diff Detail
- Repository
- rB Blender
Here is a before/after comparison with an area light:
The same shader on a point light:
Area light seems fine, point one has some questions..
intern/cycles/kernel/kernel_light.h | ||
---|---|---|
590 | Not sure why we need texture coordinate at sample(). And even if we really need it, why it's only done for the point light? | |
intern/cycles/util/util_math.h | ||
1499 | ray_quad_intersect() was only used in a single place. Perhaps we can simply add u and v coordinates there as a return value and avoid having to practically identical functions one of which is not used? |
This updated patch removes the now unused ray_quad_intersect() and ray_triangle_intersect().
Went out of my radars :(
Still very interesting feature. Do you mind updating it against latest master?
Other than that after closer look seems to be fine.
intern/cycles/kernel/kernel_light.h | ||
---|---|---|
590 | Texture coordinates in sample are necessary for MIS. You are right though, it's missing for area lights - I thought randu and randv were sufficient, but we need to calculate it from the intersection point - see below. | |
intern/cycles/util/util_math.h | ||
1499 | Sure, we can remove it then and have one function do both. |