Blender Git Loki

Git Commits -> Revision 9847ad9

Revision 9847ad9 by Lukas Stockner (master)
November 3, 2016, 02:08 (GMT)
Cycles: Fix T49901: OpenCL build error after recent light texture coordinate commit

Basically, the problem here was that the transform that's used to bring texture coordinates
to world space is either fetched while setting up the shader (with Object Motion is enabled) or
fetched when needed (otherwise). That helps to save ShaderData memory on OpenCL when Object Motion isn't needed.

Now, if OM is enabled, the Lamp transform can just be stored inside the ShaderData as well. The original commit just assumed it is.
However, when it's not (on OpenCL by default, for example), there is no easy way to fetch it when needed, since the ShaderData doesn't
store the Lamp index.

So, for now the lamps just don't support local texture coordinates anymore when Object Motion is disabled.
To fix and support this properly, one of the following could be done:
- Just always pre-fetch the transform. Downside: Memory Usage increases when not using OM on OpenCL
- Add a variable to ShaderData that stores the Lamp ID to allow fetching it when needed
- Store the Lamp ID inside prim or object. Problem: Cycles currently checks these for whether an object was hit - these checks would need to be changed.
- Enable OM whenever a Texture Coordinate's Normal output is used. Downside: Might not actually be needed.

Commit Details:

Full Hash: 9847ad977a29685d3400ec222213dfb484ec01f5
Parent Commit: 643c5a2
Lines Changed: +14, -17

4 Modified Paths:

/intern/cycles/kernel/geom/geom_object.h (+8, -4) (Diff)
/intern/cycles/kernel/kernel_shader.h (+2, -5) (Diff)
/intern/cycles/kernel/svm/svm_image.h (+1, -2) (Diff)
/intern/cycles/kernel/svm/svm_tex_coord.h (+3, -6) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021