Archived

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

Changing textures

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

I have written a terrain generator and are now trying to make the terrain look good. I''m thinking of having several textures that I vary depending on the height of the terrain I''m rendering (mabey also some multitexturing). My question is how to make this efficent (and make it work ). If I simply change the texture between for every vertex that would be extremly slow. I have thought about sorting the vertices acording to the texture they are going to use but I can''t imagine that would work when I try to render it (I''m using DrawIndexedPrimitives, or whatever it''s called, don''t have the code here). I''m sure there is a better way to do this so please give me some pointers. Thanks

Share this post


Link to post
Share on other sites
Well Let''s see, it all really depends on how you''re generating the terrain. You definately dont want to switch textures every time you draw a vertex, so yes sorting them into lists based on which texture they use is most efficient. You could do this as a pre-process step, even if you have some crazy LOD shit going on. Generating your lists of indices will probably be a lot more bothersome, but not too bad.

Another option would be to lump all the textures into one big texture, then just "change textures" by specifying different texture coordinates.

Share this post


Link to post
Share on other sites