October 19, 2021, 00:22:43

Author Topic: AvailVidMem & TotalVidMem  (Read 394 times)

Offline JBR

  • Full Member
  • ***
  • Posts: 143
AvailVidMem & TotalVidMem
« on: April 30, 2021, 23:40:06 »
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.
« Last Edit: April 30, 2021, 23:48:58 by JBR »

Offline RemiD

  • Hero Member
  • *****
  • Posts: 1290
Re: AvailVidMem & TotalVidMem
« Reply #1 on: May 01, 2021, 07:49:12 »
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 :

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.
« Last Edit: May 01, 2021, 08:07:23 by RemiD »
DualCore AMD E-450, 1646 MHz - 6 Go DDR3 1333 SDRAM - AMD Radeon HD 6320 Graphics (384 Mo) - Windows 7 Home Premium - DirectX 11.0

Offline JBR

  • Full Member
  • ***
  • Posts: 143
Re: AvailVidMem & TotalVidMem
« Reply #2 on: May 01, 2021, 21:29:04 »
Thanks, I understand.

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



SimplePortal 2.3.6 © 2008-2014, SimplePortal