Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/svm/svm_wave.h
| Show First 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | else if (profile == NODE_WAVE_PROFILE_SAW) { | ||||
| return n - floorf(n); | return n - floorf(n); | ||||
| } | } | ||||
| else { /* NODE_WAVE_PROFILE_TRI */ | else { /* NODE_WAVE_PROFILE_TRI */ | ||||
| n /= M_2PI_F; | n /= M_2PI_F; | ||||
| return fabsf(n - floorf(n + 0.5f)) * 2.0f; | return fabsf(n - floorf(n + 0.5f)) * 2.0f; | ||||
| } | } | ||||
| } | } | ||||
| ccl_device void svm_node_tex_wave( | ccl_device_noinline int svm_node_tex_wave( | ||||
| 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); | ||||
| /* RNA properties */ | /* RNA properties */ | ||||
| uint type_offset, bands_dir_offset, rings_dir_offset, profile_offset; | uint type_offset, bands_dir_offset, rings_dir_offset, profile_offset; | ||||
| /* Inputs, Outputs */ | /* Inputs, Outputs */ | ||||
| uint co_offset, scale_offset, distortion_offset, detail_offset, dscale_offset, droughness_offset, | uint co_offset, scale_offset, distortion_offset, detail_offset, dscale_offset, droughness_offset, | ||||
| phase_offset; | phase_offset; | ||||
| uint color_offset, fac_offset; | uint color_offset, fac_offset; | ||||
| Show All 22 Lines | float f = svm_wave((NodeWaveType)type_offset, | ||||
| dscale, | dscale, | ||||
| droughness, | droughness, | ||||
| phase); | phase); | ||||
| if (stack_valid(fac_offset)) | if (stack_valid(fac_offset)) | ||||
| stack_store_float(stack, fac_offset, f); | stack_store_float(stack, fac_offset, f); | ||||
| if (stack_valid(color_offset)) | if (stack_valid(color_offset)) | ||||
| stack_store_float3(stack, color_offset, make_float3(f, f, f)); | stack_store_float3(stack, color_offset, make_float3(f, f, f)); | ||||
| return offset; | |||||
| } | } | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||