23 #ifdef __RAY_DIFFERENTIALS__
25 uint normal_offset, scale_offset,
invert, use_object_space;
33 if (use_object_space) {
44 uint c_offset, x_offset, y_offset, strength_offset;
52 float det =
dot(dPdx, Rx);
53 float3 surfgrad = (h_x - h_c) * Rx + (h_y - h_c) * Ry;
55 float absdet =
fabsf(det);
63 strength =
max(strength, 0.0f);
68 normal_out = normal_in;
71 normal_out =
normalize(strength * normal_out + (1.0f - strength) * normal_in);
74 if (use_object_space) {
97 uint height_offset, midlevel_offset, scale_offset, normal_offset;
111 dP *= (
height - midlevel) * scale;
116 dP *= (
height - midlevel) * scale;
126 uint space = data_node.
x;
128 uint vector_offset, midlevel_offset, scale_offset, displacement_offset;
130 node.y, &vector_offset, &midlevel_offset, &scale_offset, &displacement_offset);
158 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_inline AttributeDescriptor find_attribute(KernelGlobals *kg, const ShaderData *sd, uint id)
ccl_device_inline void object_inverse_dir_transform(KernelGlobals *kg, const ShaderData *sd, float3 *D)
ccl_device_inline void object_normal_transform(KernelGlobals *kg, const ShaderData *sd, float3 *N)
ccl_device_inline void object_inverse_normal_transform(KernelGlobals *kg, const ShaderData *sd, float3 *N)
ccl_device_inline void object_dir_transform(KernelGlobals *kg, const ShaderData *sd, float3 *D)
CCL_NAMESPACE_BEGIN ccl_device_inline float primitive_surface_attribute_float(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc, float *dx, float *dy)
ccl_device_inline float3 primitive_surface_attribute_float3(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc, float3 *dx, float3 *dy)
IconTextureDrawCall normal
CCL_NAMESPACE_BEGIN ccl_device_inline float3 stack_load_float3(float *stack, uint a)
ccl_device_inline uint4 read_node(KernelGlobals *kg, int *offset)
ccl_device_inline float stack_load_float(float *stack, uint a)
ccl_device_inline void stack_store_float3(float *stack, uint a, float3 f)
ccl_device_forceinline void svm_unpack_node_uchar4(uint i, uint *x, uint *y, uint *z, uint *w)
ccl_device_inline bool stack_valid(uint a)
#define CCL_NAMESPACE_END
#define make_float3(x, y, z)
ccl_device float3 ensure_valid_reflection(float3 Ng, float3 I, float3 N)
ccl_device void svm_node_set_displacement(KernelGlobals *kg, ShaderData *sd, float *stack, uint fac_offset)
ccl_device void svm_node_vector_displacement(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node, int *offset)
ccl_device void svm_node_displacement(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node)
CCL_NAMESPACE_BEGIN ccl_device void svm_node_set_bump(KernelGlobals *kg, ShaderData *sd, float *stack, uint4 node)
CCL_NAMESPACE_BEGIN ccl_device float invert(float color, float factor)
@ NODE_NORMAL_MAP_TANGENT
__forceinline avxf cross(const avxf &a, const avxf &b)
ccl_device_inline float2 normalize(const float2 &a)
ccl_device_inline float dot(const float2 &a, const float2 &b)
ccl_device_inline float2 safe_normalize(const float2 &a)
ccl_device_inline bool is_zero(const float2 &a)