Optimizing 121 cubes

Started by
1 comment, last by FuzzyBunny 20 years, 11 months ago
bleow everyone, quick question... I have a two dimensional array 11x11 = 121 then i draw a cube for each element on the array, so i have a grid of small cubes on screen. Cubes are rendered using tri lists with no indicies because i have dif texture coords for each face, I use VBs though to render. Now im running a PII 300 with GF2, and i get about 150 fps. Now , that might seem fast, but not really since im making 121 calls to RenderPrimitive() each frame... Now my actual question is: how can i improve that significantly? would it make sence to use one large VB and lock/unlock every frame and update all the verts manually? If i do that then how can I use transformations? each cube needs to be able to independently rotate scale and position. Please, any feedback is appreciated, thanks in advance.
Advertisement
Use one VB.
Use one IB based on the VB.
Draw the IB 11x11 times.

See with IB''s you can use a VB to draw them. So if you make the VB with UV''s then the IB will have them too.

.lick
So it does make sence to use one large VB and render the whole thing in one call.

How can I transform/scale/rotate my geom using DX? would I need to transform everything manualy and then put everything into the dynamic VB?

Im just a little unclear on how the pros'' do this. If I had static geometry everything would be easier, but if i have so many small cubes that need to be independently controlled, my FPS gets raped... I now have 25x19 cubes, and my FPS is down to 30... that''s very low

plz help?

This topic is closed to new replies.

Advertisement