From ab1b5af08d25b5c9bdb11110e4e8b607fdea3af5 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 20 Nov 2012 17:40:10 +0000 Subject: Fix cycles OSL missing support for texture mapping paramaters found in texture properties tab. --- intern/cycles/kernel/shaders/node_noise_texture.osl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'intern/cycles/kernel/shaders/node_noise_texture.osl') diff --git a/intern/cycles/kernel/shaders/node_noise_texture.osl b/intern/cycles/kernel/shaders/node_noise_texture.osl index 227b2bf8cea..0a379491781 100644 --- a/intern/cycles/kernel/shaders/node_noise_texture.osl +++ b/intern/cycles/kernel/shaders/node_noise_texture.osl @@ -43,6 +43,8 @@ float noise(point p, string basis, float distortion, float detail, float fac, co } shader node_noise_texture( + int use_mapping = 0, + matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), float Distortion = 0.0, float Scale = 5.0, float Detail = 2.0, @@ -50,7 +52,12 @@ shader node_noise_texture( output float Fac = 0.0, output color Color = color(0.2, 0.2, 0.2)) { + point p = Vector; + + if (use_mapping) + p = transform(mapping, p); + string Basis = "Perlin"; - Fac = noise(Vector * Scale, Basis, Distortion, Detail, Fac, Color); + Fac = noise(p * Scale, Basis, Distortion, Detail, Fac, Color); } -- cgit v1.2.3