Radeon ProRender

rprContextCreateCurve

Creates a set of curves.

A curve is a set of segments. A segment is always composed of four 3D points.

rpr_status rprContextCreateCurve( rpr_context context,
  rpr_curve * out_curve,
  size_t num_controlPoints,
  rpr_float const * controlPointsData,
  rpr_int controlPointsStride,
  size_t num_indices,
  rpr_uint curveCount,
  rpr_uint const * indicesData,
  rpr_float const * radius,
  rpr_float const * textureUV,
  rpr_int const * segmentPerCurve,
  rpr_uint creationFlag_tapered);

Parameters

Parameter Description
context The context to use.
out_curve rpr_curve object that will be created by this call. Note that an rpr_curve object holds multiple curves, for example a set of hairs on a character’s head.
num_controlPoints Number of points in the curves.
controlPointsData Float (X,Y,Z) points data for curve points.
controlPointsStride Number of bytes per control point. In most of cases, for contiguous controlPointsData, should be set to 3 * sizeof(float).
num_indices Number of indices in the list of point indices. Should be set at : 4 * (number of segments).
curveCount Number of distinct curves.
indicesData List of indices, refers to control points for each curve. Array of rpr_uint[num_indices]. Those are indices to the controlPointsData array.
radius Radius of curves. All curves in this rpr_curve object must have the same radius.
Array of N float. If curve is not tapered, N = curveCount. If curve is tapered, N = 2 * (number of segments).
textureUV Per curve texture UV coordinates. This is useful for doing per curve color, for example a texture that gives leopard fur color with spots.
Array of float2[curveCount].
segmentPerCurve Segments per disctint curve. Curves in this object must have the same number of segments.
Array of rpr_int[curveCount]. (number of segments) = sum of each element of this array.
creationFlag_tapered Set it to 0 by default. Set to 1 if using tapered radius.
May be used for other bit field options in the future (so, don’t set it to a value > 1 for now.)

Notes

Note that you can create any number of curves with this call.

Output

A pointer to a curve object.

Return

Returns RPR_SUCCESS in case of success, or RPR_ERROR code if a problem was encountered.

To learn how to handle errors in AMD Radeon ProRender SDK, see Error Handling.