10 #include "util/color.h"
54 kernel_assert((u >= 0.0f) && (u <= 1.0f) && (
v >= 0.0f) && (
v <= 1.0f));
59 for (
int depth = 0; depth < 0xff; depth++) {
60 float delta = median * 0.5f;
101 float inv_6 = 1.0f / 6.0f;
106 point[0] = inv_6 * (1.0f - 3.0f * (
t - t2) - t3);
107 point[1] = inv_6 * (4.0f - 6.0f * t2 + 3.0f * t3);
108 point[2] = inv_6 * (1.0f + 3.0f * (
t + t2 - t3));
109 point[3] = inv_6 * t3;
112 deriv[0] = -0.5f * t2 +
t - 0.5f;
113 deriv[1] = 1.5f * t2 - 2.0f *
t;
114 deriv[2] = -1.5f * t2 +
t + 0.5f;
115 deriv[3] = 0.5f * t2;
122 int boundary = ((bits >> 8) & 0xf);
151 return (patch_bits & 0xf);
156 bool non_quad_root = (patch_bits >> 4) & 0x1;
160 return 1.0f / (
float)(1 << (depth - 1));
163 return 1.0f / (
float)(1 << depth);
173 int iu = (patch_bits >> 22) & 0x3ff;
174 int iv = (patch_bits >> 12) & 0x3ff;
181 *u = (*u - pu) /
frac;
192 int index_base =
kernel_data_fetch(patches, handle->array_index + 2) + handle->vert_index;
195 for (
int i = 0; i < 16; i++) {
215 bool non_quad_root = (patch_bits >> 4) & 0x1;
224 float s[4],
t[4], ds[4], dt[4];
232 for (
int k = 0; k < 4; k++) {
233 for (
int l = 0;
l < 4;
l++) {
234 weights[4 * k +
l] = s[
l] *
t[k];
235 weights_du[4 * k +
l] = ds[
l] *
t[k] * d_scale;
236 weights_dv[4 * k +
l] = s[
l] * dt[k] * d_scale;
281 kg, sd->object, patch, u,
v, channel,
indices, weights, weights_du, weights_dv);
289 for (
int i = 0; i < num_control; i++) {
292 val +=
v * weights[i];
294 *du +=
v * weights_du[i];
296 *dv +=
v * weights_dv[i];
318 kg, sd->object, patch, u,
v, channel,
indices, weights, weights_du, weights_dv);
326 for (
int i = 0; i < num_control; i++) {
329 val +=
v * weights[i];
331 *du +=
v * weights_du[i];
333 *dv +=
v * weights_dv[i];
355 kg, sd->object, patch, u,
v, channel,
indices, weights, weights_du, weights_dv);
363 for (
int i = 0; i < num_control; i++) {
366 val +=
v * weights[i];
368 *du +=
v * weights_du[i];
370 *dv +=
v * weights_dv[i];
392 kg, sd->object, patch, u,
v, channel,
indices, weights, weights_du, weights_dv);
400 for (
int i = 0; i < num_control; i++) {
403 val +=
v * weights[i];
405 *du +=
v * weights_du[i];
407 *dv +=
v * weights_dv[i];
429 kg, sd->object, patch, u,
v, channel,
indices, weights, weights_du, weights_dv);
437 for (
int i = 0; i < num_control; i++) {
441 val +=
v * weights[i];
443 *du +=
v * weights_du[i];
445 *dv +=
v * weights_dv[i];
typedef float(TangentPoint)[2]
_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 GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
in reality light always falls off quadratically Particle Retrieve the data of the particle that spawned the object for example to give variation to multiple instances of an object Point Retrieve information about points in a point cloud Retrieve the edges of an object as it appears to Cycles topology will always appear triangulated Convert a blackbody temperature to an RGB value Normal Generate a perturbed normal from an RGB normal map image Typically used for faking highly detailed surfaces Generate an OSL shader from a file or text data block Image Sample an image file as a texture Sky Generate a procedural sky texture Noise Generate fractal Perlin noise Wave Generate procedural bands or rings with noise Voronoi Generate Worley noise based on the distance to random points Typically used to generate textures such as or biological cells Brick Generate a procedural texture producing bricks Texture Retrieve multiple types of texture coordinates nTypically used as inputs for texture nodes Vector Convert a point
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
#define kernel_assert(cond)
#define ccl_device_inline
#define CCL_NAMESPACE_END
const KernelGlobalsCPU *ccl_restrict KernelGlobals
#define kernel_data_fetch(name, index)
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
ccl_gpu_kernel_postfix int ccl_global int * indices
ccl_device_inline uint object_patch_map_offset(KernelGlobals kg, int object)
ccl_device_inline void patch_eval_bspline_weights(float t, ccl_private float *point, ccl_private float *deriv)
ccl_device float patch_eval_float(KernelGlobals kg, ccl_private const ShaderData *sd, int offset, int patch, float u, float v, int channel, ccl_private float *du, ccl_private float *dv)
ccl_device_inline int patch_map_resolve_quadrant(float median, ccl_private float *u, ccl_private float *v)
ccl_device_inline int patch_eval_indices(KernelGlobals kg, ccl_private const PatchHandle *handle, int channel, int indices[PATCH_MAX_CONTROL_VERTS])
ccl_device float2 patch_eval_float2(KernelGlobals kg, ccl_private const ShaderData *sd, int offset, int patch, float u, float v, int channel, ccl_private float2 *du, ccl_private float2 *dv)
ccl_device_inline int patch_eval_control_verts(KernelGlobals kg, int object, int patch, float u, float v, int channel, int indices[PATCH_MAX_CONTROL_VERTS], float weights[PATCH_MAX_CONTROL_VERTS], float weights_du[PATCH_MAX_CONTROL_VERTS], float weights_dv[PATCH_MAX_CONTROL_VERTS])
ccl_device float3 patch_eval_float3(KernelGlobals kg, ccl_private const ShaderData *sd, int offset, int patch, float u, float v, int channel, ccl_private float3 *du, ccl_private float3 *dv)
ccl_device float4 patch_eval_float4(KernelGlobals kg, ccl_private const ShaderData *sd, int offset, int patch, float u, float v, int channel, ccl_private float4 *du, ccl_private float4 *dv)
ccl_device_inline void patch_eval_normalize_coords(uint patch_bits, ccl_private float *u, ccl_private float *v)
ccl_device float4 patch_eval_uchar4(KernelGlobals kg, ccl_private const ShaderData *sd, int offset, int patch, float u, float v, int channel, ccl_private float4 *du, ccl_private float4 *dv)
ccl_device_inline void patch_eval_adjust_boundary_weights(uint bits, ccl_private float *s, ccl_private float *t)
ccl_device_inline float patch_eval_param_fraction(uint patch_bits)
ccl_device_inline PatchHandle patch_map_find_patch(KernelGlobals kg, int object, int patch, float u, float v)
CCL_NAMESPACE_BEGIN struct PatchHandle PatchHandle
ccl_device_inline void patch_eval_basis(KernelGlobals kg, ccl_private const PatchHandle *handle, float u, float v, float weights[PATCH_MAX_CONTROL_VERTS], float weights_du[PATCH_MAX_CONTROL_VERTS], float weights_dv[PATCH_MAX_CONTROL_VERTS])
ccl_device_inline int patch_eval_depth(uint patch_bits)
#define PATCH_MAP_NODE_IS_SET
#define PATCH_MAX_CONTROL_VERTS
#define PATCH_MAP_NODE_IS_LEAF
#define PATCH_MAP_NODE_INDEX_MASK
ccl_device_inline float4 zero_float4()
ccl_device_inline float frac(float x, int *ix)
ccl_device_inline float4 color_uchar4_to_float4(uchar4 c)
ccl_device float4 color_srgb_to_linear_v4(float4 c)