Radeon ProRender

Curve Creation

Curve geometry can be used for simulating hair, fur or even grass objects.

Curves are created in “batches” in that multiple pieces of curve geometry are created with one call to rprContextCreateCurve(). The tricky part of creating curves is that they are specified to RPR in segments of 4 points. Thus, a curve of 7 points long would be specified as:

point 1, point 2, point 3, point 4 (segment 1), point 4, point 5, point 6, point 7 (segment 2)

Note the doubling of point 4. Otherwise, there would be a gap between the segments. Segments MUST be 4 points. If there are less than 4 points left for a segment, the last point can simply be repeated.

CHECK(rprContextCreateCurve(
	context,
	&newCurve,
	nPoints, // number of 3d points
	cps.data(), // list of 3d points
	3 * sizeof(float), // stride of 3d points
	indices.size(), // number of indices
	segsPerCurve.size(),	// this rpr_curve has N curves	
	indices.data(), // indices pointing to controPoint
	radius.data(), // list of radius (float) for each curve
	uvs.data(), // list of uv (float2) for each curve
	segsPerCurve.data() // number of segment ( rpr_int ) for each curve
));