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
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl')
-rw-r--r--intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl70
1 files changed, 34 insertions, 36 deletions
diff --git a/intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl b/intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl
index 21e28ece65d..165c09eb8e0 100644
--- a/intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl
+++ b/intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl
@@ -16,45 +16,43 @@
#include "stdosl.h"
-shader node_anisotropic_bsdf(
- color Color = 0.0,
- string distribution = "GGX",
- float Roughness = 0.0,
- float Anisotropy = 0.0,
- float Rotation = 0.0,
- normal Normal = N,
- normal Tangent = normalize(dPdu),
- output closure color BSDF = 0)
+shader node_anisotropic_bsdf(color Color = 0.0,
+ string distribution = "GGX",
+ float Roughness = 0.0,
+ float Anisotropy = 0.0,
+ float Rotation = 0.0,
+ normal Normal = N,
+ normal Tangent = normalize(dPdu),
+ output closure color BSDF = 0)
{
- /* rotate tangent around normal */
- vector T = Tangent;
+ /* rotate tangent around normal */
+ vector T = Tangent;
- if (Rotation != 0.0)
- T = rotate(T, Rotation * M_2PI, point(0.0, 0.0, 0.0), Normal);
+ if (Rotation != 0.0)
+ T = rotate(T, Rotation * M_2PI, point(0.0, 0.0, 0.0), Normal);
- /* compute roughness */
- float roughness = Roughness * Roughness;
- float roughness_u, roughness_v;
- float aniso = clamp(Anisotropy, -0.99, 0.99);
+ /* compute roughness */
+ float roughness = Roughness * Roughness;
+ float roughness_u, roughness_v;
+ float aniso = clamp(Anisotropy, -0.99, 0.99);
- if (aniso < 0.0) {
- roughness_u = roughness / (1.0 + aniso);
- roughness_v = roughness * (1.0 + aniso);
- }
- else {
- roughness_u = roughness * (1.0 - aniso);
- roughness_v = roughness / (1.0 - aniso);
- }
+ if (aniso < 0.0) {
+ roughness_u = roughness / (1.0 + aniso);
+ roughness_v = roughness * (1.0 + aniso);
+ }
+ else {
+ roughness_u = roughness * (1.0 - aniso);
+ roughness_v = roughness / (1.0 - aniso);
+ }
- if (distribution == "sharp")
- BSDF = Color * reflection(Normal);
- else if (distribution == "beckmann")
- BSDF = Color * microfacet_beckmann_aniso(Normal, T, roughness_u, roughness_v);
- else if (distribution == "GGX")
- BSDF = Color * microfacet_ggx_aniso(Normal, T, roughness_u, roughness_v);
- else if (distribution == "Multiscatter GGX")
- BSDF = Color * microfacet_multi_ggx_aniso(Normal, T, roughness_u, roughness_v, Color);
- else
- BSDF = Color * ashikhmin_shirley(Normal, T, roughness_u, roughness_v);
+ if (distribution == "sharp")
+ BSDF = Color * reflection(Normal);
+ else if (distribution == "beckmann")
+ BSDF = Color * microfacet_beckmann_aniso(Normal, T, roughness_u, roughness_v);
+ else if (distribution == "GGX")
+ BSDF = Color * microfacet_ggx_aniso(Normal, T, roughness_u, roughness_v);
+ else if (distribution == "Multiscatter GGX")
+ BSDF = Color * microfacet_multi_ggx_aniso(Normal, T, roughness_u, roughness_v, Color);
+ else
+ BSDF = Color * ashikhmin_shirley(Normal, T, roughness_u, roughness_v);
}
-