Jump to content
  • Advertisement
Sign in to follow this  
dantheman1337

Textured Triangle Strips?

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

How would I texture a triangle strip? And also, let's say I would like to change texture mid strip, is that possible? If so, could you explain how to accomplish this?

I'm trying to make terrain, which is simple enough, I even made an editor which saves the files and such. However, I don't know how to go about actually applying textures. Once I know how, it should be a breeze.

Share this post


Link to post
Share on other sites
Advertisement
Lookup 'uv mapping'. Also, you can't change texture in the middle of a strip. Just use multiple draw calls.

Share this post


Link to post
Share on other sites
A single strip is drawn with a single draw-call, so if you want to change any states along the way you need to divide it into two strips. You can still use different textures in the same strip, by binding multiple textures and picking one in the shader, or by using a texture-atlas where changing the texture-coords are enough to pick among multiple sub-textures inside a single larger texture.

Share this post


Link to post
Share on other sites

Lookup 'uv mapping'. Also, you can't change texture in the middle of a strip. Just use multiple draw calls.



I first read your post, and your method sounds like it would work too, however, Erik's approach seems much easier, and efficient.


A single strip is drawn with a single draw-call, so if you want to change any states along the way you need to divide it into two strips. You can still use different textures in the same strip, by binding multiple textures and picking one in the shader, or by using a texture-atlas where changing the texture-coords are enough to pick among multiple sub-textures inside a single larger texture.



I never would have thought of this. I'll turn it in to a class, much thanks :)

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!