Jump to content
  • Advertisement
Sign in to follow this  
Alex Red

Drawing Same Item in a VB may degrade Fps...?

This topic is 4828 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Guys... Improving up a DX7 Engine... I have noticed a thing that I'd like is some1 could confirm me... I have built up a VB Manager to have a nice rendering time on little items... What I notice is that for SAME VB, if I render 8 ( just an example number ) times 8 COPIES of the the same Item sequentially, having allocated them at different offsets in the same VB, I got really nice timings... the total drawing time for all 8 items is about the same for just one Item... On the contrary, if I draw the SAME ITEM ( so, the same COPY of the item in the VB ) 8 times sequentially, total rendering time increases for each drawn item... Should I suppose that rendering of the same item must be 'interleaved' with other renderings in the same VB as most as possible for the GPU having 'locked' the under-draw-Item...? Can any1 confirm plz...? Tnx [R]ed

Share this post


Link to post
Share on other sites
Advertisement
Can you detail a bit more about what you are doing to this buffer? It sounds unlikely unless you are locking it.

Share this post


Link to post
Share on other sites
Tnx for Replay DBX...
no... buffer is unlocked...ops...I forgot, working with indexed Primitives..
I have a list of Items... I tested allocating in a single Vertex buffer 8 copies of the same object at different indexes, and draw each copy once sequentially, and having a very nice overall draw timing... and after allocating the object only once in the same Vertex Buffer, and drawing it 8 times...this 2nd option gave me worst overall draw timings, seems a little overhead time for each draw...
this is happening on both nVidia and ATI cards... so I wonder if passing references of an object already ( probably ) under draw may stuck a little the CPU...

tnx

[R]ed

Share this post


Link to post
Share on other sites
A notice that is better I specify...
The timings I am speaking are of of few microSeconds...some tenths... but the Game I am working on, may have about 300-400 3D objects in the visible area of a single scene, even if few vertices, so, also few microSeconds for each object may rise to milliSeconds...

Share this post


Link to post
Share on other sites
So, you are doing 8 DIP calls. In one case each has a different offset into the index buffer because you have the vertices duplicated 8 times. In the other case you are keeping the offset the same and reusing the same vertices each call.
If your offsets are incremental, then D3D will notice this and combine them into a single DIP call before sending it to the driver. This will be a noticable speed difference.

Share this post


Link to post
Share on other sites
well... each object is not done by a single Draw Call... calls r more than one for each object... but the objects are pretty the same...
I disabled Drawing primitives too, to check if speed difference was in the Drawing engine traversing the object... but no difference apart of course a little object traversing time for each draw...
I thought to processor caching too, but got no sense, as having the same object at same offsets draw more times should be the faster, not the slower case...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!