Jump to content
  • Advertisement
Sign in to follow this  
Kaezin

Alpha texture blending on terrain

This topic is 4840 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 read the following article about texturing terrain but have some questions about the implementation: http://www.gamedev.net/reference/articles/article2246.asp I'm still new to DirectX so I don't know the best way to implement this. I understand how to do the alpha blending with multiple textures, but how would I actually do the rendering call? The article says to first draw opaque triangles to get the basic texture type down, then draw transparent triangles over the initial triangles to blend the textures. Does that mean that duplicate vertices should be stored in the vertex buffer that have the necessary transparency information, or is there some way to do it without having to create the duplicates? I'm sorry if there is some clear solution that I missed, but I appreciate any help.

Share this post


Link to post
Share on other sites
Advertisement
Assuming your texture coordinates are the same for the opaque and transparent parts, you could use the same vertex & index buffers for both parts.

Basically you do

set up opaque rendering ( ie turn off alpha blending )
set up opaque texture ( base terrain color? )
draw from vb

set up alpha rendering
set up next terrain layer texture
draw from vb

etc.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!