http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

Wise2Food



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gameprogrammer] Re: openglHow



Hi There,
 
In my "Limited..." OpenGL experience I would say that you DO need to render transparent elements last.  The GL_BLEND settings blend what you are drawing with what is already there (or has already been drawn).  Also, I have found that some cases require you to turn off GL_DEPTH_TEST and then turn it back on when you have completed rendering your transparent elements.  This means (as you would normally have GL_DEPTH_TEST switched on for 3D) that grouping your transparent elements together and rendering them last should acheive the desired effect.
 
e.g.
 
glEnable(GL_DEPTH_TEST)
glDisable(GL_BLEND)
 
     ..... Render a building .....
 
glDisable(GL_DEPTH_TEST)
glEnable(GL_BLEND)
 
     ..... Render the windows .....
 
This works for me.
 
Regards
 
Richard

 
On 29/04/07, Stephen Smith <gp@carlylesmith.karoo.co.uk> wrote:
Do you need to draw transparent objects last, to ensure that "hidden"
objects are  taken into account by GL?  (If you see what I mean).

Steve


Alan Wolfe wrote:
> hey Yasser
>
> after you get GL blend working, using an alpha of 1.0 will be opaque
> (can't see through it) and 0.0 will be fully transparent (can't see it
> at all) and 0.5 will be half way between.
>
> I think it's possible to set it up in such a way where that's reversed
> but if i recall correctly thats the default behaviour (:
>
> On 4/26/07, Yasser Gonzalez <yassergs@ispejv.rimed.cu> wrote:
>> When I use glColor4f function how I make tranarent shapes???
>>
>> The alpha parameter must greater than 0 or less????
>>
>>
>> ---------------------
>> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>>
>>
>>
>
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>
>
>
>
>
>



---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html