Cycles / OSL Textures:
* More fixes, replaced all remaining size variables with scale ones. * Remove nonzero check in OSL textures, not needed anymore, was there to prevent division by zero for the size variable.
This commit is contained in:
@@ -193,16 +193,15 @@ shader node_musgrave_texture(
|
|||||||
float Offset = 0.0,
|
float Offset = 0.0,
|
||||||
float Intensity = 1.0,
|
float Intensity = 1.0,
|
||||||
float Gain = 1.0,
|
float Gain = 1.0,
|
||||||
float Size = 0.25,
|
float Scale = 5.0,
|
||||||
point Vector = P,
|
point Vector = P,
|
||||||
output float Fac = 0.0)
|
output float Fac = 0.0)
|
||||||
{
|
{
|
||||||
float dimension = max(Dimension, 0.0);
|
float dimension = max(Dimension, 0.0);
|
||||||
float octaves = max(Octaves, 0.0);
|
float octaves = max(Octaves, 0.0);
|
||||||
float lacunarity = max(Lacunarity, 1e-5);
|
float lacunarity = max(Lacunarity, 1e-5);
|
||||||
float size = nonzero(Size, 1e-5);
|
|
||||||
|
|
||||||
point p = Vector/size;
|
point p = Vector*Scale;
|
||||||
|
|
||||||
if(Type == "Multifractal")
|
if(Type == "Multifractal")
|
||||||
Fac = Intensity*noise_musgrave_multi_fractal(p, Basis, dimension, lacunarity, octaves);
|
Fac = Intensity*noise_musgrave_multi_fractal(p, Basis, dimension, lacunarity, octaves);
|
||||||
|
@@ -46,7 +46,7 @@ float noise(point p, string basis, float distortion, float detail)
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
shader node_distorted_noise_texture(
|
shader node_noise_texture(
|
||||||
string Basis = "Perlin",
|
string Basis = "Perlin",
|
||||||
float Distortion = 0.0,
|
float Distortion = 0.0,
|
||||||
float Scale = 5.0,
|
float Scale = 5.0,
|
||||||
@@ -54,7 +54,6 @@ shader node_distorted_noise_texture(
|
|||||||
point Vector = P,
|
point Vector = P,
|
||||||
output float Fac = 0.0)
|
output float Fac = 0.0)
|
||||||
{
|
{
|
||||||
float scale = nonzero(Scale, 1e-5);
|
Fac = noise(Vector*Scale, Basis, Distortion, Detail);
|
||||||
Fac = noise(Vector*scale, Basis, Distortion, Detail);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -30,13 +30,12 @@ shader node_voronoi_texture(
|
|||||||
float Weight4 = 0.0,
|
float Weight4 = 0.0,
|
||||||
float Exponent = 2.5,
|
float Exponent = 2.5,
|
||||||
float Intensity = 1.0,
|
float Intensity = 1.0,
|
||||||
float Size = 0.25,
|
float Scale = 5.0,
|
||||||
point Vector = P,
|
point Vector = P,
|
||||||
output float Fac = 0.0,
|
output float Fac = 0.0,
|
||||||
output color Color = color(0.0, 0.0, 0.0))
|
output color Color = color(0.0, 0.0, 0.0))
|
||||||
{
|
{
|
||||||
float exponent = max(Exponent, 1e-5);
|
float exponent = max(Exponent, 1e-5);
|
||||||
float size = nonzero(Size, 1e-5);
|
|
||||||
|
|
||||||
float aw1 = fabs(Weight1);
|
float aw1 = fabs(Weight1);
|
||||||
float aw2 = fabs(Weight2);
|
float aw2 = fabs(Weight2);
|
||||||
@@ -51,7 +50,7 @@ shader node_voronoi_texture(
|
|||||||
float da[4];
|
float da[4];
|
||||||
point pa[4];
|
point pa[4];
|
||||||
|
|
||||||
voronoi(Vector/size, DistanceMetric, exponent, da, pa);
|
voronoi(Vector*Scale, DistanceMetric, exponent, da, pa);
|
||||||
|
|
||||||
/* Scalar output */
|
/* Scalar output */
|
||||||
Fac = sc * fabs(Weight1*da[0] + Weight2*da[1] + Weight3*da[2] + Weight4*da[3]);
|
Fac = sc * fabs(Weight1*da[0] + Weight2*da[1] + Weight3*da[2] + Weight4*da[3]);
|
||||||
|
@@ -54,7 +54,6 @@ shader node_wave_texture(
|
|||||||
point Vector = P,
|
point Vector = P,
|
||||||
output float Fac = 0.0)
|
output float Fac = 0.0)
|
||||||
{
|
{
|
||||||
float scale = nonzero(Scale, 1e-5);
|
Fac = wave(Vector, Scale, Type, detail, distortion, dscale);
|
||||||
Fac = wave(Vector, scale, Type, detail, distortion, dscale);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user