11 template<u
int node_feature_mask>
17 #ifdef __RAY_DIFFERENTIALS__
21 uint normal_offset, scale_offset,
invert, use_object_space;
30 if (use_object_space) {
41 uint c_offset, x_offset, y_offset, strength_offset;
49 float det =
dot(dPdx, Rx);
50 float3 surfgrad = (h_x - h_c) * Rx + (h_y - h_c) * Ry;
52 float absdet =
fabsf(det);
60 strength =
max(strength, 0.0f);
65 normal_out = normal_in;
68 normal_out =
normalize(strength * normal_out + (1.0f - strength) * normal_in);
71 if (use_object_space) {
87 template<u
int node_feature_mask>
100 template<u
int node_feature_mask>
108 uint height_offset, midlevel_offset, scale_offset, normal_offset;
110 node.y, &height_offset, &midlevel_offset, &scale_offset, &normal_offset);
123 dP *= (
height - midlevel) * scale;
128 dP *= (
height - midlevel) * scale;
139 template<u
int node_feature_mask>
144 uint vector_offset, midlevel_offset, scale_offset, displacement_offset;
146 node.y, &vector_offset, &midlevel_offset, &scale_offset, &displacement_offset);
150 uint space = data_node.
x;
178 dP = tangent * dP.
x +
normal * dP.
y + bitangent * dP.
z;
MINLINE float signf(float f)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
ccl_device float3 ensure_valid_reflection(float3 Ng, float3 I, float3 N)
#define ccl_device_noinline
#define CCL_NAMESPACE_END
const KernelGlobalsCPU *ccl_restrict KernelGlobals
CCL_NAMESPACE_BEGIN ccl_device_noinline void svm_node_set_bump(KernelGlobals kg, ccl_private ShaderData *sd, ccl_private float *stack, uint4 node)
ccl_device_noinline int svm_node_vector_displacement(KernelGlobals kg, ccl_private ShaderData *sd, ccl_private float *stack, uint4 node, int offset)
ccl_device void svm_node_set_displacement(KernelGlobals kg, ccl_private ShaderData *sd, ccl_private float *stack, uint fac_offset)
ccl_device_noinline void svm_node_displacement(KernelGlobals kg, ccl_private ShaderData *sd, ccl_private float *stack, uint4 node)
SyclQueue void void size_t num_bytes void
IconTextureDrawCall normal
CCL_NAMESPACE_BEGIN ccl_device float invert(float color, float factor)
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
ccl_device_inline AttributeDescriptor find_attribute(KernelGlobals kg, ccl_private const ShaderData *sd, uint id)
ccl_device_inline void object_inverse_dir_transform(KernelGlobals kg, ccl_private const ShaderData *sd, ccl_private float3 *D)
ccl_device_inline void object_dir_transform(KernelGlobals kg, ccl_private const ShaderData *sd, ccl_private float3 *D)
ccl_device_inline void object_inverse_normal_transform(KernelGlobals kg, ccl_private const ShaderData *sd, ccl_private float3 *N)
ccl_device_inline void object_normal_transform(KernelGlobals kg, ccl_private const ShaderData *sd, ccl_private float3 *N)
ccl_device_inline void stack_store_float3(ccl_private float *stack, uint a, float3 f)
CCL_NAMESPACE_BEGIN ccl_device_inline float3 stack_load_float3(ccl_private float *stack, uint a)
ccl_device_inline uint4 read_node(KernelGlobals kg, ccl_private int *offset)
ccl_device_inline float stack_load_float(ccl_private float *stack, uint a)
ccl_device_forceinline void svm_unpack_node_uchar4(uint i, ccl_private uint *x, ccl_private uint *y, ccl_private uint *z, ccl_private uint *w)
ccl_device_inline bool stack_valid(uint a)
@ NODE_NORMAL_MAP_TANGENT
#define IF_KERNEL_NODES_FEATURE(feature)
ccl_device_inline float2 safe_normalize(const float2 &a)
ccl_device_inline float3 zero_float3()
T dot(const vec_base< T, Size > &a, const vec_base< T, Size > &b)
vec_base< T, 3 > cross(const vec_base< T, 3 > &a, const vec_base< T, 3 > &b)
vec_base< T, Size > normalize(const vec_base< T, Size > &v)
ccl_device_forceinline float3 primitive_surface_attribute_float3(KernelGlobals kg, ccl_private const ShaderData *sd, const AttributeDescriptor desc, ccl_private float3 *dx, ccl_private float3 *dy)
CCL_NAMESPACE_BEGIN ccl_device_forceinline float primitive_surface_attribute_float(KernelGlobals kg, ccl_private const ShaderData *sd, const AttributeDescriptor desc, ccl_private float *dx, ccl_private float *dy)