diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-02 13:40:24 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-03 16:36:20 +0300 |
commit | fadb6f34662fb60e1a48c2c053c500f017206f27 (patch) | |
tree | 48c16c2215e7110e00b4255f6230aa3491d94ee0 /intern/cycles/kernel/shaders | |
parent | 08a44d29815f6b0b9b675a503829d2e2ce7f6426 (diff) |
Cleanup: refactor Cycles OSL texture handling
This adds our own OSL texture handle, that has info for OIIO textures or our
own custom texture types. A filename to handle hash map is used for lookups.
This is efficient because it happens at OSL compile time, because the optimizer
can figure out constant strings and replace them with texture handles.
Diffstat (limited to 'intern/cycles/kernel/shaders')
-rw-r--r-- | intern/cycles/kernel/shaders/node_ies_light.osl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/intern/cycles/kernel/shaders/node_ies_light.osl b/intern/cycles/kernel/shaders/node_ies_light.osl index ea8c44e09de..ce0173451da 100644 --- a/intern/cycles/kernel/shaders/node_ies_light.osl +++ b/intern/cycles/kernel/shaders/node_ies_light.osl @@ -21,7 +21,7 @@ shader node_ies_light(int use_mapping = 0, matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), - int slot = 0, + string filename = "", float Strength = 1.0, point Vector = I, output float Fac = 0.0) @@ -37,5 +37,5 @@ shader node_ies_light(int use_mapping = 0, float v_angle = acos(-p[2]); float h_angle = atan2(p[0], p[1]) + M_PI; - Fac = Strength * texture(format("@l%d", slot), h_angle, v_angle); + Fac = Strength * texture(filename, h_angle, v_angle); } |