Archived

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

Raloth

accessing stream data

Recommended Posts

Raloth    379
Is it possible for a vertex shader to take data from one stream and combine it with another? If so: If one vertex stream has an associated inex buffer and the other does not but has data that lines up, can the two be combined? [edit] fixed a typo that made the question make no sense [edited by - Raloth on January 16, 2004 10:49:30 PM]

Share this post


Link to post
Share on other sites
Morten    139
All streams use the same indexbuffer. They don''t have to be the same format.
You can combine the different streams in a vertexshader. That''s what they do

-Morten-

Share this post


Link to post
Share on other sites
Raloth    379
quote:
All streams use the same indexbuffer.
I''m trying to write a tile engine. The actual positions of the vertices are shared by everything so I don''t want to waste the memory of repeating them. The only things that are different between vertices are the texture coordinates. Each tile has its own separate pair of 4 texture coordinates, so repeating vertices quickly adds up to huge amounts of memory. Is there any way to make an indux buffer only apply to one stream?

Share this post


Link to post
Share on other sites
Morten    139
No. The index buffer applies to all streams.

You can change the mapping so it just continues on (unless you need to clamp your textures). There''s a limit to how many times you can wrap the texture coordinates, though. It can save loads of memory. This will also improve your average striplength and the post transform cache behaves much better.

-Morten-

Share this post


Link to post
Share on other sites
treething    122
If you''re using vertex shaders and are worried about the memory usage you could try and compress the texture coordinates. Or maybe you could calculate them in the shader somehow?

Share this post


Link to post
Share on other sites