• Advertisement

Archived

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

Texture transformations (D3D) - is it worth it?

This topic is 6246 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

Well basically I''m doing a 2d tile engine in D3D. So i''ve got my vertex buffer with the quad, and I use a transformation to place the quad on the screen (thanks furby). However the problem now is animations. They''re contained in one surface, each frame after each other. The main problem tho'' is updating the texture co-ordinates. I''m trying to make the vertex buffer as static as possible, i.e. no locks after the first inital lock to fill up the quad. So I''m thinking of using texture matrix transformations to adjust the texture values each frame to draw the new frame. Is this worth the bother? Or should I just lock the VB and refill? ------------------------------ BCB DX Library - RAD C++ Game development for BCB

Share this post


Link to post
Share on other sites
Advertisement
Warning: I''m about to postulate a theory..

Why not use an Index Buffer and a Vertex Buffer???
Fill up your vertex buffer with the vertices of your animation
cells, so that you only have to lock it once

THEN

use an index buffer to index which vertices you wish to render..
(avoiding anymore locking)..

would this work??

Wazoo

Share this post


Link to post
Share on other sites
Yes that would work ... yes ...
however you would need more memeory for the extra vertices. Also you would have to multiply those extra vertices (a tiny amount tho'') by each animation - that could add up to something large.
A typical vertex is 32 * 6 bytes (x,y,z,diffuse,u,v) = 192 bytes.
* by lets say 10 frames on average = 1.9 kb.
* for 10 animations = 19 kb.
Tiny I know, but compared to a 4x4 float matrix per animation it IS large:
16*32*10 = 5 kb.
And with texture transformations you can do real-time shears, flips, etc. It''s more flexable.
However it would seem to be slower ....
Which is better?
How much slower is texture transformations? Anyone know?

------------------------------
BCB DX Library - RAD C++ Game development for BCB

Share this post


Link to post
Share on other sites

  • Advertisement