Archived

This topic is now archived and is closed to further replies.

d000hg

Multipass SLOWER than single passes

Recommended Posts

I''m working on a terrain engine, blending textures so each triangle has 3 textures. At first sight you''d want to add a single-pass version for cards with 3 or more texture units, but I''m wondering if all the SetTexture calls you''d need for this would make it slower than 3 single passes, where you can draw 1000s of triangleas at once. In the singlepass version, not many polys will share the exact same combination of textures. I don''t have a card to single pass on, but what do you think?
Read about my game, project #1 NEW: see my progress from last week - join the mailing list to get this and other updates every week!
John 3:16

Share this post


Link to post
Share on other sites
If you are going to do things like this then you''ll be wanting to sort the polygons you are going to draw by texture to minimise the state changes. This way you can just set the three textures you want, set the texturestagestates and draw all applicable polys. Doing it without any kind of texture sorting does indeed sound very nasty...

Rory.

Share this post


Link to post
Share on other sites
Tip : you can put several textures in one bigger one and deals with texture coords to minimize texture changes.

Note 1 : most video cards (even older ones) have 2 texture units and could render your scene in two passes, which should be a good speed improvement. Moreover, it will be easier to find triangles which share the same textures.

Note 2 : multipass rendering is more fillrate expansive than it may look. Since you have to render all passes after the first one with blending enabled, they are twice as slow as the first one. Therefore, two passes aren''t twice as expansive as only one pass, but three times as expansive. (and 3 passes = 5x)

Anyway, remember than additionnal are very expansive and you should try to minimize them.

PS : don''t take me wrong, it depends on how you deal your passes but basically, it''s something like this.

Good luck!

Share this post


Link to post
Share on other sites
If you can somehow identify the polys that use 3 textures, draw that using the 3 texture stages enable, else draw with one texture.
If you don''t want to try my alternate option (http://www.gamedev.net/community/forums/topic.asp?topic_id=106326), then add an additional tag to each poly which sorta keeps track of how many textures it uses (u can maintain an additional integer list, which has a one to one correspondance with ur face/tri list). sort your tri list based on this second integer list. Then render them based by selecting an appropriate number of texture stages.


quote:

...but I''m wondering if all the SetTexture calls you''d need for this would make it slower than 3 single passes, where you can draw 1000s of triangleas at once. In the singlepass version, not many polys will share the exact same combination of textures...



Absolutely...you will be rendering a large number of polys, but none of them actually won''t be using all the three textures. But
the hardware will still try to use the 3 textures and do a blend.


hope this helps...

Share this post


Link to post
Share on other sites