11#include "util/color.h"
61 for (
int depth = 0; depth < 0xff; depth++) {
62 float delta = median * 0.5f;
103 float inv_6 = 1.0f / 6.0f;
108 point[0] = inv_6 * (1.0f - 3.0f * (t - t2) - t3);
109 point[1] = inv_6 * (4.0f - 6.0f * t2 + 3.0f * t3);
110 point[2] = inv_6 * (1.0f + 3.0f * (t + t2 - t3));
111 point[3] = inv_6 * t3;
114 deriv[0] = -0.5f * t2 + t - 0.5f;
115 deriv[1] = 1.5f * t2 - 2.0f * t;
116 deriv[2] = -1.5f * t2 + t + 0.5f;
117 deriv[3] = 0.5f * t2;
124 int boundary = ((bits >> 8) & 0xf);
153 return (patch_bits & 0xf);
158 bool non_quad_root = (patch_bits >> 4) & 0x1;
162 return 1.0f / (
float)(1 << (depth - 1));
165 return 1.0f / (
float)(1 << depth);
175 int iu = (patch_bits >> 22) & 0x3ff;
176 int iv = (patch_bits >> 12) & 0x3ff;
183 *u = (*u - pu) /
frac;
194 int index_base =
kernel_data_fetch(patches, handle->array_index + 2) + handle->vert_index;
197 for (
int i = 0; i < 16; i++) {
217 bool non_quad_root = (patch_bits >> 4) & 0x1;
226 float s[4], t[4], ds[4], dt[4];
234 for (
int k = 0; k < 4; k++) {
235 for (
int l = 0;
l < 4;
l++) {
236 weights[4 * k +
l] = s[
l] * t[k];
237 weights_du[4 * k +
l] = ds[
l] * t[k] * d_scale;
238 weights_dv[4 * k +
l] = s[
l] * dt[k] * d_scale;
283 kg, sd->object, patch, u,
v, channel,
indices, weights, weights_du, weights_dv);
293 for (
int i = 0; i < num_control; i++) {
296 val +=
v * weights[i];
298 *du +=
v * weights_du[i];
301 *dv +=
v * weights_dv[i];
324 kg, sd->object, patch, u,
v, channel,
indices, weights, weights_du, weights_dv);
332 for (
int i = 0; i < num_control; i++) {
335 val +=
v * weights[i];
337 *du +=
v * weights_du[i];
340 *dv +=
v * weights_dv[i];
363 kg, sd->object, patch, u,
v, channel,
indices, weights, weights_du, weights_dv);
373 for (
int i = 0; i < num_control; i++) {
376 val +=
v * weights[i];
378 *du +=
v * weights_du[i];
381 *dv +=
v * weights_dv[i];
404 kg, sd->object, patch, u,
v, channel,
indices, weights, weights_du, weights_dv);
412 for (
int i = 0; i < num_control; i++) {
415 val +=
v * weights[i];
417 *du +=
v * weights_du[i];
420 *dv +=
v * weights_dv[i];
443 kg, sd->object, patch, u,
v, channel,
indices, weights, weights_du, weights_dv);
451 for (
int i = 0; i < num_control; i++) {
455 val +=
v * weights[i];
457 *du +=
v * weights_du[i];
460 *dv +=
v * weights_dv[i];
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 Gabor Generate Gabor noise Gradient Generate interpolated color and intensity values based on the input vector Magic Generate a psychedelic color texture 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
CCL_NAMESPACE_BEGIN ccl_device_inline float frac(float x, ccl_private int *ix)
#define kernel_assert(cond)
const KernelGlobalsCPU *ccl_restrict KernelGlobals
#define kernel_data_fetch(name, index)
#define ccl_device_inline
#define CCL_NAMESPACE_END
draw_view in_light_buf[] float
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_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_NAMESPACE_BEGIN ccl_device_inline float4 zero_float4()
VecBase< float, 4 > float4
ccl_device_inline float4 color_uchar4_to_float4(uchar4 c)
ccl_device float4 color_srgb_to_linear_v4(float4 c)