Skip to main content
GameDev.net gamedev.net
🔒 Locked

overlay in models

Started by stroma Oct 10, 2004 at 8:26 AM 5 replies 650+ views
Original Post
stroma
stroma
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]
+-+-+-+-+-STR
666_1337
666_1337
well, if you use models for your tree's you don't need overlay for the leafs...
our new version has many new and good features. sadly, the good nes are not new and the new nes are not good oo
stroma
stroma
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
+-+-+-+-+-STR
rick_appleton
rick_appleton
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.
mikeman
mikeman
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.

stroma
stroma
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?
+-+-+-+-+-STR

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.