1rtcNewGeometry(3) Embree Ray Tracing Kernels 3 rtcNewGeometry(3)
2
3
4
5 NAME
6 rtcNewGeometry - creates a new geometry object
7
8 SYNOPSIS
9 #include <embree3/rtcore.h>
10
11 enum RTCGeometryType
12 {
13 RTC_GEOMETRY_TYPE_TRIANGLE,
14 RTC_GEOMETRY_TYPE_QUAD,
15 RTC_GEOMETRY_TYPE_SUBDIVISION,
16 RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE,
17 RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE,
18 RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE,
19 RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE,
20 RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE,
21 RTC_GEOMETRY_TYPE_USER,
22 RTC_GEOMETRY_TYPE_INSTANCE
23 };
24
25 RTCGeometry rtcNewGeometry(
26 RTCDevice device,
27 enum RTCGeometryType type
28 );
29
30 DESCRIPTION
31 Geometries are objects that represent an array of primitives of the
32 same type. The rtcNewGeometry function creates a new geometry of spec‐
33 ified type (type argument) bound to the specified device (device argu‐
34 ment) and returns a handle to this geometry. The geometry object is
35 reference counted with an initial reference count of 1. The geometry
36 handle can be released using the rtcReleaseGeometry API call.
37
38 Supported geometry types are triangle meshes (RTC_GEOMETRY_TYPE_TRIAN‐
39 GLE type), quad meshes (triangle pairs) (RTC_GEOMETRY_TYPE_QUAD type),
40 Catmull-Clark subdivision surfaces (RTC_GEOMETRY_TYPE_SUBDIVISION
41 type), curve geometries with different bases (RTC_GEOME‐
42 TRY_TYPE_FLAT_LINEAR_CURVE, RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE,
43 RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE, RTC_GEOME‐
44 TRY_TYPE_ROUND_BSPLINE_CURVE, RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE
45 types), user-defined geometries (RTC_GEOMETRY_TYPE_USER), and instances
46 (RTC_GEOMETRY_TYPE_INSTANCE).
47
48 The types RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE and RTC_GEOME‐
49 TRY_TYPE_ROUND_BSPLINE_CURVE will treat the curve as a sweep surface of
50 a varying-radius circle swept tangentially along the curve. The types
51 RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE and RTC_GEOME‐
52 TRY_TYPE_FLAT_BSPLINE_CURVE use ray-facing ribbons as a
53 faster-to-intersect approximation.
54
55 After construction, geometries are enabled by default and not attached
56 to any scene. Geometries can be disabled (rtcDisableGeometry call),
57 and enabled again (rtcEnableGeometry call). A geometry can be attached
58 to a single scene using the rtcAttachGeometry call (or rtcAttachGeome‐
59 tryByID call), and detached using the rtcDetachGeometry call. During
60 attachment, a geometry ID is assigned to the geometry (or assigned by
61 the user when using the rtcAttachGeometryByID call), which uniquely
62 identifies the geometry inside that scene. This identifier is returned
63 when primitives of the geometry are hit in later ray queries for the
64 scene.
65
66 Geometries can also be modified, including their vertex and index buf‐
67 fers. After modifying a buffer, rtcUpdateGeometryBuffer must be called
68 to notify that the buffer got modified.
69
70 The application can use the rtcSetGeometryUserData function to set a
71 user data pointer to its own geometry representation, and later read
72 out this pointer using the rtcGetGeometryUserData function.
73
74 After setting up the geometry or modifying it, rtcCommitGeometry must
75 be called to finish the geometry setup. After committing the geometry,
76 vertex data interpolation can be performed using the rtcInterpolate and
77 rtcInterpolateN functions.
78
79 A build quality can be specified for a geometry using the rtcSetGeome‐
80 tryBuildQuality function, to balance between acceleration structure
81 build performance and ray query performance. The build quality per
82 geometry will be used if a two-level acceleration structure is built
83 internally, which is the case if the RTC_BUILD_QUALITY_LOW is set as
84 the scene build quality. See Section [rtcSetSceneBuildQuality] for
85 more details.
86
87 EXIT STATUS
88 On failure NULL is returned and an error code is set that can be
89 queried using rtcDeviceGetError.
90
91 SEE ALSO
92 [rtcEnableGeometry], [rtcDisableGeometry], [rtcAttachGeometry], [rtcAt‐
93 tachGeometryByID], [rtcUpdateGeometryBuffer], [rtcSetGeometryUserData],
94 [rtcGetGeometryUserData], [rtcCommitGeometry], [rtcInterpolate],
95 [rtcInterpolateN], [rtcSetGeometryBuildQuality], [rtcSetSceneBuildQual‐
96 ity], [RTC_GEOMETRY_TYPE_TRIANGLE], [RTC_GEOMETRY_TYPE_QUAD],
97 [RTC_GEOMETRY_TYPE_SUBDIVISION], [RTC_GEOMETRY_TYPE_CURVE], [RTC_GEOME‐
98 TRY_TYPE_USER], [RTC_GEOMETRY_TYPE_INSTANCE]
99
100
101
102 rtcNewGeometry(3)