39 #ifdef __OBJECT_MOTION__
43 sd->ob_tfm = object_fetch_transform_motion(
kg, sd->object,
time);
53 #ifdef __KERNEL_OPTIX__
70 sd->type = isect->
type;
75 #ifdef __OBJECT_MOTION__
76 shader_setup_object_transforms(
kg, sd, ray->
time);
81 sd->ray_length = isect->
t;
89 curve_shader_setup(
kg, sd, isect, ray);
132 bool backfacing = (
dot(sd->Ng, sd->I) < 0.0f);
139 sd->dPdu = -sd->dPdu;
140 sd->dPdv = -sd->dPdv;
144 #ifdef __RAY_DIFFERENTIALS__
157 #ifdef __SUBSURFACE__
158 # ifndef __KERNEL_CUDA__
164 shader_setup_from_subsurface(KernelGlobals *
kg,
177 sd->type = isect->
type;
223 sd->dPdu = -sd->dPdu;
224 sd->dPdv = -sd->dPdv;
232 # ifdef __RAY_DIFFERENTIALS__
289 #ifdef __OBJECT_MOTION__
290 shader_setup_object_transforms(
kg, sd,
time);
340 bool backfacing = (
dot(sd->Ng, sd->I) < 0.0f);
347 sd->dPdu = -sd->dPdu;
348 sd->dPdv = -sd->dPdv;
353 #ifdef __RAY_DIFFERENTIALS__
368 KernelGlobals *
kg,
ShaderData *sd,
int object,
int prim,
float u,
float v)
408 sd->shader =
kernel_data.background.surface_shader;
411 sd->time = ray->
time;
412 sd->ray_length = 0.0f;
426 #ifdef __RAY_DIFFERENTIALS__
456 sd->time = ray->
time;
457 sd->ray_length = 0.0f;
473 # ifdef __RAY_DIFFERENTIALS__
483 sd->ray_dP = ray->
dP;
492 #if defined(__BRANCHED_PATH__) || defined(__VOLUME__)
496 for (
int i = 0; i < sd->num_closure; i++) {
499 for (
int j = i + 1; j < sd->num_closure; j++) {
502 if (sci->type != scj->type)
507 sci->weight += scj->weight;
508 sci->sample_weight += scj->sample_weight;
510 int size = sd->num_closure - (j + 1);
512 for (
int k = 0; k <
size; k++) {
532 if (
state->bounce +
state->transparent_bounce == 0 && sd->num_closure > 1) {
535 for (
int i = 0; i < sd->num_closure; i++) {
538 sum += sc->sample_weight;
542 for (
int i = 0; i < sd->num_closure; i++) {
545 sc->sample_weight =
max(sc->sample_weight, 0.125f *
sum);
560 float sum_sample_weight)
564 for (
int i = 0; i < sd->num_closure; i++) {
568 float bsdf_pdf = 0.0f;
571 if (bsdf_pdf != 0.0f) {
573 sum_pdf += bsdf_pdf * sc->sample_weight;
576 sum_sample_weight += sc->sample_weight;
580 *pdf = (sum_sample_weight > 0.0f) ? sum_pdf / sum_sample_weight : 0.0f;
583 #ifdef __BRANCHED_PATH__
591 for (
int i = 0; i < sd->num_closure; i++) {
594 float bsdf_pdf = 0.0f;
596 if (bsdf_pdf != 0.0f) {
597 float mis_weight = use_mis ?
power_heuristic(light_pdf, bsdf_pdf) : 1.0f;
605 #ifndef __KERNEL_CUDA__
622 #ifdef __BRANCHED_PATH__
624 _shader_bsdf_multi_eval_branched(
kg, sd, omega_in, eval, light_pdf, use_mis);
643 if (sd->num_closure > 1) {
647 for (
int i = 0; i < sd->num_closure; i++) {
651 sum += sc->sample_weight;
655 float r = (*randu) *
sum;
656 float partial_sum = 0.0f;
658 for (
int i = 0; i < sd->num_closure; i++) {
662 float next_sum = partial_sum + sc->sample_weight;
668 *randu = (
r - partial_sum) / sc->sample_weight;
672 partial_sum = next_sum;
689 if (sd->num_closure > 1) {
691 float sum_bsdf = 0.0f;
692 float sum_bssrdf = 0.0f;
694 for (
int i = 0; i < sd->num_closure; i++) {
698 sum_bsdf += sc->sample_weight;
701 sum_bssrdf += sc->sample_weight;
705 float r = (*randu) * (sum_bsdf + sum_bssrdf);
706 float partial_sum = 0.0f;
708 for (
int i = 0; i < sd->num_closure; i++) {
712 float next_sum = partial_sum + sc->sample_weight;
716 *throughput *= (sum_bsdf + sum_bssrdf) / sum_bsdf;
720 *throughput *= (sum_bsdf + sum_bssrdf) / sum_bssrdf;
724 *randu = (
r - partial_sum) / sc->sample_weight;
729 partial_sum = next_sum;
767 if (sd->num_closure > 1) {
768 float sweight = sc->sample_weight;
803 float sum_weight = 0.0f;
805 for (
int i = 0; i < sd->num_closure; i++) {
813 sum_weight += weight;
817 return (sum_weight > 0.0f) ?
roughness / sum_weight : 0.0f;
822 for (
int i = 0; i < sd->num_closure; i++) {
836 return sd->closure_transparent_extinction;
846 for (
int i = 0; i < sd->num_closure; i++) {
850 sc->sample_weight = 0.0f;
873 for (
int i = 0; i < sd->num_closure; i++) {
888 for (
int i = 0; i < sd->num_closure; i++) {
902 for (
int i = 0; i < sd->num_closure; i++) {
916 for (
int i = 0; i < sd->num_closure; i++) {
930 for (
int i = 0; i < sd->num_closure; i++) {
935 eval += sc->weight * ao_factor;
944 #ifdef __SUBSURFACE__
949 float texture_blur = 0.0f, weight_sum = 0.0f;
951 for (
int i = 0; i < sd->num_closure; i++) {
960 texture_blur +=
bssrdf->texture_blur * avg_weight;
961 weight_sum += avg_weight;
969 *texture_blur_ =
safe_divide(texture_blur, weight_sum);
998 return sd->closure_emission_background;
1027 weight =
one_float3() - sd->closure_transparent_extinction;
1029 for (
int i = 0; i < sd->num_closure; i++) {
1043 for (
int i = 0; i < sd->num_closure; i++) {
1046 weight += sc->weight;
1072 max_closures =
kernel_data.integrator.max_closures;
1075 sd->num_closure = 0;
1076 sd->num_closure_left = max_closures;
1081 OSLShader::eval_background(
kg, sd,
state, path_flag);
1084 OSLShader::eval_surface(
kg, sd,
state, path_flag);
1094 sd->closure_emission_background =
make_float3(0.8f, 0.8f, 0.8f);
1123 float sum_sample_weight)
1125 for (
int i = 0; i < sd->num_closure; i++) {
1126 if (i == skip_phase)
1132 float phase_pdf = 0.0f;
1135 if (phase_pdf != 0.0f) {
1137 sum_pdf += phase_pdf * sc->sample_weight;
1140 sum_sample_weight += sc->sample_weight;
1144 *pdf = (sum_sample_weight > 0.0f) ? sum_pdf / sum_sample_weight : 0.0f;
1154 _shader_volume_phase_multi_eval(sd, omega_in, pdf, -1, eval, 0.0f, 0.0f);
1157 ccl_device int shader_volume_phase_sample(KernelGlobals *
kg,
1170 if (sd->num_closure > 1) {
1174 for (sampled = 0; sampled < sd->num_closure; sampled++) {
1178 sum += sc->sample_weight;
1181 float r = randu *
sum;
1182 float partial_sum = 0.0f;
1184 for (sampled = 0; sampled < sd->num_closure; sampled++) {
1188 float next_sum = partial_sum + sc->sample_weight;
1190 if (
r <= next_sum) {
1192 randu = (
r - partial_sum) / sc->sample_weight;
1196 partial_sum = next_sum;
1200 if (sampled == sd->num_closure) {
1222 ccl_device int shader_phase_sample_closure(KernelGlobals *
kg,
1262 max_closures =
kernel_data.integrator.max_closures;
1267 sd->num_closure = 0;
1268 sd->num_closure_left = max_closures;
1270 sd->object_flag = 0;
1272 for (
int i = 0; stack[i].shader !=
SHADER_NONE; i++) {
1275 sd->object = stack[i].object;
1277 sd->shader = stack[i].shader;
1286 # ifdef __OBJECT_MOTION__
1289 shader_setup_object_transforms(
kg, sd, sd->time);
1297 OSLShader::eval_volume(
kg, sd,
state, path_flag);
1308 shader_merge_closures(sd);
1320 sd->num_closure = 0;
1321 sd->num_closure_left = 0;
1338 #ifdef __TRANSPARENT_SHADOWS__
MINLINE float safe_sqrtf(float a)
MINLINE float safe_divide(float a, float b)
_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 GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r
_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
ccl_device_inline ShaderClosure * bsdf_alloc(ShaderData *sd, int size, float3 weight)
ATTR_WARN_UNUSED_RESULT const BMVert * v
ccl_device_inline int bsdf_sample(KernelGlobals *kg, ShaderData *sd, const ShaderClosure *sc, float randu, float randv, float3 *eval, float3 *omega_in, differential3 *domega_in, float *pdf)
ccl_device bool bsdf_merge(ShaderClosure *a, ShaderClosure *b)
ccl_device_inline float bsdf_get_roughness_squared(const ShaderClosure *sc)
ccl_device void bsdf_blur(KernelGlobals *kg, ShaderClosure *sc, float roughness)
ccl_device float3 bsdf_eval(KernelGlobals *kg, ShaderData *sd, const ShaderClosure *sc, const float3 omega_in, float *pdf)
ccl_device int bsdf_diffuse_setup(DiffuseBsdf *bsdf)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static T sum(const btAlignedObjectArray< T > &items)
static CCL_NAMESPACE_BEGIN const double alpha
ccl_device float3 emissive_simple_eval(const float3 Ng, const float3 I)
CCL_NAMESPACE_BEGIN ccl_device_noinline void motion_triangle_shader_setup(KernelGlobals *kg, ShaderData *sd, const Intersection *isect, const Ray *ray, bool is_local)
@ OBJECT_INVERSE_TRANSFORM
#define object_normal_transform_auto
#define object_position_transform_auto
#define object_dir_transform_auto
ccl_device_inline Transform object_fetch_transform(KernelGlobals *kg, int object, enum ObjectTransform type)
ccl_device_inline Transform lamp_fetch_transform(KernelGlobals *kg, int lamp, bool inverse)
ccl_device_inline void triangle_dPdudv(KernelGlobals *kg, int prim, ccl_addr_space float3 *dPdu, ccl_addr_space float3 *dPdv)
CCL_NAMESPACE_BEGIN ccl_device_inline float3 triangle_normal(KernelGlobals *kg, ShaderData *sd)
ccl_device_inline void triangle_point_normal(KernelGlobals *kg, int object, int prim, float u, float v, float3 *P, float3 *Ng, int *shader)
ccl_device_inline float3 triangle_smooth_normal(KernelGlobals *kg, float3 Ng, int prim, float u, float v)
ccl_device_inline float3 triangle_refine_local(KernelGlobals *kg, ShaderData *sd, const Intersection *isect, const Ray *ray)
ccl_device_inline float3 triangle_refine(KernelGlobals *kg, ShaderData *sd, const Intersection *isect, const Ray *ray)
ccl_device int volume_phase_sample(const ShaderData *sd, const ShaderClosure *sc, float randu, float randv, float3 *eval, float3 *omega_in, differential3 *domega_in, float *pdf)
ccl_device float3 volume_phase_eval(const ShaderData *sd, const ShaderClosure *sc, float3 omega_in, float *pdf)
CCL_NAMESPACE_END CCL_NAMESPACE_BEGIN ccl_device_noinline void svm_eval_nodes(KernelGlobals *kg, ShaderData *sd, ccl_addr_space PathState *state, ccl_global float *buffer, ShaderType type, int path_flag)
ccl_device_inline void bsdf_eval_init(BsdfEval *eval, ClosureType type, float3 value, int use_light_pass)
ccl_device_inline void bsdf_eval_mis(BsdfEval *eval, float value)
ccl_device_inline void bsdf_eval_accum(BsdfEval *eval, ClosureType type, float3 value, float mis_weight)
#define kernel_assert(cond)
#define kernel_tex_fetch(tex, index)
#define ccl_device_inline
#define ccl_device_noinline
#define CCL_NAMESPACE_END
#define make_float3(x, y, z)
void KERNEL_FUNCTION_FULL_NAME() shader(KernelGlobals *kg, uint4 *input, float4 *output, int type, int filter, int i, int offset, int sample)
ccl_device void differential_incoming(ccl_addr_space differential3 *dI, const differential3 dD)
ccl_device void differential_dudv(ccl_addr_space differential *du, ccl_addr_space differential *dv, float3 dPdu, float3 dPdv, differential3 dP, float3 Ng)
ccl_device differential differential_zero()
ccl_device differential3 differential3_zero()
CCL_NAMESPACE_BEGIN ccl_device void differential_transfer(ccl_addr_space differential3 *dP_, const differential3 dP, float3 D, const differential3 dD, float3 Ng, float t)
ccl_device float power_heuristic(float a, float b)
#define PROFILING_OBJECT(object)
#define PROFILING_INIT(kg, event)
#define PROFILING_SHADER(shader)
ccl_device_inline uint lcg_state_init_addrspace(ccl_addr_space PathState *state, uint scramble)
CCL_NAMESPACE_BEGIN ccl_device_noinline void shader_setup_from_ray(KernelGlobals *kg, ShaderData *sd, const Intersection *isect, const Ray *ray)
ccl_device void shader_bsdf_blur(KernelGlobals *kg, ShaderData *sd, float roughness)
ccl_device_inline const ShaderClosure * shader_bssrdf_pick(ShaderData *sd, ccl_addr_space float3 *throughput, float *randu)
ccl_device float3 shader_bsdf_alpha(KernelGlobals *kg, ShaderData *sd)
ccl_device void shader_eval_surface(KernelGlobals *kg, ShaderData *sd, ccl_addr_space PathState *state, ccl_global float *buffer, int path_flag)
ccl_device void shader_setup_from_displace(KernelGlobals *kg, ShaderData *sd, int object, int prim, float u, float v)
ccl_device_inline void _shader_bsdf_multi_eval(KernelGlobals *kg, ShaderData *sd, const float3 omega_in, float *pdf, const ShaderClosure *skip_sc, BsdfEval *result_eval, float sum_pdf, float sum_sample_weight)
ccl_device float3 shader_bsdf_ao(KernelGlobals *kg, ShaderData *sd, float ao_factor, float3 *N_)
ccl_device float3 shader_bsdf_diffuse(KernelGlobals *kg, ShaderData *sd)
ccl_device_inline void shader_setup_from_sample(KernelGlobals *kg, ShaderData *sd, const float3 P, const float3 Ng, const float3 I, int shader, int object, int prim, float u, float v, float t, float time, bool object_space, int lamp)
ccl_device float3 shader_bsdf_transparency(KernelGlobals *kg, const ShaderData *sd)
ccl_device float3 shader_holdout_apply(KernelGlobals *kg, ShaderData *sd)
ccl_device void shader_bsdf_eval(KernelGlobals *kg, ShaderData *sd, const float3 omega_in, BsdfEval *eval, float light_pdf, bool use_mis)
ccl_device float shader_bsdf_average_roughness(ShaderData *sd)
ccl_device float3 shader_background_eval(ShaderData *sd)
ccl_device void shader_bsdf_disable_transparency(KernelGlobals *kg, ShaderData *sd)
ccl_device_inline const ShaderClosure * shader_bsdf_pick(ShaderData *sd, float *randu)
ccl_device_inline void shader_prepare_closures(ShaderData *sd, ccl_addr_space PathState *state)
ccl_device_inline void shader_setup_from_background(KernelGlobals *kg, ShaderData *sd, const Ray *ray)
ccl_device float shader_cryptomatte_id(KernelGlobals *kg, int shader)
ccl_device int shader_bsdf_sample_closure(KernelGlobals *kg, ShaderData *sd, const ShaderClosure *sc, float randu, float randv, BsdfEval *bsdf_eval, float3 *omega_in, differential3 *domega_in, float *pdf)
ccl_device bool shader_constant_emission_eval(KernelGlobals *kg, int shader, float3 *eval)
ccl_device float3 shader_bsdf_transmission(KernelGlobals *kg, ShaderData *sd)
ccl_device float3 shader_emissive_eval(ShaderData *sd)
ccl_device float3 shader_bsdf_glossy(KernelGlobals *kg, ShaderData *sd)
ccl_device float3 shader_bsdf_average_normal(KernelGlobals *kg, ShaderData *sd)
ccl_device void shader_eval_displacement(KernelGlobals *kg, ShaderData *sd, ccl_addr_space PathState *state)
ccl_device_inline int shader_bsdf_sample(KernelGlobals *kg, ShaderData *sd, float randu, float randv, BsdfEval *bsdf_eval, float3 *omega_in, differential3 *domega_in, float *pdf)
__kernel void ccl_constant KernelData ccl_global void ccl_global char ccl_global int ccl_global char ccl_global unsigned int ccl_global float * buffer
@ SD_HAS_TRANSPARENT_SHADOW
@ SD_HAS_CONSTANT_EMISSION
@ SD_OBJECT_TRANSFORM_APPLIED
static const pxr::TfToken roughness("roughness", pxr::TfToken::Immortal)
closure color bssrdf(string method, normal N, vector radius, color albedo) BUILTIN
static void eval_displacement(SubdivDisplacement *displacement, const int ptex_face_index, const float u, const float v, const float dPdu[3], const float dPdv[3], float r_D[3])
#define CLOSURE_IS_HOLDOUT(type)
#define CLOSURE_IS_BSDF_TRANSPARENT(type)
#define CLOSURE_IS_BSDF_TRANSMISSION(type)
#define CLOSURE_IS_BSDF(type)
@ SHADER_TYPE_DISPLACEMENT
#define CLOSURE_IS_BSDF_GLOSSY(type)
#define CLOSURE_IS_BSDF_BSSRDF(type)
#define CLOSURE_IS_BSDF_DIFFUSE(type)
#define CLOSURE_IS_BSDF_OR_BSSRDF(type)
@ CLOSURE_BSDF_TRANSPARENT_ID
#define CLOSURE_IS_BSSRDF(type)
#define CLOSURE_IS_PHASE(type)
ccl_device_inline int __float_as_int(float f)
ccl_device_inline float2 normalize(const float2 &a)
ccl_device_inline float dot(const float2 &a, const float2 &b)
ccl_device_inline bool is_zero(const float2 &a)
ccl_device_inline float average(const float2 &a)
ccl_device_inline float3 one_float3()
ccl_device_inline float3 zero_float3()
@ PROFILING_CLOSURE_SAMPLE
@ PROFILING_CLOSURE_VOLUME_SAMPLE
@ PROFILING_CLOSURE_VOLUME_EVAL