30 return ((((
int)fu) & 1) ? 1.0f - u : u) *
max;
43 const float position_offset = 1e-4f;
44 const float uv_offset = 1e-5f;
47 const float3 P = u * tri_verts[0] +
v * tri_verts[1] + (1.0f - u -
v) * tri_verts[2];
48 const float3 center = (tri_verts[0] + tri_verts[1] + tri_verts[2]) / 3.0f;
56 const float3 v1 = tri_verts[1] - tri_verts[0];
57 const float3 v2 = tri_verts[2] - tri_verts[0];
58 const float3 vP = offset_P - tri_verts[0];
63 const float dP1 =
dot(vP,
v1);
64 const float dP2 =
dot(vP,
v2);
66 const float denom = d11 * d22 - d12 * d12;
71 const float offset_v =
clamp((d22 * dP1 - d12 * dP2) / denom, uv_offset, 1.0f - uv_offset);
72 const float offset_w =
clamp((d11 * dP2 - d12 * dP1) / denom, uv_offset, 1.0f - uv_offset);
73 const float offset_u =
clamp(1.0f - offset_v - offset_w, uv_offset, 1.0f - uv_offset);
87 const int scheduled_sample)
124 float filter_x, filter_y;
126 filter_x = filter_y = 0.5f;
136 float u = primitive[2];
137 float v = primitive[3];
145 if ((u == 0.0f || u == 1.0f) && (
v == 0.0f ||
v == 1.0f)) {
163 const float tmpdx = dudx;
164 const float tmpdy = dudy;
167 dvdx = -tmpdx - dvdx;
168 dvdy = -tmpdy - dvdy;
240 dP.
dx = dPdu * dudx + dPdv * dvdx;
241 dP.
dy = dPdu * dudy + dPdv * dvdy;
259 const bool use_caustics =
kernel_data.integrator.use_caustics &&
267 else if (use_raytrace_kernel) {
NSNotificationCenter * center
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
ccl_device_inline void kernel_accum_transparent(KernelGlobals kg, ConstIntegratorState state, const uint32_t path_flag, const float transparent, ccl_global float *ccl_restrict buffer)
ccl_device_inline int kernel_accum_sample(KernelGlobals kg, ConstIntegratorState state, ccl_global float *ccl_restrict render_buffer, int sample, int sample_offset)
__forceinline int reduce_max(const avxi &v)
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
static unsigned long seed
#define ccl_optional_struct_init
#define ccl_device_inline
#define CCL_NAMESPACE_END
const KernelGlobalsCPU *ccl_restrict KernelGlobals
#define kernel_data_fetch(name, index)
ccl_device_forceinline float differential_make_compact(const differential3 D)
ccl_device_forceinline float differential_zero_compact()
ccl_device_inline uint hash_uint(uint kx)
ccl_device const float2 bake_offset_towards_center(KernelGlobals kg, const int prim, const float u, const float v)
CCL_NAMESPACE_BEGIN ccl_device_inline float bake_clamp_mirror_repeat(float u, float max)
ccl_device bool integrator_init_from_bake(KernelGlobals kg, IntegratorState state, ccl_global const KernelWorkTile *ccl_restrict tile, ccl_global float *render_buffer, const int x, const int y, const int scheduled_sample)
ccl_global float * buffer
ccl_gpu_kernel_postfix ccl_global KernelWorkTile const int ccl_global float * render_buffer
const uint64_t render_pixel_index
ccl_global const KernelWorkTile * tile
ccl_gpu_kernel_postfix ccl_global float int int int int int int int pass_stride
CCL_NAMESPACE_BEGIN ccl_device_forceinline bool kernel_need_sample_pixel(KernelGlobals kg, ConstIntegratorState state, ccl_global float *render_buffer)
@ OBJECT_INVERSE_TRANSFORM
ccl_device_inline Transform object_fetch_transform(KernelGlobals kg, int object, enum ObjectTransform type)
@ SD_OBJECT_TRANSFORM_APPLIED
@ DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE
@ DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_RAYTRACE
@ DEVICE_KERNEL_INTEGRATOR_SHADE_SURFACE_MNEE
@ DEVICE_KERNEL_INTEGRATOR_SHADE_BACKGROUND
#define PROFILING_INIT(kg, event)
ccl_device_inline float2 fabs(const float2 &a)
ccl_device_inline float3 zero_float3()
T dot(const vec_base< T, Size > &a, const vec_base< T, Size > &b)
T clamp(const T &a, const T &min, const T &max)
vec_base< T, Size > normalize(const vec_base< T, Size > &v)
ccl_device_inline void path_state_init(IntegratorState state, ccl_global const KernelWorkTile *ccl_restrict tile, const int x, const int y)
ccl_device_inline void path_state_init_integrator(KernelGlobals kg, IntegratorState state, const int sample, const uint rng_hash)
ccl_device_forceinline void path_rng_2D(KernelGlobals kg, uint rng_hash, int sample, int dimension, ccl_private float *fx, ccl_private float *fy)
IntegratorStateCPU *ccl_restrict IntegratorState
#define INTEGRATOR_STATE(state, nested_struct, member)
ccl_device_forceinline void integrator_path_init_sorted(KernelGlobals kg, IntegratorState state, const DeviceKernel next_kernel, const uint32_t key)
ccl_device_forceinline void integrator_path_init(KernelGlobals kg, IntegratorState state, const DeviceKernel next_kernel)
ccl_device_forceinline void integrator_state_write_isect(KernelGlobals kg, IntegratorState state, ccl_private const Intersection *ccl_restrict isect)
CCL_NAMESPACE_BEGIN ccl_device_forceinline void integrator_state_write_ray(KernelGlobals kg, IntegratorState state, ccl_private const Ray *ccl_restrict ray)
unsigned __int64 uint64_t
ccl_device_inline float3 triangle_smooth_normal(KernelGlobals kg, float3 Ng, int prim, float u, float v)
ccl_device_inline void triangle_point_normal(KernelGlobals kg, int object, int prim, float u, float v, ccl_private float3 *P, ccl_private float3 *Ng, ccl_private int *shader)
ccl_device_inline void triangle_vertices(KernelGlobals kg, int prim, float3 P[3])
ccl_device_inline void triangle_dPdudv(KernelGlobals kg, int prim, ccl_private float3 *dPdu, ccl_private float3 *dPdv)
ccl_device_inline uint __float_as_uint(float f)
ccl_device_inline void kernel_write_pass_float3(ccl_global float *ccl_restrict buffer, float3 value)