Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/svm/svm_voronoi.h
| Show First 20 Lines • Show All 911 Lines • ▼ Show 20 Lines | for (int k = -1; k <= 1; k++) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| *outRadius = distance(closestPointToClosestPoint, closestPoint) / 2.0f; | *outRadius = distance(closestPointToClosestPoint, closestPoint) / 2.0f; | ||||
| } | } | ||||
| template<uint node_feature_mask> | template<uint node_feature_mask> | ||||
| ccl_device_noinline int svm_node_tex_voronoi(ccl_global const KernelGlobals *kg, | ccl_device_noinline int svm_node_tex_voronoi(KernelGlobals kg, | ||||
| ccl_private ShaderData *sd, | ccl_private ShaderData *sd, | ||||
| ccl_private float *stack, | ccl_private float *stack, | ||||
| uint dimensions, | uint dimensions, | ||||
| uint feature, | uint feature, | ||||
| uint metric, | uint metric, | ||||
| int offset) | int offset) | ||||
| { | { | ||||
| uint4 stack_offsets = read_node(kg, &offset); | uint4 stack_offsets = read_node(kg, &offset); | ||||
| ▲ Show 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | case 2: { | ||||
| exponent, | exponent, | ||||
| randomness, | randomness, | ||||
| voronoi_metric, | voronoi_metric, | ||||
| &distance_out, | &distance_out, | ||||
| &color_out, | &color_out, | ||||
| &position_out_2d); | &position_out_2d); | ||||
| break; | break; | ||||
| case NODE_VORONOI_SMOOTH_F1: | case NODE_VORONOI_SMOOTH_F1: | ||||
| if (KERNEL_NODES_FEATURE(VORONOI_EXTRA)) { | IF_KERNEL_NODES_FEATURE(VORONOI_EXTRA) | ||||
| { | |||||
| voronoi_smooth_f1_2d(coord_2d, | voronoi_smooth_f1_2d(coord_2d, | ||||
| smoothness, | smoothness, | ||||
| exponent, | exponent, | ||||
| randomness, | randomness, | ||||
| voronoi_metric, | voronoi_metric, | ||||
| &distance_out, | &distance_out, | ||||
| &color_out, | &color_out, | ||||
| &position_out_2d); | &position_out_2d); | ||||
| Show All 28 Lines | case 3: { | ||||
| exponent, | exponent, | ||||
| randomness, | randomness, | ||||
| voronoi_metric, | voronoi_metric, | ||||
| &distance_out, | &distance_out, | ||||
| &color_out, | &color_out, | ||||
| &position_out); | &position_out); | ||||
| break; | break; | ||||
| case NODE_VORONOI_SMOOTH_F1: | case NODE_VORONOI_SMOOTH_F1: | ||||
| if (KERNEL_NODES_FEATURE(VORONOI_EXTRA)) { | IF_KERNEL_NODES_FEATURE(VORONOI_EXTRA) | ||||
| { | |||||
| voronoi_smooth_f1_3d(coord, | voronoi_smooth_f1_3d(coord, | ||||
| smoothness, | smoothness, | ||||
| exponent, | exponent, | ||||
| randomness, | randomness, | ||||
| voronoi_metric, | voronoi_metric, | ||||
| &distance_out, | &distance_out, | ||||
| &color_out, | &color_out, | ||||
| &position_out); | &position_out); | ||||
| Show All 17 Lines | case 3: { | ||||
| default: | default: | ||||
| kernel_assert(0); | kernel_assert(0); | ||||
| } | } | ||||
| position_out = safe_divide_float3_float(position_out, scale); | position_out = safe_divide_float3_float(position_out, scale); | ||||
| break; | break; | ||||
| } | } | ||||
| case 4: { | case 4: { | ||||
| if (KERNEL_NODES_FEATURE(VORONOI_EXTRA)) { | IF_KERNEL_NODES_FEATURE(VORONOI_EXTRA) | ||||
| { | |||||
| float4 coord_4d = make_float4(coord.x, coord.y, coord.z, w); | float4 coord_4d = make_float4(coord.x, coord.y, coord.z, w); | ||||
| float4 position_out_4d; | float4 position_out_4d; | ||||
| switch (voronoi_feature) { | switch (voronoi_feature) { | ||||
| case NODE_VORONOI_F1: | case NODE_VORONOI_F1: | ||||
| voronoi_f1_4d(coord_4d, | voronoi_f1_4d(coord_4d, | ||||
| exponent, | exponent, | ||||
| randomness, | randomness, | ||||
| voronoi_metric, | voronoi_metric, | ||||
| ▲ Show 20 Lines • Show All 56 Lines • Show Last 20 Lines | |||||