Skip to main content
GameDev.net gamedev.net
🔒 Locked

accessing stream data

Started by Raloth Jan 16, 2004 at 4:40 PM 4 replies 400+ views
Original Post
Raloth
Raloth
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]
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
Morten
Morten
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-
Raloth
Raloth
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?
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
Morten
Morten
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-
Raloth
Raloth
I can''t do that. The textures do not repeat like that.
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
treething
treething
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?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.