Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
rtcore_geometry.h File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

#define RTC_INVALID_GEOMETRY_ID   ((unsigned)-1)
 
enum  RTCBufferType {
  RTC_INDEX_BUFFER = 0x01000000 , RTC_VERTEX_BUFFER = 0x02000000 , RTC_VERTEX_BUFFER0 = 0x02000000 , RTC_VERTEX_BUFFER1 = 0x02000001 ,
  RTC_USER_VERTEX_BUFFER = 0x02100000 , RTC_USER_VERTEX_BUFFER0 = 0x02100000 , RTC_USER_VERTEX_BUFFER1 = 0x02100001 , RTC_FACE_BUFFER = 0x03000000 ,
  RTC_LEVEL_BUFFER = 0x04000001 , RTC_EDGE_CREASE_INDEX_BUFFER = 0x05000000 , RTC_EDGE_CREASE_WEIGHT_BUFFER = 0x06000000 , RTC_VERTEX_CREASE_INDEX_BUFFER = 0x07000000 ,
  RTC_VERTEX_CREASE_WEIGHT_BUFFER = 0x08000000 , RTC_HOLE_BUFFER = 0x09000001
}
 Specifies the type of buffers when mapping buffers. More...
 
enum  RTCMatrixType { RTC_MATRIX_ROW_MAJOR = 0 , RTC_MATRIX_COLUMN_MAJOR = 1 , RTC_MATRIX_COLUMN_MAJOR_ALIGNED16 = 2 }
 Supported types of matrix layout for functions involving matrices. More...
 
enum  RTCGeometryFlags { RTC_GEOMETRY_STATIC = 0 , RTC_GEOMETRY_DEFORMABLE = 1 , RTC_GEOMETRY_DYNAMIC = 2 }
 Supported geometry flags to specify handling in dynamic scenes. More...
 
enum  RTCBoundaryMode { RTC_BOUNDARY_NONE = 0 , RTC_BOUNDARY_EDGE_ONLY = 1 , RTC_BOUNDARY_EDGE_AND_CORNER = 2 }
 Boundary interpolation mode for subdivision surfaces. More...
 
typedef void(* RTCFilterFunc) (void *ptr, RTCRay &ray)
 
typedef void(* RTCFilterFunc4) (const void *valid, void *ptr, RTCRay4 &ray)
 
typedef void(* RTCFilterFunc8) (const void *valid, void *ptr, RTCRay8 &ray)
 
typedef void(* RTCFilterFunc16) (const void *valid, void *ptr, RTCRay16 &ray)
 
typedef void(* RTCDisplacementFunc) (void *ptr, unsigned geomID, unsigned primID, const float *u, const float *v, const float *nx, const float *ny, const float *nz, float *px, float *py, float *pz, size_t N)
 
RTCORE_API unsigned rtcNewInstance (RTCScene target, RTCScene source)
 Creates a new scene instance.
 
RTCORE_API unsigned rtcNewInstance2 (RTCScene target, RTCScene source, size_t numTimeSteps=1)
 Creates a new scene instance.
 
RTCORE_API void rtcSetTransform (RTCScene scene, unsigned geomID, RTCMatrixType layout, const float *xfm)
 Sets transformation of the instance.
 
RTCORE_API void rtcSetTransform2 (RTCScene scene, unsigned int geomID, RTCMatrixType layout, const float *xfm, size_t timeStep=0)
 Sets transformation of the instance for specified timestep.
 
RTCORE_API unsigned rtcNewTriangleMesh (RTCScene scene, RTCGeometryFlags flags, size_t numTriangles, size_t numVertices, size_t numTimeSteps=1)
 Creates a new triangle mesh. The number of triangles (numTriangles), number of vertices (numVertices), and number of time steps (1 for normal meshes, and 2 for linear motion blur), have to get specified. The triangle indices can be set be mapping and writing to the index buffer (RTC_INDEX_BUFFER) and the triangle vertices can be set by mapping and writing into the vertex buffer (RTC_VERTEX_BUFFER). In case of linear motion blur, two vertex buffers have to get filled (RTC_VERTEX_BUFFER0, RTC_VERTEX_BUFFER1), one for each time step. The index buffer has the default layout of three 32 bit integer indices for each triangle. An index points to the ith vertex. The vertex buffer stores single precision x,y,z floating point coordinates aligned to 16 bytes. The value of the 4th float used for alignment can be arbitrary.
 
RTCORE_API unsigned rtcNewQuadMesh (RTCScene scene, RTCGeometryFlags flags, size_t numQuads, size_t numVertices, size_t numTimeSteps=1)
 Creates a new quad mesh. The number of quads (numQuads), number of vertices (numVertices), and number of time steps (1 for normal meshes, and 2 for linear motion blur), have to get specified. The quad indices can be set be mapping and writing to the index buffer (RTC_INDEX_BUFFER) and the quad vertices can be set by mapping and writing into the vertex buffer (RTC_VERTEX_BUFFER). In case of linear motion blur, two vertex buffers have to get filled (RTC_VERTEX_BUFFER0, RTC_VERTEX_BUFFER1), one for each time step. The index buffer has the default layout of three 32 bit integer indices for each quad. An index points to the ith vertex. The vertex buffer stores single precision x,y,z floating point coordinates aligned to 16 bytes. The value of the 4th float used for alignment can be arbitrary.
 
RTCORE_API unsigned rtcNewSubdivisionMesh (RTCScene scene, RTCGeometryFlags flags, size_t numFaces, size_t numEdges, size_t numVertices, size_t numEdgeCreases, size_t numVertexCreases, size_t numHoles, size_t numTimeSteps=1)
 Creates a new subdivision mesh. The number of faces (numFaces), edges/indices (numEdges), vertices (numVertices), edge creases (numEdgeCreases), vertex creases (numVertexCreases), holes (numHoles), and time steps (numTimeSteps) have to get speficied at construction time.
 
RTCORE_API unsigned rtcNewHairGeometry (RTCScene scene, RTCGeometryFlags flags, size_t numCurves, size_t numVertices, size_t numTimeSteps=1)
 Creates a new hair geometry, consisting of multiple hairs represented as cubic bezier curves with varying radii. The number of curves (numCurves), number of vertices (numVertices), and number of time steps (1 for normal curves, and 2 for linear motion blur), have to get specified at construction time. Further, the curve index buffer (RTC_INDEX_BUFFER) and the curve vertex buffer (RTC_VERTEX_BUFFER) have to get set by mapping and writing to the appropiate buffers. In case of linear motion blur, two vertex buffers have to get filled (RTC_VERTEX_BUFFER0, RTC_VERTEX_BUFFER1), one for each time step. The index buffer has the default layout of a single 32 bit integer index for each curve, that references the start vertex of the curve. The vertex buffer stores 4 control points per curve, each such control point consists of a single precision (x,y,z) position and radius, stored in that order in memory. Individual hairs are considered to be subpixel sized which allows the implementation to approximate the intersection calculation. This in particular means that zooming onto one hair might show geometric artefacts.
 
RTCORE_API void rtcSetTessellationRate (RTCScene scene, unsigned geomID, float tessellationRate)
 
RTCORE_API unsigned rtcNewLineSegments (RTCScene scene, RTCGeometryFlags flags, size_t numSegments, size_t numVertices, size_t numTimeSteps=1)
 Creates a new line segment geometry, consisting of multiple segments with varying radii. The number of line segments (numSegments), number of vertices (numVertices), and number of time steps (1 for normal line segments, and 2 for linear motion blur), have to get specified at construction time. Further, the segment index buffer (RTC_INDEX_BUFFER) and the segment vertex buffer (RTC_VERTEX_BUFFER) have to get set by mapping and writing to the appropiate buffers. In case of linear motion blur, two vertex buffers have to get filled (RTC_VERTEX_BUFFER0, RTC_VERTEX_BUFFER1), one for each time step. The index buffer has the default layout of a single 32 bit integer index for each line segment, that references the start vertex of the segment. The vertex buffer stores 2 end points per line segment, each such point consists of a single precision (x,y,z) position and radius, stored in that order in memory. Individual segments are considered to be subpixel sized which allows the implementation to approximate the intersection calculation. This in particular means that zooming onto one line segment might show geometric artefacts.
 
RTCORE_API void rtcSetMask (RTCScene scene, unsigned geomID, int mask)
 Sets 32 bit ray mask.
 
RTCORE_API void rtcSetBoundaryMode (RTCScene scene, unsigned geomID, RTCBoundaryMode mode)
 Sets boundary interpolation mode for subdivision surfaces.
 
RTCORE_API voidrtcMapBuffer (RTCScene scene, unsigned geomID, RTCBufferType type)
 Maps specified buffer. This function can be used to set index and vertex buffers of geometries.
 
RTCORE_API void rtcUnmapBuffer (RTCScene scene, unsigned geomID, RTCBufferType type)
 Unmaps specified buffer.
 
RTCORE_API void rtcSetBuffer (RTCScene scene, unsigned geomID, RTCBufferType type, const void *ptr, size_t byteOffset, size_t byteStride)
 Shares a data buffer between the application and Embree. The passed buffer is used by Embree to store index and vertex data. It has to remain valid as long as the mesh exists, and the user is responsible to free the data when the mesh gets deleted. One can optionally speficy a byte offset and byte stride of the elements stored inside the buffer. The addresses ptr+offset+i*stride have to be aligned to 4 bytes on Xeon CPUs and 16 bytes on Xeon Phi accelerators. For vertex buffers, the 4 bytes after the z-coordinate of the last vertex have to be readable memory, thus padding is required for some layouts. If this function is not called, Embree will allocate and manage buffers of the default layout.
 
RTCORE_API void rtcEnable (RTCScene scene, unsigned geomID)
 Enable geometry. Enabled geometry can be hit by a ray.
 
RTCORE_API void rtcUpdate (RTCScene scene, unsigned geomID)
 Update all geometry buffers.
 
RTCORE_API void rtcUpdateBuffer (RTCScene scene, unsigned geomID, RTCBufferType type)
 Update spefific geometry buffer.
 
RTCORE_API void rtcDisable (RTCScene scene, unsigned geomID)
 Disable geometry.
 
RTCORE_API void rtcSetDisplacementFunction (RTCScene scene, unsigned geomID, RTCDisplacementFunc func, RTCBounds *bounds)
 Sets the displacement function.
 
RTCORE_API void rtcSetIntersectionFilterFunction (RTCScene scene, unsigned geomID, RTCFilterFunc func)
 Sets the intersection filter function for single rays.
 
RTCORE_API void rtcSetIntersectionFilterFunction4 (RTCScene scene, unsigned geomID, RTCFilterFunc4 func)
 Sets the intersection filter function for ray packets of size 4.
 
RTCORE_API void rtcSetIntersectionFilterFunction8 (RTCScene scene, unsigned geomID, RTCFilterFunc8 func)
 Sets the intersection filter function for ray packets of size 8.
 
RTCORE_API void rtcSetIntersectionFilterFunction16 (RTCScene scene, unsigned geomID, RTCFilterFunc16 func)
 Sets the intersection filter function for ray packets of size 16.
 
RTCORE_API void rtcSetOcclusionFilterFunction (RTCScene scene, unsigned geomID, RTCFilterFunc func)
 Sets the occlusion filter function for single rays.
 
RTCORE_API void rtcSetOcclusionFilterFunction4 (RTCScene scene, unsigned geomID, RTCFilterFunc4 func)
 Sets the occlusion filter function for ray packets of size 4.
 
RTCORE_API void rtcSetOcclusionFilterFunction8 (RTCScene scene, unsigned geomID, RTCFilterFunc8 func)
 Sets the occlusion filter function for ray packets of size 8.
 
RTCORE_API void rtcSetOcclusionFilterFunction16 (RTCScene scene, unsigned geomID, RTCFilterFunc16 func)
 Sets the occlusion filter function for ray packets of size 16.
 
RTCORE_API void rtcSetUserData (RTCScene scene, unsigned geomID, void *ptr)
 
RTCORE_API voidrtcGetUserData (RTCScene scene, unsigned geomID)
 
RTCORE_API void rtcInterpolate (RTCScene scene, unsigned geomID, unsigned primID, float u, float v, RTCBufferType buffer, float *P, float *dPdu, float *dPdv, size_t numFloats)
 
RTCORE_API void rtcInterpolate2 (RTCScene scene, unsigned geomID, unsigned primID, float u, float v, RTCBufferType buffer, float *P, float *dPdu, float *dPdv, float *ddPdudu, float *ddPdvdv, float *ddPdudv, size_t numFloats)
 
RTCORE_API void rtcInterpolateN (RTCScene scene, unsigned geomID, const void *valid, const unsigned *primIDs, const float *u, const float *v, size_t numUVs, RTCBufferType buffer, float *P, float *dPdu, float *dPdv, size_t numFloats)
 
RTCORE_API void rtcInterpolateN2 (RTCScene scene, unsigned geomID, const void *valid, const unsigned *primIDs, const float *u, const float *v, size_t numUVs, RTCBufferType buffer, float *P, float *dPdu, float *dPdv, float *ddPdudu, float *ddPdvdv, float *ddPdudv, size_t numFloats)
 
RTCORE_API void rtcDeleteGeometry (RTCScene scene, unsigned geomID)
 Deletes the geometry.
 

Macro Definition Documentation

◆ RTC_INVALID_GEOMETRY_ID

#define RTC_INVALID_GEOMETRY_ID   ((unsigned)-1)

invalid geometry ID

Typedef Documentation

◆ RTCDisplacementFunc

typedef void(* RTCDisplacementFunc) (void *ptr, unsigned geomID, unsigned primID, const float *u, const float *v, const float *nx, const float *ny, const float *nz, float *px, float *py, float *pz, size_t N)

Displacement mapping function.

Parameters
ptrpointer to user data of geometry
geomIDID of geometry to displace
primIDID of primitive of geometry to displace
uu coordinates (source)
vv coordinates (source)
nxx coordinates of normalized normal at point to displace (source)
nyy coordinates of normalized normal at point to displace (source)
nzz coordinates of normalized normal at point to displace (source)
pxx coordinates of points to displace (source and target)
pyy coordinates of points to displace (source and target)
pzz coordinates of points to displace (source and target)
Nnumber of points to displace

◆ RTCFilterFunc

typedef void(* RTCFilterFunc) (void *ptr, RTCRay &ray)

Intersection filter function for single rays.

Parameters
ptrpointer to user data
rayintersection to filter

◆ RTCFilterFunc16

typedef void(* RTCFilterFunc16) (const void *valid, void *ptr, RTCRay16 &ray)

Intersection filter function for ray packets of size 16.

Parameters
validpointer to valid mask
ptrpointer to user data
rayintersection to filter

◆ RTCFilterFunc4

typedef void(* RTCFilterFunc4) (const void *valid, void *ptr, RTCRay4 &ray)

Intersection filter function for ray packets of size 4.

Parameters
validpointer to valid mask
ptrpointer to user data
rayintersection to filter

◆ RTCFilterFunc8

typedef void(* RTCFilterFunc8) (const void *valid, void *ptr, RTCRay8 &ray)

Intersection filter function for ray packets of size 8.

Parameters
validpointer to valid mask
ptrpointer to user data
rayintersection to filter

Enumeration Type Documentation

◆ RTCBoundaryMode

Boundary interpolation mode for subdivision surfaces.

Enumerator
RTC_BOUNDARY_NONE 

ignores border patches

RTC_BOUNDARY_EDGE_ONLY 

soft boundary (default)

RTC_BOUNDARY_EDGE_AND_CORNER 

boundary corner vertices are sharp vertices

67{
71};
@ RTC_BOUNDARY_EDGE_ONLY
soft boundary (default)
Definition rtcore_geometry.h:69
@ RTC_BOUNDARY_NONE
ignores border patches
Definition rtcore_geometry.h:68
@ RTC_BOUNDARY_EDGE_AND_CORNER
boundary corner vertices are sharp vertices
Definition rtcore_geometry.h:70

◆ RTCBufferType

Specifies the type of buffers when mapping buffers.

Enumerator
RTC_INDEX_BUFFER 
RTC_VERTEX_BUFFER 
RTC_VERTEX_BUFFER0 
RTC_VERTEX_BUFFER1 
RTC_USER_VERTEX_BUFFER 
RTC_USER_VERTEX_BUFFER0 
RTC_USER_VERTEX_BUFFER1 
RTC_FACE_BUFFER 
RTC_LEVEL_BUFFER 
RTC_EDGE_CREASE_INDEX_BUFFER 
RTC_EDGE_CREASE_WEIGHT_BUFFER 
RTC_VERTEX_CREASE_INDEX_BUFFER 
RTC_VERTEX_CREASE_WEIGHT_BUFFER 
RTC_HOLE_BUFFER 
27 {
28 RTC_INDEX_BUFFER = 0x01000000,
29
30 RTC_VERTEX_BUFFER = 0x02000000,
31 RTC_VERTEX_BUFFER0 = 0x02000000,
32 RTC_VERTEX_BUFFER1 = 0x02000001,
33
34 RTC_USER_VERTEX_BUFFER = 0x02100000,
35 RTC_USER_VERTEX_BUFFER0 = 0x02100000,
36 RTC_USER_VERTEX_BUFFER1 = 0x02100001,
37
38 RTC_FACE_BUFFER = 0x03000000,
39 RTC_LEVEL_BUFFER = 0x04000001,
40
43
46
47 RTC_HOLE_BUFFER = 0x09000001,
48};
@ RTC_USER_VERTEX_BUFFER
Definition rtcore_geometry.h:34
@ RTC_INDEX_BUFFER
Definition rtcore_geometry.h:28
@ RTC_FACE_BUFFER
Definition rtcore_geometry.h:38
@ RTC_VERTEX_BUFFER1
Definition rtcore_geometry.h:32
@ RTC_USER_VERTEX_BUFFER1
Definition rtcore_geometry.h:36
@ RTC_VERTEX_BUFFER0
Definition rtcore_geometry.h:31
@ RTC_EDGE_CREASE_INDEX_BUFFER
Definition rtcore_geometry.h:41
@ RTC_EDGE_CREASE_WEIGHT_BUFFER
Definition rtcore_geometry.h:42
@ RTC_HOLE_BUFFER
Definition rtcore_geometry.h:47
@ RTC_LEVEL_BUFFER
Definition rtcore_geometry.h:39
@ RTC_USER_VERTEX_BUFFER0
Definition rtcore_geometry.h:35
@ RTC_VERTEX_CREASE_WEIGHT_BUFFER
Definition rtcore_geometry.h:45
@ RTC_VERTEX_BUFFER
Definition rtcore_geometry.h:30
@ RTC_VERTEX_CREASE_INDEX_BUFFER
Definition rtcore_geometry.h:44

◆ RTCGeometryFlags

Supported geometry flags to specify handling in dynamic scenes.

Enumerator
RTC_GEOMETRY_STATIC 

specifies static geometry that will change rarely

RTC_GEOMETRY_DEFORMABLE 

specifies dynamic geometry with deformable motion (BVH refit possible)

RTC_GEOMETRY_DYNAMIC 

specifies dynamic geometry with arbitrary motion (BVH refit not possible)

59{
63};
@ RTC_GEOMETRY_DEFORMABLE
specifies dynamic geometry with deformable motion (BVH refit possible)
Definition rtcore_geometry.h:61
@ RTC_GEOMETRY_STATIC
specifies static geometry that will change rarely
Definition rtcore_geometry.h:60
@ RTC_GEOMETRY_DYNAMIC
specifies dynamic geometry with arbitrary motion (BVH refit not possible)
Definition rtcore_geometry.h:62

◆ RTCMatrixType

Supported types of matrix layout for functions involving matrices.

Enumerator
RTC_MATRIX_ROW_MAJOR 
RTC_MATRIX_COLUMN_MAJOR 
RTC_MATRIX_COLUMN_MAJOR_ALIGNED16 
51 {
55};
@ RTC_MATRIX_COLUMN_MAJOR_ALIGNED16
Definition rtcore_geometry.h:54
@ RTC_MATRIX_ROW_MAJOR
Definition rtcore_geometry.h:52
@ RTC_MATRIX_COLUMN_MAJOR
Definition rtcore_geometry.h:53

Function Documentation

◆ rtcDeleteGeometry()

RTCORE_API void rtcDeleteGeometry ( RTCScene  scene,
unsigned  geomID 
)

Deletes the geometry.

◆ rtcDisable()

RTCORE_API void rtcDisable ( RTCScene  scene,
unsigned  geomID 
)

Disable geometry.

Disabled geometry is not hit by any ray. Disabling and enabling geometry gives higher performance than deleting and recreating geometry.

◆ rtcEnable()

RTCORE_API void rtcEnable ( RTCScene  scene,
unsigned  geomID 
)

Enable geometry. Enabled geometry can be hit by a ray.

◆ rtcGetUserData()

RTCORE_API void * rtcGetUserData ( RTCScene  scene,
unsigned  geomID 
)

Get pointer for user defined data per geometry based on geomID.

◆ rtcInterpolate()

RTCORE_API void rtcInterpolate ( RTCScene  scene,
unsigned  geomID,
unsigned  primID,
float  u,
float  v,
RTCBufferType  buffer,
float *  P,
float *  dPdu,
float *  dPdv,
size_t  numFloats 
)

Interpolates user data to some u/v location. The data buffer specifies per vertex data to interpolate and can be one of the RTC_VERTEX_BUFFER0/1 or RTC_USER_VERTEX_BUFFER0/1 and has to contain numFloats floating point values to interpolate for each vertex of the geometry. The dP array will get filled with the interpolated data and the dPdu and dPdv arrays with the u and v derivative of the interpolation. If the pointers dP is NULL, the value will not get calculated. If dPdu and dPdv are NULL the derivatives will not get calculated. Both dPdu and dPdv have to be either valid or NULL. The buffer has to be padded at the end such that the last element can be read safely using SSE instructions.

◆ rtcInterpolate2()

RTCORE_API void rtcInterpolate2 ( RTCScene  scene,
unsigned  geomID,
unsigned  primID,
float  u,
float  v,
RTCBufferType  buffer,
float *  P,
float *  dPdu,
float *  dPdv,
float *  ddPdudu,
float *  ddPdvdv,
float *  ddPdudv,
size_t  numFloats 
)

Interpolates user data to some u/v location. The data buffer specifies per vertex data to interpolate and can be one of the RTC_VERTEX_BUFFER0/1 or RTC_USER_VERTEX_BUFFER0/1 and has to contain numFloats floating point values to interpolate for each vertex of the geometry. The P array will get filled with the interpolated datam the dPdu and dPdv arrays with the u and v derivative of the interpolation, and the ddPdudu, ddPdvdv, and ddPdudv arrays with the respective second derivatives. One can disable 1) the calculation of the interpolated value by setting P to NULL, 2) the calculation of the 1st order derivatives by setting dPdu and dPdv to NULL, 3) the calculation of the second order derivatives by setting ddPdudu, ddPdvdv, and ddPdudv to NULL. The buffers have to be padded at the end such that the last element can be read or written safely using SSE instructions.

◆ rtcInterpolateN()

RTCORE_API void rtcInterpolateN ( RTCScene  scene,
unsigned  geomID,
const void valid,
const unsigned *  primIDs,
const float *  u,
const float *  v,
size_t  numUVs,
RTCBufferType  buffer,
float *  P,
float *  dPdu,
float *  dPdv,
size_t  numFloats 
)

Interpolates user data to an array of u/v locations. The valid pointer points to an integer array that specified which entries in the u/v arrays are valid (-1 denotes valid, and 0 invalid). If the valid pointer is NULL all elements are considers valid. The data buffer specifies per vertex data to interpolate and can be one of the RTC_VERTEX_BUFFER0/1 or RTC_USER_VERTEX_BUFFER0/1 and has to contain numFloats floating point values to interpolate for each vertex of the geometry. The P array will get filled with the interpolated data, and the dPdu and dPdv arrays with the u and v derivative of the interpolation. If the pointers P is NULL, the value will not get calculated. If dPdu and dPdv are NULL the derivatives will not get calculated. Both dPdu and dPdv have to be either valid or NULL. These destination arrays are filled in structure of array (SoA) layout. The buffer has to be padded at the end such that the last element can be read safely using SSE instructions.

◆ rtcInterpolateN2()

RTCORE_API void rtcInterpolateN2 ( RTCScene  scene,
unsigned  geomID,
const void valid,
const unsigned *  primIDs,
const float *  u,
const float *  v,
size_t  numUVs,
RTCBufferType  buffer,
float *  P,
float *  dPdu,
float *  dPdv,
float *  ddPdudu,
float *  ddPdvdv,
float *  ddPdudv,
size_t  numFloats 
)

Interpolates user data to an array of u/v locations. The valid pointer points to an integer array that specified which entries in the u/v arrays are valid (-1 denotes valid, and 0 invalid). If the valid pointer is NULL all elements are considers valid. The data buffer specifies per vertex data to interpolate and can be one of the RTC_VERTEX_BUFFER0/1 or RTC_USER_VERTEX_BUFFER0/1 and has to contain numFloats floating point values to interpolate for each vertex of the geometry. The P array will get filled with the interpolated datam the dPdu and dPdv arrays with the u and v derivative of the interpolation, and the ddPdudu, ddPdvdv, and ddPdudv arrays with the respective second derivatives. One can disable 1) the calculation of the interpolated value by setting P to NULL, 2) the calculation of the 1st order derivatives by setting dPdu and dPdv to NULL, 3) the calculation of the second order derivatives by setting ddPdudu, ddPdvdv, and ddPdudv to NULL. These destination arrays are filled in structure of array (SoA) layout. The buffer has to be padded at the end such that the last element can be read safely using SSE instructions.

◆ rtcMapBuffer()

RTCORE_API void * rtcMapBuffer ( RTCScene  scene,
unsigned  geomID,
RTCBufferType  type 
)

Maps specified buffer. This function can be used to set index and vertex buffers of geometries.

Referenced by igl::embree::EmbreeIntersector::init().

+ Here is the caller graph for this function:

◆ rtcNewHairGeometry()

RTCORE_API unsigned rtcNewHairGeometry ( RTCScene  scene,
RTCGeometryFlags  flags,
size_t  numCurves,
size_t  numVertices,
size_t  numTimeSteps = 1 
)

Creates a new hair geometry, consisting of multiple hairs represented as cubic bezier curves with varying radii. The number of curves (numCurves), number of vertices (numVertices), and number of time steps (1 for normal curves, and 2 for linear motion blur), have to get specified at construction time. Further, the curve index buffer (RTC_INDEX_BUFFER) and the curve vertex buffer (RTC_VERTEX_BUFFER) have to get set by mapping and writing to the appropiate buffers. In case of linear motion blur, two vertex buffers have to get filled (RTC_VERTEX_BUFFER0, RTC_VERTEX_BUFFER1), one for each time step. The index buffer has the default layout of a single 32 bit integer index for each curve, that references the start vertex of the curve. The vertex buffer stores 4 control points per curve, each such control point consists of a single precision (x,y,z) position and radius, stored in that order in memory. Individual hairs are considered to be subpixel sized which allows the implementation to approximate the intersection calculation. This in particular means that zooming onto one hair might show geometric artefacts.

Parameters
scenethe scene the curves belong to
flagsgeometry flags
numCurvesnumber of curves
numVerticesnumber of vertices
numTimeStepsnumber of motion blur time steps

◆ rtcNewInstance()

RTCORE_API unsigned rtcNewInstance ( RTCScene  target,
RTCScene  source 
)

Creates a new scene instance.

A scene instance contains a reference to a scene to instantiate and the transformation to instantiate the scene with. An implementation will typically transform the ray with the inverse of the provided transformation and continue traversing the ray through the provided scene. If any geometry is hit, the instance ID (instID) member of the ray will get set to the geometry ID of the instance.

Parameters
targetthe scene the instance belongs to
sourcethe scene to instantiate

◆ rtcNewInstance2()

RTCORE_API unsigned rtcNewInstance2 ( RTCScene  target,
RTCScene  source,
size_t  numTimeSteps = 1 
)

Creates a new scene instance.

A scene instance contains a reference to a scene to instantiate and the transformation to instantiate the scene with. For motion blurred instances, a number of timesteps can get specified (currently only 1 or 2 timesteps are supported). An implementation will typically transform the ray with the inverse of the provided transformation and continue traversing the ray through the provided scene. If any geometry is hit, the instance ID (instID) member of the ray will get set to the geometry ID of the instance. number of timesteps, one matrix per timestep

Parameters
targetthe scene the instance belongs to
sourcethe scene to instantiate

◆ rtcNewLineSegments()

RTCORE_API unsigned rtcNewLineSegments ( RTCScene  scene,
RTCGeometryFlags  flags,
size_t  numSegments,
size_t  numVertices,
size_t  numTimeSteps = 1 
)

Creates a new line segment geometry, consisting of multiple segments with varying radii. The number of line segments (numSegments), number of vertices (numVertices), and number of time steps (1 for normal line segments, and 2 for linear motion blur), have to get specified at construction time. Further, the segment index buffer (RTC_INDEX_BUFFER) and the segment vertex buffer (RTC_VERTEX_BUFFER) have to get set by mapping and writing to the appropiate buffers. In case of linear motion blur, two vertex buffers have to get filled (RTC_VERTEX_BUFFER0, RTC_VERTEX_BUFFER1), one for each time step. The index buffer has the default layout of a single 32 bit integer index for each line segment, that references the start vertex of the segment. The vertex buffer stores 2 end points per line segment, each such point consists of a single precision (x,y,z) position and radius, stored in that order in memory. Individual segments are considered to be subpixel sized which allows the implementation to approximate the intersection calculation. This in particular means that zooming onto one line segment might show geometric artefacts.

Parameters
scenethe scene the line segments belong to
flagsgeometry flags
numSegmentsnumber of line segments
numVerticesnumber of vertices
numTimeStepsnumber of motion blur time steps

◆ rtcNewQuadMesh()

RTCORE_API unsigned rtcNewQuadMesh ( RTCScene  scene,
RTCGeometryFlags  flags,
size_t  numQuads,
size_t  numVertices,
size_t  numTimeSteps = 1 
)

Creates a new quad mesh. The number of quads (numQuads), number of vertices (numVertices), and number of time steps (1 for normal meshes, and 2 for linear motion blur), have to get specified. The quad indices can be set be mapping and writing to the index buffer (RTC_INDEX_BUFFER) and the quad vertices can be set by mapping and writing into the vertex buffer (RTC_VERTEX_BUFFER). In case of linear motion blur, two vertex buffers have to get filled (RTC_VERTEX_BUFFER0, RTC_VERTEX_BUFFER1), one for each time step. The index buffer has the default layout of three 32 bit integer indices for each quad. An index points to the ith vertex. The vertex buffer stores single precision x,y,z floating point coordinates aligned to 16 bytes. The value of the 4th float used for alignment can be arbitrary.

Parameters
scenethe scene the mesh belongs to
flagsgeometry flags
numQuadsnumber of quads
numVerticesnumber of vertices
numTimeStepsnumber of motion blur time steps

◆ rtcNewSubdivisionMesh()

RTCORE_API unsigned rtcNewSubdivisionMesh ( RTCScene  scene,
RTCGeometryFlags  flags,
size_t  numFaces,
size_t  numEdges,
size_t  numVertices,
size_t  numEdgeCreases,
size_t  numVertexCreases,
size_t  numHoles,
size_t  numTimeSteps = 1 
)

Creates a new subdivision mesh. The number of faces (numFaces), edges/indices (numEdges), vertices (numVertices), edge creases (numEdgeCreases), vertex creases (numVertexCreases), holes (numHoles), and time steps (numTimeSteps) have to get speficied at construction time.

The following buffers have to get filled by the application: the face buffer (RTC_FACE_BUFFER) contains the number edges/indices (3 or 4) of each of the numFaces faces, the index buffer (RTC_INDEX_BUFFER) contains multiple (3 or 4) 32bit vertex indices for each face and numEdges indices in total, the vertex buffer (RTC_VERTEX_BUFFER) stores numVertices vertices as single precision x,y,z floating point coordinates aligned to 16 bytes. The value of the 4th float used for alignment can be arbitrary.

Optionally, the application can fill the hole buffer (RTC_HOLE_BUFFER) with numHoles many 32 bit indices of faces that should be considered non-existing.

Optionally, the application can fill the level buffer (RTC_LEVEL_BUFFER) with a tessellation level for each of the numEdges edges. The subdivision level is a positive floating point value, that specifies how many quads along the edge should get generated during tessellation. The tessellation level is a lower bound, thus the implementation is free to choose a larger level. If no level buffer is specified a level of 1 is used.

Optionally, the application can fill the sparse edge crease buffers to make some edges appear sharper. The edge crease index buffer (RTC_EDGE_CREASE_INDEX_BUFFER) contains numEdgeCreases many pairs of 32 bit vertex indices that specify unoriented edges. The edge crease weight buffer (RTC_EDGE_CREASE_WEIGHT_BUFFER) stores for each of theses crease edges a positive floating point weight. The larger this weight, the sharper the edge. Specifying a weight of infinify is supported and marks an edge as infinitely sharp. Storing an edge multiple times with the same crease weight is allowed, but has lower performance. Storing the an edge multiple times with different crease weights results in undefined behaviour. For a stored edge (i,j), the reverse direction edges (j,i) does not have to get stored, as both are considered the same edge.

Optionally, the application can fill the sparse vertex crease buffers to make some vertices appear sharper. The vertex crease index buffer (RTC_VERTEX_CREASE_INDEX_BUFFER), contains numVertexCreases many 32 bit vertex indices to speficy a set of vertices. The vertex crease weight buffer (RTC_VERTEX_CREASE_WEIGHT_BUFFER) specifies for each of these vertices a positive floating point weight. The larger this weight, the sharper the vertex. Specifying a weight of infinity is supported and makes the vertex infinitely sharp. Storing a vertex multiple times with the same crease weight is allowed, but has lower performance. Storing a vertex multiple times with different crease weights results in undefined behaviour.

Parameters
scenethe scene the mesh belongs to
flagsgeometry flags
numFacesnumber of faces
numEdgesnumber of edges
numVerticesnumber of vertices
numEdgeCreasesnumber of edge creases
numVertexCreasesnumber of vertex creases
numHolesnumber of holes
numTimeStepsnumber of motion blur time steps

◆ rtcNewTriangleMesh()

RTCORE_API unsigned rtcNewTriangleMesh ( RTCScene  scene,
RTCGeometryFlags  flags,
size_t  numTriangles,
size_t  numVertices,
size_t  numTimeSteps = 1 
)

Creates a new triangle mesh. The number of triangles (numTriangles), number of vertices (numVertices), and number of time steps (1 for normal meshes, and 2 for linear motion blur), have to get specified. The triangle indices can be set be mapping and writing to the index buffer (RTC_INDEX_BUFFER) and the triangle vertices can be set by mapping and writing into the vertex buffer (RTC_VERTEX_BUFFER). In case of linear motion blur, two vertex buffers have to get filled (RTC_VERTEX_BUFFER0, RTC_VERTEX_BUFFER1), one for each time step. The index buffer has the default layout of three 32 bit integer indices for each triangle. An index points to the ith vertex. The vertex buffer stores single precision x,y,z floating point coordinates aligned to 16 bytes. The value of the 4th float used for alignment can be arbitrary.

Parameters
scenethe scene the mesh belongs to
flagsgeometry flags
numTrianglesnumber of triangles
numVerticesnumber of vertices
numTimeStepsnumber of motion blur time steps

Referenced by igl::embree::EmbreeIntersector::init().

+ Here is the caller graph for this function:

◆ rtcSetBoundaryMode()

RTCORE_API void rtcSetBoundaryMode ( RTCScene  scene,
unsigned  geomID,
RTCBoundaryMode  mode 
)

Sets boundary interpolation mode for subdivision surfaces.

◆ rtcSetBuffer()

RTCORE_API void rtcSetBuffer ( RTCScene  scene,
unsigned  geomID,
RTCBufferType  type,
const void ptr,
size_t  byteOffset,
size_t  byteStride 
)

Shares a data buffer between the application and Embree. The passed buffer is used by Embree to store index and vertex data. It has to remain valid as long as the mesh exists, and the user is responsible to free the data when the mesh gets deleted. One can optionally speficy a byte offset and byte stride of the elements stored inside the buffer. The addresses ptr+offset+i*stride have to be aligned to 4 bytes on Xeon CPUs and 16 bytes on Xeon Phi accelerators. For vertex buffers, the 4 bytes after the z-coordinate of the last vertex have to be readable memory, thus padding is required for some layouts. If this function is not called, Embree will allocate and manage buffers of the default layout.

◆ rtcSetDisplacementFunction()

RTCORE_API void rtcSetDisplacementFunction ( RTCScene  scene,
unsigned  geomID,
RTCDisplacementFunc  func,
RTCBounds *  bounds 
)

Sets the displacement function.

◆ rtcSetIntersectionFilterFunction()

RTCORE_API void rtcSetIntersectionFilterFunction ( RTCScene  scene,
unsigned  geomID,
RTCFilterFunc  func 
)

Sets the intersection filter function for single rays.

◆ rtcSetIntersectionFilterFunction16()

RTCORE_API void rtcSetIntersectionFilterFunction16 ( RTCScene  scene,
unsigned  geomID,
RTCFilterFunc16  func 
)

Sets the intersection filter function for ray packets of size 16.

◆ rtcSetIntersectionFilterFunction4()

RTCORE_API void rtcSetIntersectionFilterFunction4 ( RTCScene  scene,
unsigned  geomID,
RTCFilterFunc4  func 
)

Sets the intersection filter function for ray packets of size 4.

◆ rtcSetIntersectionFilterFunction8()

RTCORE_API void rtcSetIntersectionFilterFunction8 ( RTCScene  scene,
unsigned  geomID,
RTCFilterFunc8  func 
)

Sets the intersection filter function for ray packets of size 8.

◆ rtcSetMask()

RTCORE_API void rtcSetMask ( RTCScene  scene,
unsigned  geomID,
int  mask 
)

Sets 32 bit ray mask.

Referenced by igl::embree::EmbreeIntersector::init().

+ Here is the caller graph for this function:

◆ rtcSetOcclusionFilterFunction()

RTCORE_API void rtcSetOcclusionFilterFunction ( RTCScene  scene,
unsigned  geomID,
RTCFilterFunc  func 
)

Sets the occlusion filter function for single rays.

◆ rtcSetOcclusionFilterFunction16()

RTCORE_API void rtcSetOcclusionFilterFunction16 ( RTCScene  scene,
unsigned  geomID,
RTCFilterFunc16  func 
)

Sets the occlusion filter function for ray packets of size 16.

◆ rtcSetOcclusionFilterFunction4()

RTCORE_API void rtcSetOcclusionFilterFunction4 ( RTCScene  scene,
unsigned  geomID,
RTCFilterFunc4  func 
)

Sets the occlusion filter function for ray packets of size 4.

◆ rtcSetOcclusionFilterFunction8()

RTCORE_API void rtcSetOcclusionFilterFunction8 ( RTCScene  scene,
unsigned  geomID,
RTCFilterFunc8  func 
)

Sets the occlusion filter function for ray packets of size 8.

◆ rtcSetTessellationRate()

RTCORE_API void rtcSetTessellationRate ( RTCScene  scene,
unsigned  geomID,
float  tessellationRate 
)

Sets a uniform tessellation rate for subdiv meshes and hair geometry. For subdivision meshes the RTC_LEVEL_BUFFER can also be used optionally to set a different tessellation rate per edge.

◆ rtcSetTransform()

RTCORE_API void rtcSetTransform ( RTCScene  scene,
unsigned  geomID,
RTCMatrixType  layout,
const float *  xfm 
)

Sets transformation of the instance.

Parameters
scenescene handle
geomIDID of geometry
layoutlayout of transformation matrix
xfmpointer to transformation matrix

◆ rtcSetTransform2()

RTCORE_API void rtcSetTransform2 ( RTCScene  scene,
unsigned int  geomID,
RTCMatrixType  layout,
const float *  xfm,
size_t  timeStep = 0 
)

Sets transformation of the instance for specified timestep.

Parameters
scenescene handle
geomIDID of geometry
layoutlayout of transformation matrix
xfmpointer to transformation matrix
timeSteptimestep to set the matrix for

◆ rtcSetUserData()

RTCORE_API void rtcSetUserData ( RTCScene  scene,
unsigned  geomID,
void ptr 
)

Set pointer for user defined data per geometry. Invokations of the various user intersect and occluded functions get passed this data pointer when called.

◆ rtcUnmapBuffer()

RTCORE_API void rtcUnmapBuffer ( RTCScene  scene,
unsigned  geomID,
RTCBufferType  type 
)

Unmaps specified buffer.

A buffer has to be unmapped before the rtcEnable, rtcDisable, rtcUpdate, or rtcDeleteGeometry calls are executed.

Referenced by igl::embree::EmbreeIntersector::init().

+ Here is the caller graph for this function:

◆ rtcUpdate()

RTCORE_API void rtcUpdate ( RTCScene  scene,
unsigned  geomID 
)

Update all geometry buffers.

Each time geometry buffers got modified, the user has to call some update function to tell the ray tracing engine which buffers got modified. The rtcUpdate function taggs each geometry buffer of the specified geometry as modified.

◆ rtcUpdateBuffer()

RTCORE_API void rtcUpdateBuffer ( RTCScene  scene,
unsigned  geomID,
RTCBufferType  type 
)

Update spefific geometry buffer.

Each time geometry buffers got modified, the user has to call some update function to tell the ray tracing engine which buffers got modified. The rtcUpdateBuffer function taggs a specific buffer of some geometry as modified.