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