Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Upload mesh data into VRAM and re-use it for redraw via manual draw commands?

Discussion in 'General Graphics' started by Digika, Jun 10, 2022.

  1. Digika

    Digika

    Joined:
    Jan 7, 2018
    Posts:
    211
    So specific reasons I'm using DrawMesh to submit some meshes fore rendering manually at the end of a frame. The issue is, since meshes are allocated on RAM, every time I issue this command it is being copied via PCI bus from RAM to VRAM and so on each frame. That's not ideal, as you can imagine.
    I have 3 types of meshes:

    1. Static complex meshes
    2. Dynamic cube, can change size and rotation and position
    3. Sphere, can change size and position

    Now my question is: can I pre-upload case 1 to VRAM and then use returned handle to issue draw commands to draw from existing memory? Is it possible to do the same for 2 and 3 using some on-GPU transformations?
     
    CodeSmile likes this.