AvailVidMem & TotalVidMem

Started by JBR, April 30, 2021, 23:40:06

Previous topic - Next topic

JBR

Hi, I was using CopyMesh rather then CopyEntity as I thought (wrongly) I could only change vertices on the Mesh. (ok talking bollocks, if I have a few CopyEntity then it doesnot work).

So, I found my program crashed the more ships I added to a planet. The debug info was incomprehensible.

I switched to CopyEntity and all is well.

Why, if I can change the vertices on a CopyEntity then why does it take less VRAM than a CopyMesh.

I'm talking 26*256*2048 vertices with faces and the only solution was I was running out of VRAM and this caused the crashes.

Can I ask what functions I can do to a CopyEntity and why would I use CopyMesh.

Also here is my VRAM info.

Available Video Mem : -32283104
Total Video Mem     : -65536

I have a 6Gb graphics card.

Any insights greatly appreciated. Jim.

RemiD

#1
copyentity allows you to have many copies of the same mesh (with same structure of surface / vertices / triangles).
good for identical never changing shapes like clones, bullets, impacts, particles...

copymesh allows you to  have many separate meshes, than you can alter, either in structure (surface / vertices / triangles), or for shape deformations (a vehicle which would be damaged, a character which would be cut or loose a limb), or for custom lighting shading of vertices (using vertices colors), or to merge separate meshes / surfaces into one big mesh / surface (for procedural generation of the environment, of plants, of furnitures, of characters).


for separate shapes, a copy with copyentity is faster to render than a copy with copymesh, since with copyentity the surface is rendered once, whereas with copymesh each surface is rendered once.
but if you merge separate shapes into one big mesh / surface, for static environments, or for a vehicle / character with all its equipment merged into 1 surface 1 texture, then copymesh becomes useful.
also take a look at this function to merge different surfaces into 1 surface :
https://www.syntaxbomb.com/index.php/topic,1875.msg30594.html#msg30594


note that if you implement an efficient system to hide / show only the necessary shapes, you can use many copymesh without problems...


to prevent MAV, make sure that each surface contains less than 32000vertices, 32000triangles.

JBR

Thanks, I understand.

Is there a way to get correct values for AvailVidMem & TotalVidMem?

Jim