diff options
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/kernel/shaders/node_hair_bsdf.osl | 43 | ||||
-rw-r--r-- | intern/cycles/kernel/shaders/node_sky_texture.osl | 12 | ||||
-rw-r--r-- | intern/cycles/kernel/shaders/node_subsurface_scattering.osl | 2 |
3 files changed, 29 insertions, 28 deletions
diff --git a/intern/cycles/kernel/shaders/node_hair_bsdf.osl b/intern/cycles/kernel/shaders/node_hair_bsdf.osl index d1d7d0fb6a6..54d4cb67c3b 100644 --- a/intern/cycles/kernel/shaders/node_hair_bsdf.osl +++ b/intern/cycles/kernel/shaders/node_hair_bsdf.osl @@ -19,8 +19,8 @@ #include "stdosl.h" shader node_hair_bsdf( - color Color = 0.8, - string component = "Reflection", + color Color = 0.8, + string component = "Reflection", float Offset = 0.0, float RoughnessU = 0.1, float RoughnessV = 1.0, @@ -28,29 +28,30 @@ shader node_hair_bsdf( output closure color BSDF = 0) { float IsStrand; - float roughnessh = clamp(RoughnessU, 0.001,1.0); - float roughnessv = clamp(RoughnessV, 0.001,1.0); + float roughnessh = clamp(RoughnessU, 0.001, 1.0); + float roughnessv = clamp(RoughnessV, 0.001, 1.0); getattribute("geom:is_curve", IsStrand); - if (!IsStrand) { - if (backfacing()) - BSDF = transparent(); - else { - if (component == "Reflection") - BSDF = Color * hair_reflection(Normal, roughnessh, roughnessv, normalize(dPdv), 0.0); - else - BSDF = Color * hair_transmission(Normal, roughnessh, roughnessv, normalize(dPdv), 0.0); + if (!IsStrand) { + if (backfacing()) { + BSDF = transparent(); + } + else { + if (component == "Reflection") + BSDF = Color * hair_reflection(Normal, roughnessh, roughnessv, normalize(dPdv), 0.0); + else + BSDF = Color * hair_transmission(Normal, roughnessh, roughnessv, normalize(dPdv), 0.0); } } - else { - if (backfacing()) - BSDF = transparent(); - else { - if (component == "Reflection") - BSDF = Color * hair_reflection(Normal, roughnessh, roughnessv, dPdu, -Offset); - else - BSDF = Color * hair_transmission(Normal, roughnessh, roughnessv, dPdu, -Offset); + else { + if (backfacing()) { + BSDF = transparent(); + } + else { + if (component == "Reflection") + BSDF = Color * hair_reflection(Normal, roughnessh, roughnessv, dPdu, -Offset); + else + BSDF = Color * hair_transmission(Normal, roughnessh, roughnessv, dPdu, -Offset); } } } - diff --git a/intern/cycles/kernel/shaders/node_sky_texture.osl b/intern/cycles/kernel/shaders/node_sky_texture.osl index 3ed791fdc92..85c2dbdb2c2 100644 --- a/intern/cycles/kernel/shaders/node_sky_texture.osl +++ b/intern/cycles/kernel/shaders/node_sky_texture.osl @@ -44,8 +44,8 @@ float sky_perez_function(float lam[9], float theta, float gamma) } color sky_radiance_old(normal dir, - float sunphi, float suntheta, color radiance, - float config_x[9], float config_y[9], float config_z[9]) + float sunphi, float suntheta, color radiance, + float config_x[9], float config_y[9], float config_z[9]) { /* convert vector to spherical coordinates */ vector spherical = sky_spherical_coordinates(dir); @@ -76,7 +76,7 @@ float sky_radiance_internal(float config[9], float theta, float gamma) float expM = exp(config[4] * gamma); float rayM = cgamma * cgamma; - float mieM = (1.0 + rayM) / pow((1.0 + config[8]*config[8] - 2.0*config[8]*cgamma), 1.5); + float mieM = (1.0 + rayM) / pow((1.0 + config[8] * config[8] - 2.0 * config[8] * cgamma), 1.5); float zenith = sqrt(ctheta); return (1.0 + config[0] * exp(config[1] / (ctheta + 0.01))) * @@ -84,8 +84,8 @@ float sky_radiance_internal(float config[9], float theta, float gamma) } color sky_radiance_new(normal dir, - float sunphi, float suntheta, color radiance, - float config_x[9], float config_y[9], float config_z[9]) + float sunphi, float suntheta, color radiance, + float config_x[9], float config_y[9], float config_z[9]) { /* convert vector to spherical coordinates */ vector spherical = sky_spherical_coordinates(dir); @@ -104,7 +104,7 @@ color sky_radiance_new(normal dir, float z = sky_radiance_internal(config_z, theta, gamma) * radiance[2]; /* convert to RGB and adjust strength */ - return xyz_to_rgb(x, y, z) * (M_2PI/683); + return xyz_to_rgb(x, y, z) * (M_2PI / 683); } shader node_sky_texture( diff --git a/intern/cycles/kernel/shaders/node_subsurface_scattering.osl b/intern/cycles/kernel/shaders/node_subsurface_scattering.osl index 5c1d1be0ee7..1c0cd74c0be 100644 --- a/intern/cycles/kernel/shaders/node_subsurface_scattering.osl +++ b/intern/cycles/kernel/shaders/node_subsurface_scattering.osl @@ -26,7 +26,7 @@ shader node_subsurface_scattering( normal Normal = N, output closure color BSSRDF = 0) { - if(Falloff == "Gaussian") + if (Falloff == "Gaussian") BSSRDF = Color * bssrdf_gaussian(N, Scale * Radius, TextureBlur); else BSSRDF = Color * bssrdf_cubic(N, Scale * Radius, TextureBlur, Sharpness); |