[gameprogrammer] Re: openglHow
- From: "richard sabbarton" <richard.sabbarton@xxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Sun, 29 Apr 2007 23:22:43 +0100
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@xxxxxxxxxxxxxxxxxxxxxxxx> 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@xxxxxxxxxxxxxxx> 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
- References:
- [gameprogrammer] Re: openglHow
- From: Yasser Gonzalez
- [gameprogrammer] Re: openglHow
- From: Alan Wolfe
- [gameprogrammer] Re: openglHow
- From: Stephen Smith
Other related posts:
- » [gameprogrammer] Re: openglHow
- » [gameprogrammer] Re: openglHow
- » [gameprogrammer] Re: openglHow
- » [gameprogrammer] Re: openglHow
- » [gameprogrammer] Re: openglHow
- » [gameprogrammer] Re: openglHow
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@xxxxxxxxxxxxxxx> 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
- [gameprogrammer] Re: openglHow
- From: Yasser Gonzalez
- [gameprogrammer] Re: openglHow
- From: Alan Wolfe
- [gameprogrammer] Re: openglHow
- From: Stephen Smith