From e12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 17 Apr 2019 06:17:24 +0200 Subject: 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 --- .../kernel/shaders/node_anisotropic_bsdf.osl | 70 +++++++++++----------- 1 file changed, 34 insertions(+), 36 deletions(-) (limited to 'intern/cycles/kernel/shaders/node_anisotropic_bsdf.osl') 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); } - -- cgit v1.2.3