Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2013-10-10 21:28:01 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-10-10 21:28:01 +0400
commit8fd52b34330354f5a8d285fd0888ffe7e72895b1 (patch)
treed1142e48eb9c6853c7078c6947c82c16ef78ca2a /intern
parent3d4bbd278a426d72f54caef76cbc380a18e6a36a (diff)
style cleanup
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/kernel/shaders/node_hair_bsdf.osl43
-rw-r--r--intern/cycles/kernel/shaders/node_sky_texture.osl12
-rw-r--r--intern/cycles/kernel/shaders/node_subsurface_scattering.osl2
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);