1RTC_GEOMETRY_TYPE_*_CURVE(E3m)bree Ray Tracing KernelsRT3C_GEOMETRY_TYPE_*_CURVE(3)
2
3
4
5 NAME
6 RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE -
7 flat curve geometry with linear basis
8
9 RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE -
10 flat curve geometry with cubic Bézier basis
11
12 RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE -
13 flat curve geometry with cubic B-spline basis
14
15 RTC_GEOMETRY_TYPE_FLAT_HERMITE_CURVE -
16 flat curve geometry with cubic Hermite basis
17
18 RTC_GEOMETRY_TYPE_FLAT_CATMULL_ROM_CURVE -
19 flat curve geometry with Catmull-Rom basis
20
21 RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BEZIER_CURVE -
22 flat normal oriented curve geometry with cubic Bézier basis
23
24 RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BSPLINE_CURVE -
25 flat normal oriented curve geometry with cubic B-spline basis
26
27 RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_HERMITE_CURVE -
28 flat normal oriented curve geometry with cubic Hermite basis
29
30 RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_CATMULL_ROM_CURVE -
31 flat normal oriented curve geometry with Catmull-Rom basis
32
33 RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE -
34 sweep surface curve geometry with cubic Bézier basis
35
36 RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE -
37 sweep surface curve geometry with cubic B-spline basis
38
39 RTC_GEOMETRY_TYPE_ROUND_HERMITE_CURVE -
40 sweep surface curve geometry with cubic Hermite basis
41
42 RTC_GEOMETRY_TYPE_ROUND_CATMULL_ROM_CURVE -
43 sweep surface curve geometry with Catmull-Rom basis
44
45 SYNOPSIS
46 #include <embree3/rtcore.h>
47
48 rtcNewGeometry(device, RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE);
49 rtcNewGeometry(device, RTC_GEOMETRY_TYPE_FLAT_BEZIER_CURVE);
50 rtcNewGeometry(device, RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE);
51 rtcNewGeometry(device, RTC_GEOMETRY_TYPE_FLAT_HERMITE_CURVE);
52 rtcNewGeometry(device, RTC_GEOMETRY_TYPE_FLAT_CATMULL_ROM_CURVE);
53 rtcNewGeometry(device, RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BEZIER_CURVE);
54 rtcNewGeometry(device, RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_BSPLINE_CURVE);
55 rtcNewGeometry(device, RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_HERMITE_CURVE);
56 rtcNewGeometry(device, RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_CATMULL_ROM_CURVE);
57 rtcNewGeometry(device, RTC_GEOMETRY_TYPE_ROUND_BEZIER_CURVE);
58 rtcNewGeometry(device, RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE);
59 rtcNewGeometry(device, RTC_GEOMETRY_TYPE_ROUND_HERMITE_CURVE);
60 rtcNewGeometry(device, RTC_GEOMETRY_TYPE_ROUND_CATMULL_ROM_CURVE);
61
62 DESCRIPTION
63 Curves with per vertex radii are supported with linear, cubic Bézier,
64 cubic B-spline, and cubic Hermite bases. Such curve geometries are
65 created by passing RTC_GEOMETRY_TYPE_FLAT_LINEAR_CURVE, RTC_GEOME‐
66 TRY_TYPE_FLAT_BEZIER_CURVE, RTC_GEOMETRY_TYPE_FLAT_BSPLINE_CURVE,
67 RTC_GEOMETRY_TYPE_FLAT_HERMITE_CURVE, RTC_GEOMETRY_TYPE_FLAT_CAT‐
68 MULL_ROM_CURVE, RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_FLAT_BEZIER_CURVE,
69 RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_FLAT_BSPLINE_CURVE, RTC_GEOME‐
70 TRY_TYPE_NORMAL_ORIENTED_FLAT_HERMITE_CURVE, RTC_GEOMETRY_TYPE_NOR‐
71 MAL_ORIENTED_FLAT_CATMULL_ROM_CURVE, RTC_GEOME‐
72 TRY_TYPE_ROUND_BEZIER_CURVE, RTC_GEOMETRY_TYPE_ROUND_BSPLINE_CURVE,
73 RTC_GEOMETRY_TYPE_ROUND_HERMITE_CURVE, or RTC_GEOMETRY_TYPE_ROUND_CAT‐
74 MULL_ROM_CURVE to the rtcNewGeometry function. The curve indices can
75 be specified through an index buffer (RTC_BUFFER_TYPE_INDEX) and the
76 curve vertices through a vertex buffer (RTC_BUFFER_TYPE_VERTEX). For
77 the Hermite basis a tangent buffer (RTC_BUFFER_TYPE_TANGENT), normal
78 oriented curves a normal buffer (RTC_BUFFER_TYPE_NORMAL), and for nor‐
79 mal oriented Hermite curves a normal derivative buffer (RTC_BUF‐
80 FER_TYPE_NORMAL_DERIVATIVE) has to get specified additionally. See
81 rtcSetGeometryBuffer and rtcSetSharedGeometryBuffer for more details on
82 how to set buffers.
83
84 The index buffer contains an array of 32-bit indices (RTC_FORMAT_UINT
85 format), each pointing to the first control vertex in the vertex buf‐
86 fer, but also to the first tangent in the tangent buffer, and first
87 normal in the normal buffer if these buffers are present.
88
89 The vertex buffer stores each control vertex in the form of a single
90 precision position and radius stored in (x, y, z, r) order in memory
91 (RTC_FORMAT_FLOAT4 format). The number of vertices is inferred from
92 the size of this buffer. The radii may be smaller than zero but the
93 interpolated radii should always be greater or equal to zero. Simi‐
94 larly, the tangent buffer stores the derivative of each control vertex
95 (x, y, z, r order and RTC_FORMAT_FLOAT4 format) and the normal buffer
96 stores a single precision normal per control vertex (x, y, z order and
97 RTC_FORMAT_FLOAT3 format).
98
99 For the linear basis the indices point to the first of 2 consecutive
100 control points in the vertex buffer. The first control point is the
101 start and the second control point the end of the line segment. When
102 constructing hair strands in this basis, the end-point can be shared
103 with the start of the next line segment.
104
105 For the cubic Bézier basis the indices point to the first of 4 consecu‐
106 tive control points in the vertex buffer. These control points use the
107 cubic Bézier basis, where the first control point represents the start
108 point of the curve, and the 4th control point the end point of the
109 curve. The Bézier basis is interpolating, thus the curve does go
110 exactly through the first and fourth control vertex.
111
112 For the cubic B-spline basis the indices point to the first of 4 con‐
113 secutive control points in the vertex buffer. These control points
114 make up a cardinal cubic B-spline (implicit equidistant knot vector).
115 This basis is not interpolating, thus the curve does in general not go
116 through any of the control points directly. A big advantage of this
117 basis is that 3 control points can be shared for two continuous neigh‐
118 boring curve segments, e.g. the curves (p0,p1,p2,p3) and (p1,p2,p3,p4)
119 are C1 continuous. This feature make this basis a good choise to con‐
120 struct continuous multi-segment curves, as memory consumption can be
121 kept minimal.
122
123 For the cubic Hermite basis the indices point to the first of 2 consec‐
124 utive points in the vertex buffer, and the first of 2 consecutive tan‐
125 gents in the tangent buffer. These two points and two tangents make up
126 a cubic Hermite curve. This basis is interpolating, thus does exactly
127 go through the first and second control point, and the first order de‐
128 rivative at the begin and end matches exactly the value specified in
129 the tangent buffer. When connecting two segments continuously, the end
130 point and tangent of the previous segment can be shared. Different
131 versions of Catmull-Rom splines can be easily constructed usig the Her‐
132 mite basis, by calculating a proper tangent buffer from the control
133 points.
134
135 For the Catmull-Rom basis the indices point to the first of 4 consecu‐
136 tive control points in the vertex buffer. This basis goes through p0
137 and p3, with p0-p1 and p2-p3 tangents.
138
139 The RTC_GEOMETRY_TYPE_FLAT_* flat mode is a fast mode designed to ren‐
140 der distant hair. In this mode the curve is rendered as a connected
141 sequence of ray facing quads. Individual quads are considered to have
142 subpixel size, and zooming onto the curve might show geometric arti‐
143 facts. The number of quads to subdivide into can be specified through
144 the rtcSetGeometryTessellationRate function. By default the tessella‐
145 tion rate is 4.
146
147 The RTC_GEOMETRY_TYPE_NORMAL_ORIENTED_* mode is a mode designed to ren‐
148 der blades of grass. In this mode a vertex spline has to get specified
149 as for the previous modes, but additionally a normal spline is
150 required. If the Hermite basis is used, the RTC_BUFFER_TYPE_NORMAL and
151 RTC_BUFFER_TYPE_NORMAL_DERIVATIVE buffers have both to be set.
152
153 The curve is rendered as a flat band whose center approximately follows
154 the provided vertex spline, whose half width approximately follows the
155 provided radius spline, and whose normal orientation approximately fol‐
156 lows the provided normal spline.
157
158 To intersect the normal oriented curve, we perform a newton-raphson
159 style intersection of a ray with a tensor product surface of a linear
160 basis (perpendicular to the curve) and cubic Bézier basis (along the
161 curve). We use a guide curve and its derivatives to construct the con‐
162 trol points of that surface. The guide curve is defined by a sweep
163 surface defined by sweeping a line centered at the vertex spline loca‐
164 tion along the curve. At each parameter value the half width of the
165 line matches the radius spline, and the direction matches the cross
166 product of the normal from the normal spline and tangent of the vertex
167 spline. Note that this construction does not work when the provided
168 normals are parallel to the curve direction. For this reason the pro‐
169 vided normals should best be kept as perpendicular to the curve direc‐
170 tion as possible.
171
172 In the RTC_GEOMETRY_TYPE_ROUND_* round mode, a real geometric surface
173 is rendered for the curve, which is more expensive but allows closeup
174 views. This mode renders a sweep surface by sweeping a varying radius
175 circle tangential along the curve. As a limitation, the radius of the
176 curve has to be smaller than the curvature radius of the curve at each
177 location on the curve. The round mode is currently not supported for
178 the linear basis.
179
180 The intersection with the curve segment stores the parametric hit loca‐
181 tion along the curve segment as u-coordinate (range 0 to +1).
182
183 For flat curves, the v-coordinate is set to the normalized distance in
184 the range -1 to +1. For normal oriented curves the v-coordinate is in
185 the range 0 to 1. For the linear basis and in round mode the v-coordi‐
186 nate is set to zero.
187
188 In flat mode, the geometry normal Ng is set to the tangent of the curve
189 at the hit location. In round mode and for normal oriented curves, the
190 geometry normal Ng is set to the non-normalized geometric normal of the
191 surface.
192
193 For multi-segment motion blur, the number of time steps must be first
194 specified using the rtcSetGeometryTimeStepCount call. Then a vertex
195 buffer for each time step can be set using different buffer slots, and
196 all these buffers must have the same stride and size. For the Hermite
197 basis also a tangent buffer has to be set for each time step and for
198 normal oriented curves a normal buffer has to get specified for each
199 time step.
200
201 Also see tutorials [Hair] and [Curves] for examples of how to create
202 and use curve geometries.
203
204 EXIT STATUS
205 On failure NULL is returned and an error code is set that can be
206 queried using rtcGetDeviceError.
207
208 SEE ALSO
209 [rtcNewGeometry]
210
211
212
213 RTC_GEOMETRY_TYPE_*_CURVE(3)