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_wave_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_wave_texture.osl')
-rw-r--r--intern/cycles/kernel/shaders/node_wave_texture.osl72
1 files changed, 35 insertions, 37 deletions
diff --git a/intern/cycles/kernel/shaders/node_wave_texture.osl b/intern/cycles/kernel/shaders/node_wave_texture.osl
index 71bc9324705..dfc2dbfb800 100644
--- a/intern/cycles/kernel/shaders/node_wave_texture.osl
+++ b/intern/cycles/kernel/shaders/node_wave_texture.osl
@@ -21,49 +21,47 @@
float wave(point p, string type, string profile, float detail, float distortion, float dscale)
{
- float n = 0.0;
+ float n = 0.0;
- if (type == "bands") {
- n = (p[0] + p[1] + p[2]) * 10.0;
- }
- else if (type == "rings") {
- n = length(p) * 20.0;
- }
+ if (type == "bands") {
+ n = (p[0] + p[1] + p[2]) * 10.0;
+ }
+ else if (type == "rings") {
+ n = length(p) * 20.0;
+ }
- if (distortion != 0.0) {
- n = n + (distortion * noise_turbulence(p * dscale, detail, 0));
- }
+ if (distortion != 0.0) {
+ n = n + (distortion * noise_turbulence(p * dscale, detail, 0));
+ }
- if (profile == "sine") {
- return 0.5 + 0.5 * sin(n);
- }
- else {
- /* Saw profile */
- n /= M_2PI;
- n -= (int) n;
- return (n < 0.0) ? n + 1.0 : n;
- }
+ if (profile == "sine") {
+ return 0.5 + 0.5 * sin(n);
+ }
+ else {
+ /* Saw profile */
+ n /= M_2PI;
+ n -= (int)n;
+ return (n < 0.0) ? n + 1.0 : n;
+ }
}
-shader node_wave_texture(
- int use_mapping = 0,
- matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
- string type = "bands",
- string profile = "sine",
- float Scale = 5.0,
- float Distortion = 0.0,
- float Detail = 2.0,
- float DetailScale = 1.0,
- point Vector = P,
- output float Fac = 0.0,
- output color Color = 0.0)
+shader node_wave_texture(int use_mapping = 0,
+ matrix mapping = matrix(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
+ string type = "bands",
+ string profile = "sine",
+ float Scale = 5.0,
+ float Distortion = 0.0,
+ float Detail = 2.0,
+ float DetailScale = 1.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 = wave(p * Scale, type, profile, Detail, Distortion, DetailScale);
- Color = Fac;
+ Fac = wave(p * Scale, type, profile, Detail, Distortion, DetailScale);
+ Color = Fac;
}
-