21 #if (defined(__GNUC__) && !defined(__clang__)) && defined(NDEBUG)
22 # pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
23 # pragma GCC diagnostic ignored "-Wuninitialized"
69 memcpy((
void *)&m, &
t,
sizeof(m));
75 memcpy((
void *)&m, &
t,
sizeof(m));
130 : texture_system(texture_system)
143 OSL::TransformationPtr xform,
150 KernelGlobals *
kg = sd->osl_globals;
151 int object = sd->object;
154 #ifdef __OBJECT_MOTION__
157 if (
time == sd->time)
160 tfm = object_fetch_transform_motion_test(
kg,
object,
time,
NULL);
180 OSL::TransformationPtr xform,
187 KernelGlobals *
kg = sd->osl_globals;
188 int object = sd->object;
191 #ifdef __OBJECT_MOTION__
194 if (
time == sd->time)
197 object_fetch_transform_motion_test(
kg,
object,
time, &itfm);
221 KernelGlobals *
kg = sd->osl_globals;
253 KernelGlobals *
kg = sd->osl_globals;
281 OSL::TransformationPtr xform)
287 int object = sd->object;
290 #ifdef __OBJECT_MOTION__
293 KernelGlobals *
kg = sd->osl_globals;
312 OSL::TransformationPtr xform)
318 int object = sd->object;
321 #ifdef __OBJECT_MOTION__
324 KernelGlobals *
kg = sd->osl_globals;
344 KernelGlobals *
kg = sd->osl_globals;
371 KernelGlobals *
kg = sd->osl_globals;
407 float *fval = (
float *)val;
426 else if (
type == TypeDesc::TypePoint ||
type == TypeDesc::TypeVector ||
427 type == TypeDesc::TypeNormal ||
type == TypeDesc::TypeColor) {
428 float *fval = (
float *)val;
446 else if (
type == TypeDesc::TypeFloat) {
447 float *fval = (
float *)val;
475 float *fval = (
float *)val;
494 else if (
type == TypeDesc::TypePoint ||
type == TypeDesc::TypeVector ||
495 type == TypeDesc::TypeNormal ||
type == TypeDesc::TypeColor) {
496 float *fval = (
float *)val;
514 else if (
type == TypeDesc::TypeFloat) {
515 float *fval = (
float *)val;
550 float *fval = (
float *)val;
570 else if (
type == TypeDesc::TypePoint ||
type == TypeDesc::TypeVector ||
571 type == TypeDesc::TypeNormal ||
type == TypeDesc::TypeColor) {
587 else if (
type == TypeDesc::TypeFloat) {
613 float *fval = (
float *)val;
632 else if (
type == TypeDesc::TypePoint ||
type == TypeDesc::TypeVector ||
633 type == TypeDesc::TypeNormal ||
type == TypeDesc::TypeColor) {
634 float *fval = (
float *)val;
651 else if (
type == TypeDesc::TypeFloat) {
652 float *fval = (
float *)val;
679 if (
type.basetype == TypeDesc::INT &&
type.aggregate == TypeDesc::SCALAR &&
type.arraylen == 0) {
680 int *ival = (
int *)val;
696 if (
type.basetype == TypeDesc::STRING &&
type.aggregate == TypeDesc::SCALAR &&
697 type.arraylen == 0) {
698 ustring *sval = (ustring *)val;
715 float *fval = (
float *)val;
729 if (
type.arraylen > 3)
730 memset(fval + 3 * 3, 0,
sizeof(
float) * 3 * (
type.arraylen - 3));
732 memset(fval +
type.arraylen * 3, 0,
sizeof(
float) * 2 * 3 *
type.arraylen);
742 if (
type == TypeDesc::TypeMatrix) {
752 const OSLGlobals::Attribute &attr,
753 const TypeDesc &
type,
757 if (attr.type == TypeDesc::TypePoint || attr.type == TypeDesc::TypeVector ||
758 attr.type == TypeDesc::TypeNormal || attr.type == TypeDesc::TypeColor) {
760 if (primitive_is_volume_attribute(sd, attr.desc)) {
761 fval[0] = primitive_volume_attribute_float3(
kg, sd, attr.desc);
764 memset(fval, 0,
sizeof(fval));
766 kg, sd, attr.desc, (derivatives) ? &fval[1] :
NULL, (derivatives) ? &fval[2] :
NULL);
771 if (primitive_is_volume_attribute(sd, attr.desc)) {
772 assert(!
"Float2 attribute not support for volumes");
778 kg, sd, attr.desc, (derivatives) ? &fval[1] :
NULL, (derivatives) ? &fval[2] :
NULL);
782 else if (attr.type == TypeDesc::TypeFloat) {
784 if (primitive_is_volume_attribute(sd, attr.desc)) {
785 memset(fval, 0,
sizeof(fval));
786 fval[0] = primitive_volume_attribute_float(
kg, sd, attr.desc);
790 kg, sd, attr.desc, (derivatives) ? &fval[1] :
NULL, (derivatives) ? &fval[2] :
NULL);
794 else if (attr.type == TypeDesc::TypeFloat4 || attr.type ==
TypeRGBA) {
796 if (primitive_is_volume_attribute(sd, attr.desc)) {
797 memset(fval, 0,
sizeof(fval));
798 fval[0] = primitive_volume_attribute_float4(
kg, sd, attr.desc);
802 kg, sd, attr.desc, (derivatives) ? &fval[1] :
NULL, (derivatives) ? &fval[2] :
NULL);
813 const OSLGlobals::Attribute &attr,
814 const TypeDesc &
type,
818 if (attr.type == TypeDesc::TypeMatrix) {
832 if (attr.type == TypeDesc::TypePoint || attr.type == TypeDesc::TypeVector ||
833 attr.type == TypeDesc::TypeNormal || attr.type == TypeDesc::TypeColor) {
839 else if (attr.type == TypeDesc::TypeFloat) {
842 else if (attr.type ==
TypeRGBA || attr.type == TypeDesc::TypeFloat4) {
845 else if (attr.type ==
type) {
846 size_t datasize = attr.value.datasize();
848 memcpy(val, attr.value.data(), datasize);
850 memset((
char *)val + datasize, 0, datasize * 2);
861 KernelGlobals *
kg,
ShaderData *sd, ustring name, TypeDesc
type,
bool derivatives,
void *val)
967 ustring object_name =
kg->osl->object_names[sd->object];
980 float f = curve_thickness(
kg, sd);
984 float3 f = curve_tangent_normal(
kg, sd);
992 KernelGlobals *
kg,
ShaderData *sd, ustring name, TypeDesc
type,
bool derivatives,
void *val)
996 float f = sd->ray_length;
1002 int f =
state->bounce;
1008 int f =
state->diffuse_bounce;
1014 int f =
state->glossy_bounce;
1020 int f =
state->transmission_bounce;
1026 int f =
state->transparent_bounce;
1032 int f =
state->transmission_bounce;
1035 else if (name ==
u_ndc) {
1037 OSLThreadData *tdata =
kg->osl_tdata;
1038 OSL::ShaderGlobals *globals = &tdata->globals;
1067 ustring object_name,
1072 if (sg ==
NULL || sg->renderstate ==
NULL)
1080 ShaderData *sd,
bool derivatives, ustring object_name, TypeDesc
type, ustring name,
void *val)
1082 KernelGlobals *
kg = sd->osl_globals;
1088 OSLGlobals::ObjectNameMap::iterator it =
kg->osl->object_name_map.find(object_name);
1090 if (it ==
kg->osl->object_name_map.end())
1093 object = it->second;
1096 object = sd->object;
1105 OSLGlobals::AttributeMap &attribute_map =
kg->osl->attribute_map[object];
1106 OSLGlobals::AttributeMap::iterator it = attribute_map.find(name);
1108 if (it != attribute_map.end()) {
1109 const OSLGlobals::Attribute &attr = it->second;
1126 kg, sd, name,
type, derivatives, val);
1128 if (is_std_object_attribute)
1138 bool derivatives, ustring name, TypeDesc
type, OSL::ShaderGlobals *sg,
void *val)
1143 #if OSL_LIBRARY_VERSION_CODE >= 11100
1145 OSL::ShadingContext *)
1151 OSLTextureHandleMap::iterator it =
textures.find(filename);
1156 return (TextureSystem::TextureHandle *)it->second.get();
1161 OSL::TextureSystem *ts = texture_system;
1162 TextureSystem::TextureHandle *handle = ts->get_texture_handle(filename);
1163 if (handle ==
NULL) {
1174 it->second->oiio_handle = handle;
1175 return (TextureSystem::TextureHandle *)it->second.get();
1192 TextureHandle *texture_handle,
1193 TexturePerthread *texture_thread_info,
1195 OSL::ShaderGlobals *sg,
1206 ustring *errormessage)
1211 KernelGlobals *kernel_globals = sd->osl_globals;
1212 bool status =
false;
1214 switch (texture_type) {
1217 if (nchannels >= 3) {
1219 int num_samples = (int)s;
1221 float3 N = svm_bevel(kernel_globals, sd,
state, radius, num_samples);
1232 int num_samples = (int)s;
1245 result[0] = svm_ao(kernel_globals, sd,
N,
state, radius, num_samples, flags);
1274 if (texture_thread_info ==
NULL) {
1275 OSLThreadData *tdata = kernel_globals->osl_tdata;
1276 texture_thread_info = tdata->oiio_thread_info;
1280 texture_thread_info,
1294 status = ts->texture(filename,
1321 if (nchannels == 3 || nchannels == 4) {
1335 TextureHandle *texture_handle,
1336 TexturePerthread *texture_thread_info,
1338 OSL::ShaderGlobals *sg,
1348 ustring *errormessage)
1352 bool status =
false;
1354 switch (texture_type) {
1358 KernelGlobals *kernel_globals = sd->osl_globals;
1378 if (texture_thread_info ==
NULL) {
1380 KernelGlobals *kernel_globals = sd->osl_globals;
1381 OSLThreadData *tdata = kernel_globals->osl_tdata;
1382 texture_thread_info = tdata->oiio_thread_info;
1386 texture_thread_info,
1399 status = ts->texture3d(filename,
1431 if (nchannels == 3 || nchannels == 4) {
1445 TextureHandle *texture_handle,
1446 TexturePerthread *thread_info,
1448 OSL::ShaderGlobals *sg,
1456 ustring *errormessage)
1460 bool status =
false;
1463 if (thread_info ==
NULL) {
1465 KernelGlobals *kernel_globals = sd->osl_globals;
1466 OSLThreadData *tdata = kernel_globals->osl_tdata;
1467 thread_info = tdata->oiio_thread_info;
1482 status = ts->environment(
1483 filename,
options,
R, dRdx, dRdy, nchannels,
result, dresultds, dresultdt);
1487 if (nchannels == 3 || nchannels == 4) {
1503 #if OSL_LIBRARY_VERSION_CODE >= 11100
1505 TextureHandle *texture_handle,
1507 OSL::ShadingContext *,
1516 TextureHandle *texture_handle,
1531 OSL::TextureSystem *ts = texture_system;
1532 return ts->get_texture_info(filename, subimage,
dataname, datatype,
data);
1541 size_t *out_indices,
1542 float *out_distances,
1563 const ustring *
names,
1564 const TypeDesc *
types,
1571 OSL::ShaderGlobals *sg,
1588 ray.
time = sd->time;
1592 if (ray.
P == sd->P) {
1593 bool transmit = (
dot(sd->Ng, ray.
D) < 0.0f);
1594 ray.
P =
ray_offset(sd->P, (transmit) ? -sd->Ng : sd->Ng);
1609 OSLTraceData *tracedata = (OSLTraceData *)sg->tracedata;
1610 tracedata->ray = ray;
1611 tracedata->setup =
false;
1612 tracedata->init =
true;
1613 tracedata->hit =
false;
1614 tracedata->sd.osl_globals = sd->osl_globals;
1616 KernelGlobals *
kg = sd->osl_globals;
1626 return tracedata->hit;
1636 OSLTraceData *tracedata = (OSLTraceData *)sg->tracedata;
1638 if (source ==
u_trace && tracedata->init) {
1639 if (name ==
u_hit) {
1642 else if (tracedata->hit) {
1644 float f[3] = {tracedata->isect.t, 0.0f, 0.0f};
1649 KernelGlobals *
kg = sd->osl_globals;
1651 if (!tracedata->setup) {
1654 tracedata->setup =
true;
1660 else if (name ==
u_Ng) {
1663 else if (name ==
u_P) {
1664 float3 f[3] = {sd->P, sd->dP.dx, sd->dP.dy};
1667 else if (name ==
u_I) {
1668 float3 f[3] = {sd->I, sd->dI.dx, sd->dI.dy};
1671 else if (name ==
u_u) {
1672 float f[3] = {sd->u, sd->du.dx, sd->du.dy};
1675 else if (name ==
u_v) {
1676 float f[3] = {sd->v, sd->dv.dx, sd->dv.dy};
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 type
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint * textures
_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
void sort(btMatrix3x3 &U, btVector3 &sigma, btMatrix3x3 &V, int t)
Helper function of 3X3 SVD for sorting singular values.
static void to_scene_linear(ustring colorspace, T *pixels, size_t num_pixels, bool compress_as_srgb)
static ustring u_path_transmission_depth
static ustring u_particle_location
bool pointcloud_write(OSL::ShaderGlobals *sg, ustring filename, const OSL::Vec3 &pos, int nattribs, const ustring *names, const TypeDesc *types, const void **data) override
bool get_inverse_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time) override
static ustring u_curve_thickness
static ustring u_particle_index
static ustring u_curve_tangent_normal
static ustring u_path_diffuse_depth
static bool get_object_standard_attribute(KernelGlobals *kg, ShaderData *sd, ustring name, TypeDesc type, bool derivatives, void *val)
bool get_matrix(OSL::ShaderGlobals *sg, OSL::Matrix44 &result, OSL::TransformationPtr xform, float time) override
static ustring u_material_index
static ustring u_path_ray_depth
static bool get_background_attribute(KernelGlobals *kg, ShaderData *sd, ustring name, TypeDesc type, bool derivatives, void *val)
static ustring u_is_smooth
static ustring u_object_location
static ustring u_curve_random
int pointcloud_get(OSL::ShaderGlobals *sg, ustring filename, size_t *indices, int count, ustring attr_name, TypeDesc attr_type, void *out_data) override
static ustring u_particle_rotation
OSL::TextureSystem * texture_system
static ustring u_particle_velocity
static ustring u_particle_angular_velocity
static ustring u_path_glossy_depth
static ustring u_geom_dupli_uv
static ustring u_geom_undisplaced
static ustring u_geom_numpolyvertices
static ustring u_object_random
static ustring u_path_ray_length
bool getmessage(OSL::ShaderGlobals *sg, ustring source, ustring name, TypeDesc type, void *val, bool derivatives) override
bool environment(ustring filename, TextureHandle *texture_handle, TexturePerthread *texture_thread_info, TextureOpt &options, OSL::ShaderGlobals *sg, const OSL::Vec3 &R, const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy, int nchannels, float *result, float *dresultds, float *dresultdt, ustring *errormessage) override
bool get_attribute(OSL::ShaderGlobals *sg, bool derivatives, ustring object, TypeDesc type, ustring name, void *val) override
static ustring u_particle_random
static ustring u_particle_age
OSLRenderServices(OSL::TextureSystem *texture_system)
bool texture(ustring filename, TextureSystem::TextureHandle *texture_handle, TexturePerthread *texture_thread_info, TextureOpt &options, OSL::ShaderGlobals *sg, float s, float t, float dsdx, float dtdx, float dsdy, float dtdy, int nchannels, float *result, float *dresultds, float *dresultdt, ustring *errormessage) override
bool get_texture_info(OSL::ShaderGlobals *sg, ustring filename, TextureHandle *texture_handle, int subimage, ustring dataname, TypeDesc datatype, void *data) override
static ustring u_object_index
static ustring u_path_transparent_depth
TextureSystem::TextureHandle * get_texture_handle(ustring filename) override
bool trace(TraceOpt &options, OSL::ShaderGlobals *sg, const OSL::Vec3 &P, const OSL::Vec3 &dPdx, const OSL::Vec3 &dPdy, const OSL::Vec3 &R, const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy) override
static ustring u_particle_lifetime
bool texture3d(ustring filename, TextureHandle *texture_handle, TexturePerthread *texture_thread_info, TextureOpt &options, OSL::ShaderGlobals *sg, const OSL::Vec3 &P, const OSL::Vec3 &dPdx, const OSL::Vec3 &dPdy, const OSL::Vec3 &dPdz, int nchannels, float *result, float *dresultds, float *dresultdt, float *dresultdr, ustring *errormessage) override
static ustring u_is_curve
static ustring u_object_color
static ustring u_distance
bool get_userdata(bool derivatives, ustring name, TypeDesc type, OSL::ShaderGlobals *sg, void *val) override
static ustring u_geom_trianglevertices
bool get_array_attribute(OSL::ShaderGlobals *sg, bool derivatives, ustring object, TypeDesc type, ustring name, int index, void *val) override
static ustring u_geom_polyvertices
static ustring u_particle_size
int pointcloud_search(OSL::ShaderGlobals *sg, ustring filename, const OSL::Vec3 ¢er, float radius, int max_points, bool sort, size_t *out_indices, float *out_distances, int derivs_offset) override
static ustring u_geom_dupli_generated
bool good(TextureSystem::TextureHandle *texture_handle) override
static ustring u_geom_name
CCL_NAMESPACE_BEGIN struct Options options
ccl_device_inline uint attribute_primitive_type(KernelGlobals *kg, const ShaderData *sd)
ccl_device Transform primitive_attribute_matrix(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc)
ccl_device_inline void motion_triangle_vertices(KernelGlobals *kg, int object, int prim, float time, float3 verts[3])
ccl_device_inline float3 object_location(KernelGlobals *kg, const ShaderData *sd)
ccl_device float4 particle_rotation(KernelGlobals *kg, int particle)
@ OBJECT_INVERSE_TRANSFORM
ccl_device_inline float object_random_number(KernelGlobals *kg, int object)
ccl_device_inline float3 object_dupli_uv(KernelGlobals *kg, int object)
ccl_device_inline uint particle_index(KernelGlobals *kg, int particle)
ccl_device float3 particle_location(KernelGlobals *kg, int particle)
ccl_device_inline void object_position_transform(KernelGlobals *kg, const ShaderData *sd, float3 *P)
ccl_device float particle_lifetime(KernelGlobals *kg, int particle)
ccl_device float3 particle_velocity(KernelGlobals *kg, int particle)
ccl_device_inline float object_pass_id(KernelGlobals *kg, int object)
ccl_device int shader_pass_id(KernelGlobals *kg, const ShaderData *sd)
ccl_device_inline float3 object_color(KernelGlobals *kg, int object)
ccl_device float3 particle_angular_velocity(KernelGlobals *kg, int particle)
ccl_device float particle_size(KernelGlobals *kg, int particle)
ccl_device float particle_age(KernelGlobals *kg, int particle)
ccl_device_inline int object_particle_id(KernelGlobals *kg, int object)
ccl_device_inline float3 object_dupli_generated(KernelGlobals *kg, int object)
ccl_device_inline Transform object_fetch_transform(KernelGlobals *kg, int object, enum ObjectTransform type)
ccl_device_inline float4 primitive_surface_attribute_float4(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc, float4 *dx, float4 *dy)
ccl_device_inline float2 primitive_surface_attribute_float2(KernelGlobals *kg, const ShaderData *sd, const AttributeDescriptor desc, float2 *dx, float2 *dy)
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)
ccl_device_inline void triangle_vertices(KernelGlobals *kg, int prim, float3 P[3])
ccl_device_inline float3 ray_offset(float3 P, float3 Ng)
ccl_device_intersect bool scene_intersect(KernelGlobals *kg, const Ray *ray, const uint visibility, Intersection *isect)
ccl_device_inline float3 camera_world_to_ndc(KernelGlobals *kg, ShaderData *sd, float3 P)
#define CCL_NAMESPACE_END
#define make_float2(x, y)
#define make_float4(x, y, z, w)
#define make_float3(x, y, z)
CCL_NAMESPACE_BEGIN ccl_device_noinline void shader_setup_from_ray(KernelGlobals *kg, ShaderData *sd, const Intersection *isect, const Ray *ray)
@ PATH_RAY_ALL_VISIBILITY
@ SD_OBJECT_TRANSFORM_APPLIED
ccl_device float4 kernel_tex_image_interp(KernelGlobals *kg, int id, float x, float y)
ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals *kg, int id, float3 P, InterpolationType interp)
static const VertexNature POINT
static bool set_attribute_string(ustring str, TypeDesc type, bool derivatives, void *val)
static bool set_attribute_float2(float2 f[3], TypeDesc type, bool derivatives, void *val)
static bool set_attribute_float3_3(float3 P[3], TypeDesc type, bool derivatives, void *val)
static bool set_attribute_int(int i, TypeDesc type, bool derivatives, void *val)
static bool set_attribute_matrix(const Transform &tfm, TypeDesc type, void *val)
static bool set_attribute_float4(float4 f[3], TypeDesc type, bool derivatives, void *val)
static bool get_object_attribute(const OSLGlobals::Attribute &attr, TypeDesc type, bool derivatives, void *val)
static bool get_mesh_attribute(KernelGlobals *kg, const ShaderData *sd, const OSLGlobals::Attribute &attr, const TypeDesc &type, bool derivatives, void *val)
static bool set_attribute_float(float f[3], TypeDesc type, bool derivatives, void *val)
static bool set_attribute_float3(float3 f[3], TypeDesc type, bool derivatives, void *val)
static CCL_NAMESPACE_BEGIN void copy_matrix(OSL::Matrix44 &m, const Transform &tfm)
static bool get_primitive_attribute(KernelGlobals *kg, const ShaderData *sd, const OSLGlobals::Attribute &attr, const TypeDesc &type, bool derivatives, void *val)
static const char * dataname(short id_code)
ColorSpaceProcessor * processor
OSL::TextureSystem::TextureHandle * oiio_handle
ccl_device_inline float kernel_ies_interp(KernelGlobals *kg, int slot, float h_angle, float v_angle)
ccl_device_inline float hash_uint2_to_float(uint kx, uint ky)
ccl_device_inline float3 float4_to_float3(const float4 a)
ccl_device_inline float dot(const float2 &a, const float2 &b)
ccl_device_inline float average(const float2 &a)
static constexpr TypeDesc TypeFloatArray4(TypeDesc::FLOAT, TypeDesc::SCALAR, TypeDesc::NOSEMANTICS, 4)
static constexpr TypeDesc TypeRGBA(TypeDesc::FLOAT, TypeDesc::VEC4, TypeDesc::COLOR)
CCL_NAMESPACE_BEGIN static constexpr OIIO_NAMESPACE_USING TypeDesc TypeFloat2(TypeDesc::FLOAT, TypeDesc::VEC2)
CCL_NAMESPACE_BEGIN struct ProjectionTransform ProjectionTransform
ccl_device_inline ProjectionTransform projection_transpose(const ProjectionTransform &a)