Jump to content
  • Advertisement
Sign in to follow this  
stroma

overlay in models

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

hi, i am making a simple demo nd i want to add palm trees on terrain. soo i want to know how can i make a simple overlay effect on leafs? because i dont want to use high ply leafs, they are like billboard.... edit: i am using obj file format for trees but can be change.. edit2: are there any extension for this? thank you.. [Edited by - stroma on October 10, 2004 10:47:16 AM]

Share this post


Link to post
Share on other sites
Advertisement
sorry about english, i think i did tell wrong.. here is the picture of what i want to make:


http://www.mikrop.gen.tr/stroma/palm.jpg

Share this post


Link to post
Share on other sites
The leaves are just a few quads linked together at the edge (from what I can see in the picture, it seems to be 3 or 4 quads) and then textured using an alpha-blend operation, or an alpha-test operation.

To do this operations, your texture should have an alpha-channel and you demo should support drawing objects with alpha blending. Here's a demo from NeHe showing how alpha-blending is done.

Share this post


Link to post
Share on other sites
You need alpha testing.

First,you should load the leaf textures as RGBA textures, with the alpha channel set to 1.0 for visible texels and 0.0 for "invisible".

Then enable alpha testing with glEnable(GL_ALPHA_TEST) and set glAlphaFunc(GL_GREATER,0.0) to discard fragments with alpha=0.

Share this post


Link to post
Share on other sites
soo i need to load tga files with alpha channels? ok, i will add tga support. but i want to learn that, can make a alpha blending with RGB colors, will it look bad?

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!