Jump to content

Search the Community

Showing results for tags 'model custom import'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to UNIGINE Forums
    • News & Announcements
    • Getting started
  • Development
    • Content Creation
    • World Design
    • Rendering
    • Animation
    • Physics, Navigation and Path Finding
    • UI Systems
    • Sound & Video
    • Editor
    • C++ Programming
    • C# Programming
    • Networking
    • Sim IG (Image Generator)
    • VR Discussions
    • General
  • Improving UNIGINE
    • Documentation
    • Feedback for UNIGINE team
    • Bug Reports
    • Unigine SDK Beta feedback
  • Community
    • Add-on Store (https://store.unigine.com/)
    • Showcase
    • Collaboration
    • Tools, Plugins, Materials & Tutorials
    • General Discussions
  • Legacy
    • UnigineScript

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 1 result

  1. [SOLVED] Importing a custom model

    I'm trying to import one of our models into Unigine. Currently I use the following C++ method to create objects from individual elements: Vector<ObjectMeshDynamicPtr> objects; void processElement(MyElement* elem) { for( int i = 0; i < elem->nummeshes; ++i ) { MyMesh& mesh = elem->meshes[i]; ObjectMeshDynamicPtr object = ObjectMeshDynamic::create(0); for (int j = 0; j < object->getNumSurfaces(); j++) { object->setMaterial("mesh_base",j); object->setProperty("surface_base",j); } object->clearVertex(); object->clearIndices(); for (int j = 0; j < mesh.numvertices; ++j) { MyVertex& vert = mesh.vertices[j]; object->addVertex(vec3(vert.x, vert.z, vert.y)); object->addTexCoord(vec4(0.0f)); } for (int j = 0; j < mesh.numindices; j += 3) { object->addIndex(mesh.indices[j + 0]); object->addIndex(mesh.indices[j + 2]); object->addIndex(mesh.indices[j + 1]); } object->updateBounds(); object->updateNormals(); object->updateTangents(); object->flush(); objects.append(object); } } While it loads fine, rendering runs very slow compared to our current implementation. I suppose the engine can't utilize its full power because I gave it "just single meshes". My question is how should I tell the engine (through the C++ API!) that: - meshes are static so it can create large batches from them - tell it where the portals are (doors, windows) - tell it that it should be streamed Thanks Steve
×
×
  • Create New...