Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/svm/svm_tex_coord.h
| Show All 16 Lines | |||||
| #include "kernel/geom/geom.h" | #include "kernel/geom/geom.h" | ||||
| #include "kernel/kernel_camera.h" | #include "kernel/kernel_camera.h" | ||||
| #include "kernel/kernel_montecarlo.h" | #include "kernel/kernel_montecarlo.h" | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| /* Texture Coordinate Node */ | /* Texture Coordinate Node */ | ||||
| ccl_device_noinline int svm_node_tex_coord(ccl_global const KernelGlobals *kg, | ccl_device_noinline int svm_node_tex_coord(KernelGlobals kg, | ||||
| ccl_private ShaderData *sd, | ccl_private ShaderData *sd, | ||||
| int path_flag, | int path_flag, | ||||
| ccl_private float *stack, | ccl_private float *stack, | ||||
| uint4 node, | uint4 node, | ||||
| int offset) | int offset) | ||||
| { | { | ||||
| float3 data; | float3 data; | ||||
| uint type = node.y; | uint type = node.y; | ||||
| ▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | #endif | ||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| stack_store_float3(stack, out_offset, data); | stack_store_float3(stack, out_offset, data); | ||||
| return offset; | return offset; | ||||
| } | } | ||||
| ccl_device_noinline int svm_node_tex_coord_bump_dx(ccl_global const KernelGlobals *kg, | ccl_device_noinline int svm_node_tex_coord_bump_dx(KernelGlobals kg, | ||||
| ccl_private ShaderData *sd, | ccl_private ShaderData *sd, | ||||
| int path_flag, | int path_flag, | ||||
| ccl_private float *stack, | ccl_private float *stack, | ||||
| uint4 node, | uint4 node, | ||||
| int offset) | int offset) | ||||
| { | { | ||||
| #ifdef __RAY_DIFFERENTIALS__ | #ifdef __RAY_DIFFERENTIALS__ | ||||
| float3 data; | float3 data; | ||||
| ▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | # endif | ||||
| stack_store_float3(stack, out_offset, data); | stack_store_float3(stack, out_offset, data); | ||||
| return offset; | return offset; | ||||
| #else | #else | ||||
| return svm_node_tex_coord(kg, sd, path_flag, stack, node, offset); | return svm_node_tex_coord(kg, sd, path_flag, stack, node, offset); | ||||
| #endif | #endif | ||||
| } | } | ||||
| ccl_device_noinline int svm_node_tex_coord_bump_dy(ccl_global const KernelGlobals *kg, | ccl_device_noinline int svm_node_tex_coord_bump_dy(KernelGlobals kg, | ||||
| ccl_private ShaderData *sd, | ccl_private ShaderData *sd, | ||||
| int path_flag, | int path_flag, | ||||
| ccl_private float *stack, | ccl_private float *stack, | ||||
| uint4 node, | uint4 node, | ||||
| int offset) | int offset) | ||||
| { | { | ||||
| #ifdef __RAY_DIFFERENTIALS__ | #ifdef __RAY_DIFFERENTIALS__ | ||||
| float3 data; | float3 data; | ||||
| ▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | # endif | ||||
| stack_store_float3(stack, out_offset, data); | stack_store_float3(stack, out_offset, data); | ||||
| return offset; | return offset; | ||||
| #else | #else | ||||
| return svm_node_tex_coord(kg, sd, path_flag, stack, node, offset); | return svm_node_tex_coord(kg, sd, path_flag, stack, node, offset); | ||||
| #endif | #endif | ||||
| } | } | ||||
| ccl_device_noinline void svm_node_normal_map(ccl_global const KernelGlobals *kg, | ccl_device_noinline void svm_node_normal_map(KernelGlobals kg, | ||||
| ccl_private ShaderData *sd, | ccl_private ShaderData *sd, | ||||
| ccl_private float *stack, | ccl_private float *stack, | ||||
| uint4 node) | uint4 node) | ||||
| { | { | ||||
| uint color_offset, strength_offset, normal_offset, space; | uint color_offset, strength_offset, normal_offset, space; | ||||
| svm_unpack_node_uchar4(node.y, &color_offset, &strength_offset, &normal_offset, &space); | svm_unpack_node_uchar4(node.y, &color_offset, &strength_offset, &normal_offset, &space); | ||||
| float3 color = stack_load_float3(stack, color_offset); | float3 color = stack_load_float3(stack, color_offset); | ||||
| ▲ Show 20 Lines • Show All 76 Lines • ▼ Show 20 Lines | ccl_device_noinline void svm_node_normal_map(KernelGlobals kg, | ||||
| if (is_zero(N)) { | if (is_zero(N)) { | ||||
| N = sd->N; | N = sd->N; | ||||
| } | } | ||||
| stack_store_float3(stack, normal_offset, N); | stack_store_float3(stack, normal_offset, N); | ||||
| } | } | ||||
| ccl_device_noinline void svm_node_tangent(ccl_global const KernelGlobals *kg, | ccl_device_noinline void svm_node_tangent(KernelGlobals kg, | ||||
| ccl_private ShaderData *sd, | ccl_private ShaderData *sd, | ||||
| ccl_private float *stack, | ccl_private float *stack, | ||||
| uint4 node) | uint4 node) | ||||
| { | { | ||||
| uint tangent_offset, direction_type, axis; | uint tangent_offset, direction_type, axis; | ||||
| svm_unpack_node_uchar3(node.y, &tangent_offset, &direction_type, &axis); | svm_unpack_node_uchar3(node.y, &tangent_offset, &direction_type, &axis); | ||||
| float3 tangent; | float3 tangent; | ||||
| ▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines | |||||