Jump to content
  • Advertisement
Sign in to follow this  
Yhonatan

MultiTexturing + VBO?

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

Hey guys, Assuming i got a vbo that contains an entire terrain, and i want each of the triangles to have a different texture + that it will combine together. how can I do it? do I have to make a vbo for each triangle? Thanks in advance

Share this post


Link to post
Share on other sites
Advertisement
You could use a texture atlas, multiple sets of texture coordinates and some blend values to combine the textures in a shader.
So, if you want to combine up to 3 textures per triangle (one for each corner) you would need:
1. The texture atlas (all of your terrain textures packed into one big textures)
2. 3 texture coordinates per vertex (for the 3 textures)
3. 3 blend values (you could pack those into a vertex attribute or you could use per vertex colors)
4. A fragment shader that samples the 3 textures and blends them together using the blend values

(you may also achive that through texture combiners but that is most likely more complicated than to use a shader)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!