Closed Frank-Dz closed 4 years ago
Yes, because DIRT only renders triangles, it doesn't have any concept of grouping them into "objects". So you need to do all your geometry calculations, transformations, etc. on each object separately, then concatenate everything together before calling rasterise_deferred
.
Specifically
vertices
should just be concatenatedfaces
should be concatenated, and the vertex indices 'shifted' to point to the correct part of vertices
and vertex_attributes
, e.g. for two objects, the second half of faces should point to the second half of verticesIf using textures, the simplest method is
vertex_attributes
should be concatenated, and attributes that correspond to texture coordinates (UVs) should be adjusted according to how the textures were concatenated, e.g. for two objects and textures concatenated along x-axis, the u-coordinates in vertex_attributes
should be halved, and for the 2nd object shifted by +0.5 to use the 2nd half of the concatenated textureThanks! Follow your guidance I successfully made it. Thanks again!
Hi~ Can DIRT support rendering multiple objs at the same time? The demo code only provides the scene containing one object.
Thanks in advance!