Simon.Anderson Posted August 26, 2015 Posted August 26, 2015 Currently we have some code that is importing simple box shapes form a csv file (irregular in size and shape and rotation) and rendering them (~500,000 in the scene) in the following way: * Calculation of the vertices for each block is all done in the geometry shader * Triangulation of the sides of the block all done in the geometry shader* Colour of each side of the block slightly differently (also calculated in the shader) for a shadow effect* Rotation of the block is also performed in the shader So pretty much everything is done in the shader - I'm not convinced this is the way to so and there are currently bugs in the shader code. I'm thinking a nicer/maintanable/extensible way to do it would involve the following: * Remove all logic from geometry shader* Use ObjectDynamicMesh to manually create and rotate each block* Group all blocks into a Unigine::ObjectMeshCluster* Create a static uv mapped mesh (with baked shadows) that we load into a ObjectDynamicMesh and simply set the vertices to the positions matching the associated block from the csv file. Can anyone see any issues/gotchas with this? There's minimal work done in the custom shader but Unigine would be doing most of the heavy lifting and I'd hope we'd see comparable results in terms of performance. Any help/opinions would be much appreciated. Thanks, Simon
maxi Posted October 12, 2015 Posted October 12, 2015 Hi Simon, You can't group different meshes (with different shapes) into the ObjectMeshCluster, you can apply different transforms to one mesh.
Recommended Posts