diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-03 17:58:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-03 17:58:08 +0400 |
commit | 4a9c522125df9321c8337eaaf1933f540140d023 (patch) | |
tree | 2000ce4c3251829a420724b8b9e4d382b0d8998c /intern/cycles/kernel/shaders | |
parent | 6213c6d69b43d11153fca69a50508c93c67dd05a (diff) |
quiet float -> double conversion warnings and do some osl style edits.
Diffstat (limited to 'intern/cycles/kernel/shaders')
-rw-r--r-- | intern/cycles/kernel/shaders/node_environment_texture.osl | 8 | ||||
-rw-r--r-- | intern/cycles/kernel/shaders/node_geometry.osl | 6 | ||||
-rw-r--r-- | intern/cycles/kernel/shaders/node_rgb_ramp.osl | 4 |
3 files changed, 9 insertions, 9 deletions
diff --git a/intern/cycles/kernel/shaders/node_environment_texture.osl b/intern/cycles/kernel/shaders/node_environment_texture.osl index 4367f7f4994..c39830499fc 100644 --- a/intern/cycles/kernel/shaders/node_environment_texture.osl +++ b/intern/cycles/kernel/shaders/node_environment_texture.osl @@ -21,8 +21,8 @@ vector environment_texture_direction_to_equirectangular(vector dir) { - float u = -atan2(dir[1], dir[0])/(2.0*M_PI) + 0.5; - float v = atan2(dir[2], hypot(dir[0], dir[1]))/M_PI + 0.5; + float u = -atan2(dir[1], dir[0]) / (2.0 * M_PI) + 0.5; + float v = atan2(dir[2], hypot(dir[0], dir[1])) / M_PI + 0.5; return vector(u, v, 0.0); } @@ -31,8 +31,8 @@ vector environment_texture_direction_to_mirrorball(vector dir) { dir[1] -= 1.0; - float div = 2.0*sqrt(max(-0.5*dir[1], 0.0)); - if(div > 0.0) + float div = 2.0 * sqrt(max(-0.5 * dir[1], 0.0)); + if (div > 0.0) dir /= div; float u = 0.5*(dir[0] + 1.0); diff --git a/intern/cycles/kernel/shaders/node_geometry.osl b/intern/cycles/kernel/shaders/node_geometry.osl index 5a784f951bb..d1c11b70081 100644 --- a/intern/cycles/kernel/shaders/node_geometry.osl +++ b/intern/cycles/kernel/shaders/node_geometry.osl @@ -52,9 +52,9 @@ shader node_geometry( /* try to create spherical tangent from generated coordinates */ if (getattribute("geom:generated", generated)) { matrix project = matrix(0.0, 1.0, 0.0, 0.0, - -1.0, 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0, 0.0, - 0.5, -0.5, 0.0, 1.0); + -1.0, 0.0, 0.0, 0.0, + 0.0, 0.0, 0.0, 0.0, + 0.5, -0.5, 0.0, 1.0); vector T = transform(project, generated); T = transform("object", "world", T); diff --git a/intern/cycles/kernel/shaders/node_rgb_ramp.osl b/intern/cycles/kernel/shaders/node_rgb_ramp.osl index c7bb53bfefc..0df11bb38de 100644 --- a/intern/cycles/kernel/shaders/node_rgb_ramp.osl +++ b/intern/cycles/kernel/shaders/node_rgb_ramp.osl @@ -31,8 +31,8 @@ shader node_rgb_ramp( /* clamp int as well in case of NaN */ int i = (int)f; - if(i < 0) i = 0; - if(i >= RAMP_TABLE_SIZE) i = RAMP_TABLE_SIZE-1; + if (i < 0) i = 0; + if (i >= RAMP_TABLE_SIZE) i = RAMP_TABLE_SIZE - 1; float t = f - (float)i; Color = ramp_color[i]; |