Differential D15785 Diff 54983 source/blender/gpu/shaders/material/gpu_shader_material_tex_musgrave.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/material/gpu_shader_material_tex_musgrave.glsl
| Context not available. | |||||
| float lacunarity = max(lac, 1e-5); | float lacunarity = max(lac, 1e-5); | ||||
| float pwHL = pow(lacunarity, -H); | float pwHL = pow(lacunarity, -H); | ||||
| float pwr = pwHL; | |||||
| float value = snoise(p) + offset; | float pwr = 1.0; | ||||
| float weight = gain * value; | float value = 0.0; | ||||
| p *= lacunarity; | float weight = 1.0; | ||||
| for (int i = 1; (weight > 0.001f) && (i < int(octaves)); i++) { | for (int i = 0; (weight > 0.001f) && (i < int(octaves)); i++) { | ||||
| if (weight > 1.0) { | if (weight > 1.0) { | ||||
| weight = 1.0; | weight = 1.0; | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| float rmd = octaves - floor(octaves); | float rmd = octaves - floor(octaves); | ||||
| if (rmd != 0.0) { | if ((rmd != 0.0) && (weight > 0.001f)) { | ||||
| value += rmd * ((snoise(p) + offset) * pwr); | if (weight > 1.0) { | ||||
| weight = 1.0; | |||||
| } | |||||
| float signal = (snoise(p) + offset) * pwr; | |||||
| value += rmd * weight * signal; | |||||
| } | } | ||||
| fac = value; | fac = value; | ||||
| Context not available. | |||||
| float lacunarity = max(lac, 1e-5); | float lacunarity = max(lac, 1e-5); | ||||
| float pwHL = pow(lacunarity, -H); | float pwHL = pow(lacunarity, -H); | ||||
| float pwr = pwHL; | |||||
| float value = snoise(p) + offset; | float pwr = 1.0; | ||||
| float weight = gain * value; | float value = 0.0; | ||||
| p *= lacunarity; | float weight = 1.0; | ||||
| for (int i = 1; (weight > 0.001f) && (i < int(octaves)); i++) { | for (int i = 0; (weight > 0.001f) && (i < int(octaves)); i++) { | ||||
| if (weight > 1.0) { | if (weight > 1.0) { | ||||
| weight = 1.0; | weight = 1.0; | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| float rmd = octaves - floor(octaves); | float rmd = octaves - floor(octaves); | ||||
| if (rmd != 0.0) { | if ((rmd != 0.0) && (weight > 0.001f)) { | ||||
| value += rmd * ((snoise(p) + offset) * pwr); | if (weight > 1.0) { | ||||
| weight = 1.0; | |||||
| } | |||||
| float signal = (snoise(p) + offset) * pwr; | |||||
| value += rmd * weight * signal; | |||||
| } | } | ||||
| fac = value; | fac = value; | ||||
| Context not available. | |||||
| float lacunarity = max(lac, 1e-5); | float lacunarity = max(lac, 1e-5); | ||||
| float pwHL = pow(lacunarity, -H); | float pwHL = pow(lacunarity, -H); | ||||
| float pwr = pwHL; | |||||
| float value = snoise(p) + offset; | float pwr = 1.0; | ||||
| float weight = gain * value; | float value = 0.0; | ||||
| p *= lacunarity; | float weight = 1.0; | ||||
| for (int i = 1; (weight > 0.001f) && (i < int(octaves)); i++) { | for (int i = 0; (weight > 0.001f) && (i < int(octaves)); i++) { | ||||
| if (weight > 1.0) { | if (weight > 1.0) { | ||||
| weight = 1.0; | weight = 1.0; | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| float rmd = octaves - floor(octaves); | float rmd = octaves - floor(octaves); | ||||
| if (rmd != 0.0) { | if ((rmd != 0.0) && (weight > 0.001f)) { | ||||
| value += rmd * ((snoise(p) + offset) * pwr); | if (weight > 1.0) { | ||||
| weight = 1.0; | |||||
| } | |||||
| float signal = (snoise(p) + offset) * pwr; | |||||
| value += rmd * weight * signal; | |||||
| } | } | ||||
| fac = value; | fac = value; | ||||
| Context not available. | |||||
| float lacunarity = max(lac, 1e-5); | float lacunarity = max(lac, 1e-5); | ||||
| float pwHL = pow(lacunarity, -H); | float pwHL = pow(lacunarity, -H); | ||||
| float pwr = pwHL; | |||||
| float value = snoise(p) + offset; | float pwr = 1.0; | ||||
| float weight = gain * value; | float value = 0.0; | ||||
| p *= lacunarity; | float weight = 1.0; | ||||
| for (int i = 1; (weight > 0.001f) && (i < int(octaves)); i++) { | for (int i = 0; (weight > 0.001f) && (i < int(octaves)); i++) { | ||||
| if (weight > 1.0) { | if (weight > 1.0) { | ||||
| weight = 1.0; | weight = 1.0; | ||||
| } | } | ||||
| Context not available. | |||||
| } | } | ||||
| float rmd = octaves - floor(octaves); | float rmd = octaves - floor(octaves); | ||||
| if (rmd != 0.0) { | if ((rmd != 0.0) && (weight > 0.001f)) { | ||||
| value += rmd * ((snoise(p) + offset) * pwr); | if (weight > 1.0) { | ||||
| weight = 1.0; | |||||
| } | |||||
| float signal = (snoise(p) + offset) * pwr; | |||||
| value += rmd * weight * signal; | |||||
| } | } | ||||
| fac = value; | fac = value; | ||||
| Context not available. | |||||