Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_tex_noise.cc
| Show First 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | switch (dimensions_) { | ||||
| } | } | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| case 2: { | case 2: { | ||||
| const VArray<float3> &vector = params.readonly_single_input<float3>(0, "Vector"); | const VArray<float3> &vector = params.readonly_single_input<float3>(0, "Vector"); | ||||
| if (compute_factor) { | if (compute_factor) { | ||||
| for (int64_t i : mask) { | for (int64_t i : mask) { | ||||
| const float2 position = vector[i] * scale[i]; | const float2 position = float2(vector[i] * scale[i]); | ||||
| r_factor[i] = noise::perlin_fractal_distorted( | r_factor[i] = noise::perlin_fractal_distorted( | ||||
| position, detail[i], roughness[i], distortion[i]); | position, detail[i], roughness[i], distortion[i]); | ||||
| } | } | ||||
| } | } | ||||
| if (compute_color) { | if (compute_color) { | ||||
| for (int64_t i : mask) { | for (int64_t i : mask) { | ||||
| const float2 position = vector[i] * scale[i]; | const float2 position = float2(vector[i] * scale[i]); | ||||
| const float3 c = noise::perlin_float3_fractal_distorted( | const float3 c = noise::perlin_float3_fractal_distorted( | ||||
| position, detail[i], roughness[i], distortion[i]); | position, detail[i], roughness[i], distortion[i]); | ||||
| r_color[i] = ColorGeometry4f(c[0], c[1], c[2], 1.0f); | r_color[i] = ColorGeometry4f(c[0], c[1], c[2], 1.0f); | ||||
| } | } | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| case 3: { | case 3: { | ||||
| ▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines | |||||