Archived

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

Zorbfish

Indexed Quads and Efficiency

Recommended Posts

*WARNING LONG POST Ok, I''m working on a 2d tile engine in d3d like old school jump and runs and rpgs. After getting some help I managed to set up an indexed triangle list grid that covered the whole screen. I''m using DrawIndexPrimitive to speed up the triangle rendering. All was well until I wanted to add textures. Question #1: For example say quad0 has texture coordinates that gives it tile0 in the texture, and quad1 that''s directly to the right of it and its texture coordinates point to tile1. The indices reference the vertices of quad0 as part of quad1. Won''t this cause my texture to display incorrectly? Also I''ve been really beating myself up over trying to maintain an efficient render each frame. Because of this I really don''t know where to go with rendering. I''ve been advised to look at terrain engines which is similar to what I''m doing except for the I''m doing just flat 2D and with only small maps that come nowhere close to the size of a landscape. Also I really want the perks of rotation and scaling so I''ve been working with untransformed vertices. I''ve done almost everything I can do without rendering anything because I can''t find a way to do it efficiently. Oh, and sorry, google isn''t going to help with this one because I''ve SEARCHED forever for this (keywords "2d", "tiling", "rendering", "d3d8", "direct3d", "rpg", "platformer") with almost nothing except for maybe a few articles using d3dxsprite and drawprimitive calls for every sprite. Question #2: What''s the most efficent way to do pure 2D with untransformed vertices? Also if it applies to rendering in general, and would be applicable to 2d, what are some of your performance tips? @DrunkenHyena if you read this: I''ve searched this board a lot on this topic and I remember you posting that you''d write a better version of your 2d article on your site if more people would donate. Well I''d gladly donate if I had a way to use paypal but I dont (no credit card)

Share this post


Link to post
Share on other sites
Ok, I found one answer. I just found the Directx8 faq at msdn that explained about indexed primitives not being able to differentiate texture data.

I''m still interested in Q2 though...

Share this post


Link to post
Share on other sites