1RTC_GEOMETRY_TYPE_USER(3)Embree Ray Tracing Kernels 3RTC_GEOMETRY_TYPE_USER(3)
2
3
4
5 NAME
6 RTC_GEOMETRY_TYPE_USER - user geometry type
7
8 SYNOPSIS
9 #include <embree3/rtcore.h>
10
11 RTCGeometry geometry =
12 rtcNewGeometry(device, RTC_GEOMETRY_TYPE_USER);
13
14 DESCRIPTION
15 User-defined geometries contain a number of user-defined primitives,
16 just like triangle meshes contain multiple triangles. The shape of the
17 user-defined primitives is specified through registered callback func‐
18 tions, which enable extending Embree with arbitrary types of primi‐
19 tives.
20
21 User-defined geometries are created by passing RTC_GEOMETRY_TYPE_USER
22 to the rtcNewGeometry function call. One has to set the number of
23 primitives (see rtcSetGeometryUserPrimitiveCount), a user data pointer
24 (see rtcSetGeometryUserData), a bounding function closure (see rtcSet‐
25 GeometryBoundsFunction), as well as user-defined intersect (see rtcSet‐
26 GeometryIntersectFunction) and occluded (see rtcSetGeometryOccluded‐
27 Function) callback functions. The bounding function is used to query
28 the bounds of all time steps of a user primitive, while the intersect
29 and occluded callback functions are called to intersect the primitive
30 with a ray. The user data pointer is passed to each callback invoca‐
31 tion and can be used to point to the application's representation of
32 the user geometry.
33
34 The creation of a user geometry typically looks the following:
35
36 RTCGeometry geometry = rtcNewGeometry(device, RTC_GEOMETRY_TYPE_USER);
37 rtcSetGeometryUserPrimitiveCount(geometry, numPrimitives);
38 rtcSetGeometryUserData(geometry, userGeometryRepresentation);
39 rtcSetGeometryBoundsFunction(geometry, boundsFunction);
40 rtcSetGeometryIntersectFunction(geometry, intersectFunction);
41 rtcSetGeometryOccludedFunction(geometry, occludedFunction);
42
43 Please have a look at the rtcSetGeometryBoundsFunction, rtcSetGeometry‐
44 IntersectFunction, and rtcSetGeometryOccludedFunction functions on the
45 implementation of the callback functions.
46
47 Primitives of a user geometry are ignored during rendering when their
48 bounds are empty, thus bounds have lower>upper in at least one dimen‐
49 sion.
50
51 See tutorial [User Geometry] for an example of how to use the user-de‐
52 fined geometries.
53
54 EXIT STATUS
55 On failure NULL is returned and an error code is set that can be
56 queried using rtcGetDeviceError.
57
58 SEE ALSO
59 [rtcNewGeometry], [rtcSetGeometryUserPrimitiveCount], [rtcSetGeome‐
60 tryUserData], [rtcSetGeometryBoundsFunction], [rtcSetGeometryIntersect‐
61 Function], [rtcSetGeometryOccludedFunction]
62
63
64
65 RTC_GEOMETRY_TYPE_USER(3)