Skip to main content
gamedev.net
🔒 Locked

DrawIndexedPrimitive() !!!!!!

Started by Scooter Oct 18, 2000 at 10:45 AM 2 replies 350+ views
Original Post
Scooter
Scooter
Anyone know alot about using DrawIndexedPrimitive(), If i draw a large object is there a way not to draw certain parts of it. Like culling, if the object is off the screen i dont wawnt to draw the vertices that arnt shown. Can this be done? or do you have to draw all vertices in the list? second can D3d give you information on how many triangles/vertices you''re drawing?
We are here just like this,It really doesn't matter why.The world is here like it is,'We could laugh we could cry.Is it good or is it bad,Wright or maybe wrong?There's no use of being sad,Without a purpose within a song.
3dModelMan
3dModelMan
DrawIndexedPrimitive will only pass vertices/triangles onto the rendering pipeline, it will not perform any kind of optimisation for you like you're hoping for. The best you can hope is that the user has hardware accelerated T&L.

If you want to make a really simple 3d game you could probably get away with attempting to render every model in the world, every frame (especially with a good 3d card) but that will soon run out of steam when the scene gets too complicated. (But feel free to try it as you're obviously just starting out with d3d).

quote:

second can D3d give you information on how many triangles/vertices you're drawing?



This will depend on how you load the model data. I'd recommend you try using MS's xfile class that is included in the SDK, but I'm not sure if you can query it for "number of faces". (I'll go and have a look...)

Cheers

Matt





Edited by - 3dmodelman on October 18, 2000 12:33:38 PM
pcvsee
pcvsee
I''m not that familiar with d3d, but i think i''ve read in the sdk documents that if a certain primitive is ouside the viewport which you specified, the primitve will not be rendered. D3d can automatically see if a primitve needs to be rendered or not.

When you''re gonna use DrawIndexedPrimitive(), you have to specify the number of vertices you will use. In other words, in order to use DrawIndexedPrimitive(), you must know the number of vertices to be rendered, so there''s no point in getting the info you want from d3d. The number of faces or triangles will also depend on the triangle type (TRIANGLE_LIST, TRIANGLE_FAN, etc.) you;re gonna use and the number of vertices you specified earlier.

Ridcully
Ridcully
to give my two cent worth, i don''t think drawprimitive does any culling for you. you have to check for visibilty by yourself, for example using ComputeSphereVisibility (at least something like that).
and if you up to a big 3d program you will have to perform your own culling, or just depend on every user having a ghz athlon with a geforce 2 gts

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.