[gameprogrammer] Re: OpenGL Colours and Alpha
- From: Stephen Smith <gp@xxxxxxxxxxxxxxxxxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Wed, 01 Nov 2006 08:46:34 +0000
Thanks a lot, that certainly changed things. However, I've just
realised that all I needed to do what use Color3f, and set the colour to
dark grey before drawing the texture for all the "normal" objects, but
set it to white for all "bright" objects. I think I got a bit
side-tracked with the whole alpha thing!
Cheers,
Steve
Alan Wolfe wrote:
Heya Steve,
Yep you got it, you have to enable blending
glEnable(GL_BLEND); is the way to do it i think (dont have any gl code
right here at the moment!)
you also can change the type of blending you want with the glBlendFunc
command, so you can do alpha blending, additive blending,
multiplicative blending, difference blending etc. (:
On 10/31/06, *Stephen Smith* <gp@xxxxxxxxxxxxxxxxxxxxxxxx
<mailto:gp@xxxxxxxxxxxxxxxxxxxxxxxx>> wrote:
Hi all,
I'm trying to implement the alpha value in my colours when drawing my
OpenGL scene. I've changed all my colour commands to "glColor4f",
and
have the fourth value as 0.1, except for lasers and explosions where I
have to set to 1. My intention is that these should be bright
compared
to everything else. However, there doesn't seem to be any
difference.
Can anyone tell me why? Do i need "enable" alpha values or something?
(BTW, I'm using Java and JOGL, but since it's a direct mapping to
OpenGL
it should be a non-Java specific answer).
Thanks in advance,
Steve Smith
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- Follow-Ups:
- [gameprogrammer] Re: OpenGL Colours and Alpha
- From: Josh Stewart
Other related posts:
- » [gameprogrammer] OpenGL Colours and Alpha
- » [gameprogrammer] Re: OpenGL Colours and Alpha
- » [gameprogrammer] Re: OpenGL Colours and Alpha
- » [gameprogrammer] Re: OpenGL Colours and Alpha
- » [gameprogrammer] Re: OpenGL Colours and Alpha
- » [gameprogrammer] Re: OpenGL Colours and Alpha
- » [gameprogrammer] Re: OpenGL Colours and Alpha
Heya Steve,Yep you got it, you have to enable blending glEnable(GL_BLEND); is the way to do it i think (dont have any gl code right here at the moment!) you also can change the type of blending you want with the glBlendFunc command, so you can do alpha blending, additive blending, multiplicative blending, difference blending etc. (:
On 10/31/06, *Stephen Smith* <gp@xxxxxxxxxxxxxxxxxxxxxxxx <mailto:gp@xxxxxxxxxxxxxxxxxxxxxxxx>> wrote:
Hi all,
I'm trying to implement the alpha value in my colours when drawing my
OpenGL scene. I've changed all my colour commands to "glColor4f",
and
have the fourth value as 0.1, except for lasers and explosions where I
have to set to 1. My intention is that these should be bright
compared
to everything else. However, there doesn't seem to be any
difference.
Can anyone tell me why? Do i need "enable" alpha values or something?
(BTW, I'm using Java and JOGL, but since it's a direct mapping to
OpenGL
it should be a non-Java specific answer).
Thanks in advance,
Steve Smith
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- [gameprogrammer] Re: OpenGL Colours and Alpha
- From: Josh Stewart