Mesh compared to Device.DrawIndexedUserPrimitives

Started by
4 comments, last by Evil Steve 16 years, 6 months ago
Hi all, I'm confused over how the Mesh object in DirectX Managed works. I have a lot of meshes with a lot of mesh data, and when rendering them all during the same frame I get either DriverInternalError or OutOfMemory (depending on what MeshFlags I specify when constructing the Mesh objects). If I instead create two arrays of indices and vertices and use Device.DrawIndexedUserPrimitives to render them, I get no error at all. Shouldn't it be possible to get the same effect using the Mesh class by using the "correct" MeshFlags option? I've tried all possible combinations of MeshFlags (i.e. Managed, SystemMemory, WriteOnly, SoftwareProcessing) but without success. Am I missing something here? Thanks, Christian
Advertisement
Quote:Original post by genne
I have a lot of meshes with a lot of mesh data,


How much is a lot?

also, DriverInternalError indicates an error in the driver. Your first step should be checking if a newer version of your Graphics Driver software is available and upgrading if one is.
Sirob Yes.» - status: Work-O-Rama.
A lot is say 5000 meshes, with from 6 to 67456 number of vertices for each mesh (average 84 vertices per mesh).

I have the latest drivers for my card (ATI Radeon Mobility X1400 at a Dell laptop, downloaded from Dell's webpage).

Christian
5000 meshes is 5000 IBs and 5000 VBs. You'll be making 5000 IB and VB switches and 5000 DrawPrimitive calls per frame. I'll be amazed if you get anything near realtime performance with that setup. You should really re-think your setup...
Quote:Original post by Evil Steve
5000 meshes is 5000 IBs and 5000 VBs. You'll me making 5000 IB and VB switches and 5000 DrawPrimitive calls per frame. I'll be amazed if you get anything near realtime performance with that setup. You should really re-think your setup...


I know it's a lot of data to render, when using DrawIndexedUserPrimitives i get a frame rate of about 2 FPS (which is ok for me). Re-thinking my setup is a later problem, now I just need to get it working with these large amount of data.

Anyway, it's not that big of a problem now when it works fine with DrawIndexedUserPrimitives, I was just wondering why it crashes when using the Mesh class.
DriverInternalError is definitely a driver problem. What happens if you create your own vertex and index buffers and use DrawIndexedPrimitives? Does it give you an internal error there too?

It's possible that the driver just hasn't been tested or can't cope with that amount of data per frame (Althoguh it's unlikely).

This topic is closed to new replies.

Advertisement