33 # include <embree3/rtcore_geometry.h>
35 # include "bvh/bvh_embree.h"
57 "Object and Embree max motion steps inconsistent");
59 "Object and Geometry max motion steps inconsistent");
61 # define IS_HAIR(x) (x & 1)
68 static void rtc_filter_occluded_func(
const RTCFilterFunctionNArguments *args)
73 const RTCRay *ray = (RTCRay *)args->ray;
74 RTCHit *hit = (RTCHit *)args->hit;
76 KernelGlobals *
kg = ctx->
kg;
84 for (
size_t i = 0; i < ctx->
max_hits; ++i) {
94 *isect = current_isect;
143 if (IS_HAIR(hit->geomID)) {
193 for (
size_t i = 0; i < ctx->
max_hits; ++i) {
203 *isect = current_isect;
224 static void rtc_filter_func_thick_curve(
const RTCFilterFunctionNArguments *args)
226 const RTCRay *ray = (RTCRay *)args->ray;
227 RTCHit *hit = (RTCHit *)args->hit;
231 make_float3(hit->Ng_x, hit->Ng_y, hit->Ng_z)) > 0.0f) {
237 static void rtc_filter_occluded_func_thick_curve(
const RTCFilterFunctionNArguments *args)
239 const RTCRay *ray = (RTCRay *)args->ray;
240 RTCHit *hit = (RTCHit *)args->hit;
244 make_float3(hit->Ng_x, hit->Ng_y, hit->Ng_z)) > 0.0f) {
249 rtc_filter_occluded_func(args);
252 static size_t unaccounted_mem = 0;
254 static bool rtc_memory_monitor_func(
void *userPtr,
const ssize_t bytes,
const bool)
277 static void rtc_error_func(
void *,
enum RTCError,
const char *
str)
282 static double progress_start_time = 0.0f;
284 static bool rtc_progress_func(
void *user_ptr,
const double n)
288 if (
time_dt() - progress_start_time < 0.25) {
292 string msg =
string_printf(
"Building BVH %.0f%%", n * 100.0);
294 progress_start_time =
time_dt();
299 BVHEmbree::BVHEmbree(
const BVHParams ¶ms_,
302 :
BVH(params_, geometry_, objects_),
305 build_quality(RTC_BUILD_QUALITY_REFIT)
310 BVHEmbree::~BVHEmbree()
313 rtcReleaseScene(
scene);
319 rtc_device = rtc_device_;
322 rtcSetDeviceErrorFunction(rtc_device, rtc_error_func,
NULL);
323 rtcSetDeviceMemoryMonitorFunction(rtc_device, rtc_memory_monitor_func, stats);
328 rtcReleaseScene(
scene);
334 scene = rtcNewScene(rtc_device);
335 const RTCSceneFlags scene_flags = (dynamic ? RTC_SCENE_FLAG_DYNAMIC : RTC_SCENE_FLAG_NONE) |
336 RTC_SCENE_FLAG_COMPACT | RTC_SCENE_FLAG_ROBUST;
337 rtcSetSceneFlags(
scene, scene_flags);
338 build_quality = dynamic ? RTC_BUILD_QUALITY_LOW :
339 (
params.use_spatial_split ? RTC_BUILD_QUALITY_HIGH :
340 RTC_BUILD_QUALITY_MEDIUM);
341 rtcSetSceneBuildQuality(
scene, build_quality);
344 foreach (
Object *ob, objects) {
350 if (!ob->get_geometry()->is_instanced()) {
369 rtcSetSceneProgressMonitorFunction(
scene, rtc_progress_func, &progress);
370 rtcCommitScene(
scene);
373 void BVHEmbree::add_object(
Object *ob,
int i)
375 Geometry *geom = ob->get_geometry();
380 add_triangles(ob,
mesh, i);
384 Hair *hair =
static_cast<Hair *
>(geom);
386 add_curves(ob, hair, i);
391 void BVHEmbree::add_instance(
Object *ob,
int i)
393 BVHEmbree *instance_bvh = (BVHEmbree *)(ob->get_geometry()->bvh);
394 assert(instance_bvh !=
NULL);
396 const size_t num_object_motion_steps = ob->
use_motion() ? ob->get_motion().size() : 1;
397 const size_t num_motion_steps =
min(num_object_motion_steps, RTC_MAX_TIME_STEP_COUNT);
398 assert(num_object_motion_steps <= RTC_MAX_TIME_STEP_COUNT);
400 RTCGeometry geom_id = rtcNewGeometry(rtc_device, RTC_GEOMETRY_TYPE_INSTANCE);
401 rtcSetGeometryInstancedScene(geom_id, instance_bvh->scene);
402 rtcSetGeometryTimeStepCount(geom_id, num_motion_steps);
407 for (
size_t step = 0; step < num_motion_steps; ++step) {
408 RTCQuaternionDecomposition rtc_decomp;
409 rtcInitQuaternionDecomposition(&rtc_decomp);
410 rtcQuaternionDecompositionSetQuaternion(
411 &rtc_decomp, decomp[step].
x.w, decomp[step].x.x, decomp[step].x.y, decomp[step].x.z);
412 rtcQuaternionDecompositionSetScale(
413 &rtc_decomp, decomp[step].
y.w, decomp[step].z.w, decomp[step].w.w);
414 rtcQuaternionDecompositionSetTranslation(
415 &rtc_decomp, decomp[step].
y.x, decomp[step].y.y, decomp[step].y.z);
416 rtcQuaternionDecompositionSetSkew(
417 &rtc_decomp, decomp[step].
z.x, decomp[step].z.y, decomp[step].w.x);
418 rtcSetGeometryTransformQuaternion(geom_id, step, &rtc_decomp);
422 rtcSetGeometryTransform(
423 geom_id, 0, RTC_FORMAT_FLOAT3X4_ROW_MAJOR, (
const float *)&ob->get_tfm());
426 rtcSetGeometryUserData(geom_id, (
void *)instance_bvh->scene);
429 rtcCommitGeometry(geom_id);
430 rtcAttachGeometryByID(
scene, geom_id, i * 2);
431 rtcReleaseGeometry(geom_id);
434 void BVHEmbree::add_triangles(
const Object *ob,
const Mesh *
mesh,
int i)
439 size_t num_motion_steps = 1;
443 num_motion_steps =
mesh->get_motion_steps();
447 assert(num_motion_steps <= RTC_MAX_TIME_STEP_COUNT);
448 num_motion_steps =
min(num_motion_steps, RTC_MAX_TIME_STEP_COUNT);
452 RTCGeometry geom_id = rtcNewGeometry(rtc_device, RTC_GEOMETRY_TYPE_TRIANGLE);
453 rtcSetGeometryBuildQuality(geom_id, build_quality);
454 rtcSetGeometryTimeStepCount(geom_id, num_motion_steps);
456 unsigned *rtc_indices = (
unsigned *)rtcSetNewGeometryBuffer(
457 geom_id, RTC_BUFFER_TYPE_INDEX, 0, RTC_FORMAT_UINT3,
sizeof(
int) * 3, num_triangles);
460 VLOG(1) <<
"Embree could not create new geometry buffer for mesh " <<
mesh->
name.c_str()
464 for (
size_t j = 0; j < num_triangles; ++j) {
466 rtc_indices[j * 3] =
t.v[0];
467 rtc_indices[j * 3 + 1] =
t.v[1];
468 rtc_indices[j * 3 + 2] =
t.v[2];
471 set_tri_vertex_buffer(geom_id,
mesh,
false);
473 rtcSetGeometryUserData(geom_id, (
void *)prim_offset);
474 rtcSetGeometryOccludedFilterFunction(geom_id, rtc_filter_occluded_func);
477 rtcCommitGeometry(geom_id);
478 rtcAttachGeometryByID(
scene, geom_id, i * 2);
479 rtcReleaseGeometry(geom_id);
482 void BVHEmbree::set_tri_vertex_buffer(RTCGeometry geom_id,
const Mesh *
mesh,
const bool update)
485 size_t num_motion_steps = 1;
490 num_motion_steps =
mesh->get_motion_steps();
491 t_mid = (num_motion_steps - 1) / 2;
492 if (num_motion_steps > RTC_MAX_TIME_STEP_COUNT) {
494 num_motion_steps = RTC_MAX_TIME_STEP_COUNT;
498 const size_t num_verts =
mesh->get_verts().
size();
500 for (
int t = 0;
t < num_motion_steps; ++
t) {
506 int t_ = (
t > t_mid) ? (
t - 1) :
t;
510 float *rtc_verts = (
update) ?
511 (
float *)rtcGetGeometryBufferData(geom_id, RTC_BUFFER_TYPE_VERTEX,
t) :
512 (
float *)rtcSetNewGeometryBuffer(geom_id,
513 RTC_BUFFER_TYPE_VERTEX,
521 for (
size_t j = 0; j < num_verts; ++j) {
522 rtc_verts[0] =
verts[j].x;
523 rtc_verts[1] =
verts[j].y;
524 rtc_verts[2] =
verts[j].z;
530 rtcUpdateGeometryBuffer(geom_id, RTC_BUFFER_TYPE_VERTEX,
t);
535 void BVHEmbree::set_curve_vertex_buffer(RTCGeometry geom_id,
const Hair *hair,
const bool update)
538 size_t num_motion_steps = 1;
542 num_motion_steps = hair->get_motion_steps();
548 for (
size_t j = 0; j < num_curves; ++j) {
550 num_keys +=
c.num_keys;
554 size_t num_keys_embree = num_keys;
555 num_keys_embree += num_curves * 2;
558 const int t_mid = (num_motion_steps - 1) / 2;
559 const float *curve_radius = &hair->get_curve_radius()[0];
560 for (
int t = 0;
t < num_motion_steps; ++
t) {
562 if (
t == t_mid || attr_mP ==
NULL) {
563 verts = &hair->get_curve_keys()[0];
566 int t_ = (
t > t_mid) ? (
t - 1) :
t;
570 float4 *rtc_verts = (
update) ? (float4 *)rtcGetGeometryBufferData(
571 geom_id, RTC_BUFFER_TYPE_VERTEX,
t) :
572 (float4 *)rtcSetNewGeometryBuffer(geom_id,
573 RTC_BUFFER_TYPE_VERTEX,
582 for (
size_t j = 0; j < num_curves; ++j) {
584 int fk =
c.first_key;
586 for (; k <
c.num_keys + 1; ++k, ++fk) {
588 rtc_verts[k].w = curve_radius[fk];
591 rtc_verts[0] = rtc_verts[1];
592 rtc_verts[k] = rtc_verts[k - 1];
593 rtc_verts +=
c.num_keys + 2;
598 rtcUpdateGeometryBuffer(geom_id, RTC_BUFFER_TYPE_VERTEX,
t);
603 void BVHEmbree::add_curves(
const Object *ob,
const Hair *hair,
int i)
608 size_t num_motion_steps = 1;
612 num_motion_steps = hair->get_motion_steps();
616 assert(num_motion_steps <= RTC_MAX_TIME_STEP_COUNT);
617 num_motion_steps =
min(num_motion_steps, RTC_MAX_TIME_STEP_COUNT);
620 size_t num_segments = 0;
621 for (
size_t j = 0; j < num_curves; ++j) {
623 assert(
c.num_segments() > 0);
624 num_segments +=
c.num_segments();
628 RTC_GEOMETRY_TYPE_FLAT_CATMULL_ROM_CURVE :
629 RTC_GEOMETRY_TYPE_ROUND_CATMULL_ROM_CURVE);
631 RTCGeometry geom_id = rtcNewGeometry(rtc_device,
type);
632 rtcSetGeometryTessellationRate(geom_id,
params.curve_subdivisions + 1);
633 unsigned *rtc_indices = (
unsigned *)rtcSetNewGeometryBuffer(
634 geom_id, RTC_BUFFER_TYPE_INDEX, 0, RTC_FORMAT_UINT,
sizeof(
int), num_segments);
635 size_t rtc_index = 0;
636 for (
size_t j = 0; j < num_curves; ++j) {
638 for (
size_t k = 0; k <
c.num_segments(); ++k) {
639 rtc_indices[rtc_index] =
c.first_key + k;
641 rtc_indices[rtc_index] += j * 2;
647 rtcSetGeometryBuildQuality(geom_id, build_quality);
648 rtcSetGeometryTimeStepCount(geom_id, num_motion_steps);
650 set_curve_vertex_buffer(geom_id, hair,
false);
652 rtcSetGeometryUserData(geom_id, (
void *)prim_offset);
654 rtcSetGeometryOccludedFilterFunction(geom_id, rtc_filter_occluded_func);
657 rtcSetGeometryIntersectFilterFunction(geom_id, rtc_filter_func_thick_curve);
658 rtcSetGeometryOccludedFilterFunction(geom_id, rtc_filter_occluded_func_thick_curve);
662 rtcCommitGeometry(geom_id);
663 rtcAttachGeometryByID(
scene, geom_id, i * 2 + 1);
664 rtcReleaseGeometry(geom_id);
672 unsigned geom_id = 0;
673 foreach (
Object *ob, objects) {
674 if (!
params.top_level || (ob->
is_traceable() && !ob->get_geometry()->is_instanced())) {
675 Geometry *geom = ob->get_geometry();
680 RTCGeometry geom = rtcGetGeometry(
scene, geom_id);
681 set_tri_vertex_buffer(geom,
mesh,
true);
683 rtcCommitGeometry(geom);
687 Hair *hair =
static_cast<Hair *
>(geom);
689 RTCGeometry geom = rtcGetGeometry(
scene, geom_id + 1);
690 set_curve_vertex_buffer(geom, hair,
true);
692 rtcCommitGeometry(geom);
699 rtcCommitScene(
scene);
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 z
_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 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 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
ATOMIC_INLINE size_t atomic_add_and_fetch_z(size_t *p, size_t x)
ATOMIC_INLINE size_t atomic_sub_and_fetch_z(size_t *p, size_t x)
void refit(btStridingMeshInterface *triangles, const btVector3 &aabbMin, const btVector3 &aabbMax)
void build(btStridingMeshInterface *triangles, bool useQuantizedAabbCompression, const btVector3 &bvhAabbMin, const btVector3 &bvhAabbMax)
Attribute * find(ustring name) const
static const uint MAX_MOTION_STEPS
bool has_motion_blur() const
void set_substatus(const string &substatus_)
void mem_free(size_t size)
void mem_alloc(size_t size)
ccl_device_inline void kernel_embree_convert_sss_hit(KernelGlobals *kg, const RTCRay *ray, const RTCHit *hit, Intersection *isect, int local_object_id)
ccl_device_inline void kernel_embree_convert_hit(KernelGlobals *kg, const RTCRay *ray, const RTCHit *hit, Intersection *isect)
#define kernel_tex_fetch(tex, index)
#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 uint lcg_step_uint(uint *rng)
@ SD_HAS_TRANSPARENT_SHADOW
@ ATTR_STD_MOTION_VERTEX_POSITION
static void update(bNodeTree *ntree)
LocalIntersection * local_isect
Curve get_curve(size_t i) const
size_t num_curves() const
CurveShapeType curve_shape
struct Intersection hits[LOCAL_MAX_HITS]
float3 Ng[LOCAL_MAX_HITS]
Triangle get_triangle(size_t i) const
size_t num_triangles() const
static const uint MAX_MOTION_STEPS
bool is_traceable() const
uint visibility_for_tracing() const
ccl_device_inline int __float_as_int(float f)
ccl_device_inline float4 float3_to_float4(const float3 a)
ccl_device_inline float2 normalize(const float2 &a)
ccl_device_inline float dot(const float2 &a, const float2 &b)
#define SIMD_SET_FLUSH_TO_ZERO
CCL_NAMESPACE_BEGIN string string_printf(const char *format,...)
CCL_NAMESPACE_BEGIN double time_dt()