22#ifdef __SHADER_RAYTRACE__
30 const bool only_local,
31 const float bump_filter_width,
45 bool avoid_self_intersection =
false;
46 if (bump_filter_width > 0.0f) {
49 tmin = bump_filter_width * sd->dP * 1.1f;
72 scene_intersect_local(kg, &ray, &local_isect, sd->object,
nullptr, 1);
76 isect = local_isect.
hits[0];
99 kg, &hit_sd, stack, attribute_node, type, desc);
103template<u
int64_t node_feature_mask,
typename ConstIntegratorGenericState>
104# if defined(__KERNEL_OPTIX__)
110 ConstIntegratorGenericState
state,
119 float is_self_hit = 0.0f;
138 node.bump_filter_width,
142 is_self_hit = (sd->object == hit_sd.object) ? 1.0f : 0.0f;
143 hit_distance = hit_sd.ray_length;
144 hit_position =
position + direction * hit_distance;
145 hit_normal = hit_sd.N;
147 for (uint16_t i = 0; i <
node.num_attributes; i++) {
153 svm_raycast_attr_eval_and_store(kg, stack, attribute_node, hit_sd);
158 if (is_hit == 0.0f) {
159 for (uint16_t i = 0; i <
node.num_attributes; i++) {
166 attribute_node.output_type, stack, attribute_node.out_offset,
make_zero<float3>());
ccl_device_inline void stack_store_float(ccl_private float *stack, const uint a, const float f)
ccl_device_inline void stack_store_float3(ccl_private float *stack, const uint a, const float3 f)
ccl_device_inline const ccl_global T & svm_node_get(KernelGlobals kg, ccl_private int *const offset)
ccl_device_inline bool stack_valid(const uint a)
ccl_device_inline T stack_load(const ccl_private float *stack, const uint a)
#define kernel_assert(cond)
#define IF_KERNEL_NODES_FEATURE(feature)
#define kernel_data_fetch(name, index)
#define AS_SHADER_DATA(shader_data_tiny_storage)
#define ccl_device_inline
#define ccl_device_noinline
#define CCL_NAMESPACE_END
ccl_device_forceinline float differential_zero_compact()
float distance(float, float) RET
ccl_device_intersect bool scene_intersect(KernelGlobals kg, const ccl_private Ray *ray, const uint visibility, ccl_private Intersection *isect)
CCL_NAMESPACE_BEGIN ccl_device AttributeDescriptor svm_node_attr_init(KernelGlobals kg, ccl_private ShaderData *sd, const ccl_global SVMNodeAttr &ccl_restrict node, ccl_private NodeAttributeOutputType *type)
ccl_device_inline Float3Type svm_node_attr_surface_eval(KernelGlobals kg, ccl_private ShaderData *sd, ccl_private float *ccl_restrict stack, const ccl_global SVMNodeAttr &ccl_restrict node, const NodeAttributeOutputType type, const AttributeDescriptor desc)
ccl_device_inline void svm_node_attr_store(const NodeAttributeOutputType type, ccl_private float *stack, const uint out_offset, const ccl_private Float3Type &f)
ShaderData ShaderDataTinyStorage
@ PATH_RAY_VISIBILITY_RAYCAST
ccl_device_inline T make_zero()
ccl_device_inline bool isequal(const float2 a, const float2 b)
BMesh const char void * data
ccl_device_inline void shader_setup_from_ray(KernelGlobals kg, ccl_private ShaderData *ccl_restrict sd, const ccl_private Ray *ccl_restrict ray, const ccl_private Intersection *ccl_restrict isect)
const IntegratorStateCPU * ConstIntegratorState
Intersection hits[LOCAL_MAX_HITS]