Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/svm/svm_brick.h
| Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | ccl_device_noinline_cpu float2 svm_brick(float3 p, | ||||
| else { | else { | ||||
| min_dist = 1.0f - min_dist / mortar_size; | min_dist = 1.0f - min_dist / mortar_size; | ||||
| mortar = (min_dist < mortar_smooth) ? smoothstepf(min_dist / mortar_smooth) : 1.0f; | mortar = (min_dist < mortar_smooth) ? smoothstepf(min_dist / mortar_smooth) : 1.0f; | ||||
| } | } | ||||
| return make_float2(tint, mortar); | return make_float2(tint, mortar); | ||||
| } | } | ||||
| ccl_device void svm_node_tex_brick( | ccl_device_noinline int svm_node_tex_brick( | ||||
| KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, int *offset) | const KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, int offset) | ||||
| { | { | ||||
| uint4 node2 = read_node(kg, offset); | uint4 node2 = read_node(kg, &offset); | ||||
| uint4 node3 = read_node(kg, offset); | uint4 node3 = read_node(kg, &offset); | ||||
| uint4 node4 = read_node(kg, offset); | uint4 node4 = read_node(kg, &offset); | ||||
| /* Input and Output Sockets */ | /* Input and Output Sockets */ | ||||
| uint co_offset, color1_offset, color2_offset, mortar_offset, scale_offset; | uint co_offset, color1_offset, color2_offset, mortar_offset, scale_offset; | ||||
| uint mortar_size_offset, bias_offset, brick_width_offset, row_height_offset; | uint mortar_size_offset, bias_offset, brick_width_offset, row_height_offset; | ||||
| uint color_offset, fac_offset, mortar_smooth_offset; | uint color_offset, fac_offset, mortar_smooth_offset; | ||||
| /* RNA properties */ | /* RNA properties */ | ||||
| uint offset_frequency, squash_frequency; | uint offset_frequency, squash_frequency; | ||||
| Show All 39 Lines | if (f != 1.0f) { | ||||
| float facm = 1.0f - tint; | float facm = 1.0f - tint; | ||||
| color1 = facm * color1 + tint * color2; | color1 = facm * color1 + tint * color2; | ||||
| } | } | ||||
| if (stack_valid(color_offset)) | if (stack_valid(color_offset)) | ||||
| stack_store_float3(stack, color_offset, color1 * (1.0f - f) + mortar * f); | stack_store_float3(stack, color_offset, color1 * (1.0f - f) + mortar * f); | ||||
| if (stack_valid(fac_offset)) | if (stack_valid(fac_offset)) | ||||
| stack_store_float(stack, fac_offset, f); | stack_store_float(stack, fac_offset, f); | ||||
| return offset; | |||||
| } | } | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||