Sign in to follow this  

overlay in models

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

This topic is 4812 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this