Line 0
Link Here
|
|
|
1 |
--- intern/cycles/kernel/shaders/node_brick_texture.osl.orig 2018-12-03 16:56:43 UTC |
2 |
+++ intern/cycles/kernel/shaders/node_brick_texture.osl |
3 |
@@ -19,10 +19,10 @@ |
4 |
|
5 |
/* Brick */ |
6 |
|
7 |
-float brick_noise(int n) /* fast integer noise */ |
8 |
+float brick_noise(int ns) /* fast integer noise */ |
9 |
{ |
10 |
int nn; |
11 |
- n = (n + 1013) & 2147483647; |
12 |
+ int n = (ns + 1013) & 2147483647; |
13 |
n = (n >> 13) ^ n; |
14 |
nn = (n * (n * n * 60493 + 19990303) + 1376312589) & 2147483647; |
15 |
return 0.5 * ((float)nn / 1073741824.0); |
16 |
@@ -30,7 +30,7 @@ float brick_noise(int n) /* fast integer noise */ |
17 |
|
18 |
float brick(point p, float mortar_size, float mortar_smooth, float bias, |
19 |
float BrickWidth, float row_height, float offset_amount, int offset_frequency, |
20 |
- float squash_amount, int squash_frequency, float tint) |
21 |
+ float squash_amount, int squash_frequency, output float tint) |
22 |
{ |
23 |
int bricknum, rownum; |
24 |
float offset = 0.0; |
25 |
--- intern/cycles/kernel/shaders/node_checker_texture.osl.orig 2018-12-03 16:56:43 UTC |
26 |
+++ intern/cycles/kernel/shaders/node_checker_texture.osl |
27 |
@@ -19,11 +19,12 @@ |
28 |
|
29 |
/* Checker */ |
30 |
|
31 |
-float checker(point p) |
32 |
+float checker(point ip) |
33 |
{ |
34 |
- p[0] = (p[0] + 0.000001) * 0.999999; |
35 |
- p[1] = (p[1] + 0.000001) * 0.999999; |
36 |
- p[2] = (p[2] + 0.000001) * 0.999999; |
37 |
+ point p; |
38 |
+ p[0] = (ip[0] + 0.000001) * 0.999999; |
39 |
+ p[1] = (ip[1] + 0.000001) * 0.999999; |
40 |
+ p[2] = (ip[2] + 0.000001) * 0.999999; |
41 |
|
42 |
int xi = (int)fabs(floor(p[0])); |
43 |
int yi = (int)fabs(floor(p[1])); |
44 |
--- intern/cycles/kernel/shaders/node_environment_texture.osl.orig 2018-12-03 16:56:43 UTC |
45 |
+++ intern/cycles/kernel/shaders/node_environment_texture.osl |
46 |
@@ -25,8 +25,9 @@ vector environment_texture_direction_to_equirectangular(vector dir) |
47 |
return vector(u, v, 0.0); |
48 |
} |
49 |
|
50 |
-vector environment_texture_direction_to_mirrorball(vector dir) |
51 |
+vector environment_texture_direction_to_mirrorball(vector idir) |
52 |
{ |
53 |
+ vector dir = idir; |
54 |
dir[1] -= 1.0; |
55 |
|
56 |
float div = 2.0 * sqrt(max(-0.5 * dir[1], 0.0)); |
57 |
--- intern/cycles/kernel/shaders/node_musgrave_texture.osl.orig 2018-12-03 16:56:43 UTC |
58 |
+++ intern/cycles/kernel/shaders/node_musgrave_texture.osl |
59 |
@@ -26,13 +26,14 @@ |
60 |
* from "Texturing and Modelling: A procedural approach" |
61 |
*/ |
62 |
|
63 |
-float noise_musgrave_fBm(point p, float H, float lacunarity, float octaves) |
64 |
+float noise_musgrave_fBm(point ip, float H, float lacunarity, float octaves) |
65 |
{ |
66 |
float rmd; |
67 |
float value = 0.0; |
68 |
float pwr = 1.0; |
69 |
float pwHL = pow(lacunarity, -H); |
70 |
int i; |
71 |
+ point p = ip; |
72 |
|
73 |
for (i = 0; i < (int)octaves; i++) { |
74 |
value += safe_noise(p, "signed") * pwr; |
75 |
@@ -54,13 +55,14 @@ float noise_musgrave_fBm(point p, float H, float lacunarity, float octaves) |
76 |
* octaves: number of frequencies in the fBm |
77 |
*/ |
78 |
|
79 |
-float noise_musgrave_multi_fractal(point p, float H, float lacunarity, float octaves) |
80 |
+float noise_musgrave_multi_fractal(point ip, float H, float lacunarity, float octaves) |
81 |
{ |
82 |
float rmd; |
83 |
float value = 1.0; |
84 |
float pwr = 1.0; |
85 |
float pwHL = pow(lacunarity, -H); |
86 |
int i; |
87 |
+ point p = ip; |
88 |
|
89 |
for (i = 0; i < (int)octaves; i++) { |
90 |
value *= (pwr * safe_noise(p, "signed") + 1.0); |
91 |
@@ -83,12 +85,13 @@ float noise_musgrave_multi_fractal(point p, float H, float lacunarity, float oct |
92 |
* offset: raises the terrain from `sea level' |
93 |
*/ |
94 |
|
95 |
-float noise_musgrave_hetero_terrain(point p, float H, float lacunarity, float octaves, float offset) |
96 |
+float noise_musgrave_hetero_terrain(point ip, float H, float lacunarity, float octaves, float offset) |
97 |
{ |
98 |
float value, increment, rmd; |
99 |
float pwHL = pow(lacunarity, -H); |
100 |
float pwr = pwHL; |
101 |
int i; |
102 |
+ point p = ip; |
103 |
|
104 |
/* first unscaled octave of function; later octaves are scaled */ |
105 |
value = offset + safe_noise(p, "signed"); |
106 |
@@ -118,13 +121,14 @@ float noise_musgrave_hetero_terrain(point p, float H, float lacunarity, float oc |
107 |
* offset: raises the terrain from `sea level' |
108 |
*/ |
109 |
|
110 |
-float noise_musgrave_hybrid_multi_fractal(point p, float H, float lacunarity, |
111 |
+float noise_musgrave_hybrid_multi_fractal(point ip, float H, float lacunarity, |
112 |
float octaves, float offset, float gain) |
113 |
{ |
114 |
float result, signal, weight, rmd; |
115 |
float pwHL = pow(lacunarity, -H); |
116 |
float pwr = pwHL; |
117 |
int i; |
118 |
+ point p = ip; |
119 |
|
120 |
result = safe_noise(p, "signed") + offset; |
121 |
weight = gain * result; |
122 |
@@ -156,13 +160,14 @@ float noise_musgrave_hybrid_multi_fractal(point p, float H, float lacunarity, |
123 |
* offset: raises the terrain from `sea level' |
124 |
*/ |
125 |
|
126 |
-float noise_musgrave_ridged_multi_fractal(point p, float H, float lacunarity, |
127 |
+float noise_musgrave_ridged_multi_fractal(point ip, float H, float lacunarity, |
128 |
float octaves, float offset, float gain) |
129 |
{ |
130 |
float result, signal, weight; |
131 |
float pwHL = pow(lacunarity, -H); |
132 |
float pwr = pwHL; |
133 |
int i; |
134 |
+ point p = ip; |
135 |
|
136 |
signal = offset - fabs(safe_noise(p, "signed")); |
137 |
signal *= signal; |
138 |
--- intern/cycles/kernel/shaders/node_noise_texture.osl.orig 2018-12-03 16:56:43 UTC |
139 |
+++ intern/cycles/kernel/shaders/node_noise_texture.osl |
140 |
@@ -19,9 +19,10 @@ |
141 |
|
142 |
/* Noise */ |
143 |
|
144 |
-float noise(point p, float distortion, float detail, float fac, color Color) |
145 |
+float noise(point ip, float distortion, float detail, output color Color) |
146 |
{ |
147 |
point r; |
148 |
+ point p = ip; |
149 |
int hard = 0; |
150 |
|
151 |
if (distortion != 0.0) { |
152 |
@@ -32,7 +33,7 @@ float noise(point p, float distortion, float detail, float fac, color Color) |
153 |
p += r; |
154 |
} |
155 |
|
156 |
- fac = noise_turbulence(p, detail, hard); |
157 |
+ float fac = noise_turbulence(p, detail, hard); |
158 |
|
159 |
Color = color(fac, noise_turbulence(point(p[1], p[0], p[2]), detail, hard), |
160 |
noise_turbulence(point(p[1], p[2], p[0]), detail, hard)); |
161 |
@@ -55,6 +56,6 @@ shader node_noise_texture( |
162 |
if (use_mapping) |
163 |
p = transform(mapping, p); |
164 |
|
165 |
- Fac = noise(p * Scale, Distortion, Detail, Fac, Color); |
166 |
+ Fac = noise(p * Scale, Distortion, Detail, Color); |
167 |
} |
168 |
|