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_noise_texture.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_noise_texture.osl')
-rw-r--r--intern/cycles/kernel/shaders/node_noise_texture.osl63
1 files changed, 31 insertions, 32 deletions
diff --git a/intern/cycles/kernel/shaders/node_noise_texture.osl b/intern/cycles/kernel/shaders/node_noise_texture.osl
index 42a30897341..2cbd571e206 100644
--- a/intern/cycles/kernel/shaders/node_noise_texture.osl
+++ b/intern/cycles/kernel/shaders/node_noise_texture.osl
@@ -21,41 +21,40 @@
float noise(point ip, float distortion, float detail, output color Color)
{
- point r;
- point p = ip;
- int hard = 0;
-
- if (distortion != 0.0) {
- r[0] = safe_noise(p + point(13.5), "unsigned") * distortion;
- r[1] = safe_noise(p, "unsigned") * distortion;
- r[2] = safe_noise(p - point(13.5), "unsigned") * distortion;
-
- p += r;
- }
-
- float fac = noise_turbulence(p, detail, hard);
-
- Color = color(fac, noise_turbulence(point(p[1], p[0], p[2]), detail, hard),
- noise_turbulence(point(p[1], p[2], p[0]), detail, hard));
-
- return fac;
+ point r;
+ point p = ip;
+ int hard = 0;
+
+ if (distortion != 0.0) {
+ r[0] = safe_noise(p + point(13.5), "unsigned") * distortion;
+ r[1] = safe_noise(p, "unsigned") * distortion;
+ r[2] = safe_noise(p - point(13.5), "unsigned") * distortion;
+
+ p += r;
+ }
+
+ float fac = noise_turbulence(p, detail, hard);
+
+ Color = color(fac,
+ noise_turbulence(point(p[1], p[0], p[2]), detail, hard),
+ noise_turbulence(point(p[1], p[2], p[0]), detail, hard));
+
+ return fac;
}
-shader node_noise_texture(
- int use_mapping = 0,
- matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
- float Distortion = 0.0,
- float Scale = 5.0,
- float Detail = 2.0,
- point Vector = P,
- output float Fac = 0.0,
- output color Color = 0.0)
+shader node_noise_texture(int use_mapping = 0,
+ matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+ float Distortion = 0.0,
+ float Scale = 5.0,
+ float Detail = 2.0,
+ point Vector = P,
+ output float Fac = 0.0,
+ output color Color = 0.0)
{
- point p = Vector;
+ point p = Vector;
- if (use_mapping)
- p = transform(mapping, p);
+ if (use_mapping)
+ p = transform(mapping, p);
- Fac = noise(p * Scale, Distortion, Detail, Color);
+ Fac = noise(p * Scale, Distortion, Detail, Color);
}
-