Radeon ProRender

rprContextCreateMeshEx

Creates a new mesh object.

Allows two texture coordinates for a single mesh.

rpr_status rprContextCreateMeshEx( rpr_context context,
  rpr_float const * vertices,
  size_t num_vertices,
  rpr_int vertex_stride,
  rpr_float const * normals,
  size_t num_normals,
  rpr_int normal_stride,
  rpr_int const * perVertexFlag,
  size_t num_perVertexFlags,
  rpr_int perVertexFlag_stride,
  rpr_int numberOfTexCoordLayers,
  rpr_float const ** texcoords,
  size_t const * num_texcoords,
  rpr_int const * texcoord_stride,
  rpr_int const * vertex_indices,
  rpr_int vidx_stride,
  rpr_int const * normal_indices,
  rpr_int nidx_stride,
  rpr_int const ** texcoord_indices,
  rpr_int const * tidx_stride,
  rpr_int const * num_face_vertices,
  size_t num_faces,
  rpr_shape * out_mesh);

Parameters

Parameter Description
context The rendering context hosting the mesh.
vertices Pointer to position data (each position is described with 3 rpr_float numbers).
num_vertices Number of entries in the position array.
vertex_stride Number of bytes between the beginnings of two successive position entries.
normals Pointer to normal data (each normal is described with 3 rpr_float numbers), can be NULL.
num_normals Number of entries in the normal array.
normal_stride Number of bytes between the beginnings of two successive normal entries.
perVertexFlag List of flags to set per vertex, float list. The list should be numflags * num_vertices.
num_perVertexFlags Number of flags set per vertex.
perVertexFlag_stride Number of bytes between two sets of vertex flags.
numberOfTexCoordLayers Number of entries in a texcoord array.
texcoords Pointer to texcoord data (each texcoord is described with 2 rpr_float numbers), can be NULL.
num_texcoords Number of entries in the texcoord array.
texcoord_stride Number of bytes between the beginnings of two successive texcoord entries.
vertex_indices Pointer to an array of vertex indices, used to indicate shared vertices, allowing for some saving on storage space.
vidx_stride Number of bytes between the beginnings of two successive vertex index entries.
normal_indices Pointer to an array of normal indices.
nidx_stride Number of bytes between the beginnings of two successive normal index entries.
texcoord_indices Pointer to an array of texcoord indices.
tidx_stride Number of bytes between the beginnings of two successive texcoord index entries.
num_face_vertices Pointer to an array of num_faces numbers describing the number of vertices for each face (can be 3 (triangle) or 4 (quadrangle).
num_faces Number of faces in a mesh.
out_mesh A pointer to the created mesh object.

Notes

AMD Radeon ProRender supports mixed meshes consisting of either triangles or quads. It also supports meshes with mixed quad/triangle construction.

Positions stored on a per-vertex basis allow data to be re-used (with multiple indices) and consequently saved on storage space.

Mesh import libraries or plug-ins using RPR essentially translate data into a format ready for rprContextCreateMeshEx() to use.

Output

A pointer to a mesh 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.