LWJGL
May 17, 2012, 03:07:42
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
:
LWJGL 2.8.3 released!
Home
Help
Search
Login
Register
LWJGL
>
Programming
>
OpenGL
>
Fading effect
Pages: [
1
]
« previous
next »
Print
Author
Topic: Fading effect (Read 2488 times)
Ahzraei
Newbie
Posts: 4
Fading effect
«
on:
December 02, 2005, 20:03:52 »
I need to have a fade effect on a texture mapped to a quad; in theory, it should increase the alpha value of the entire texture over an interval of time until the texture is invisible. I've enabled alpha blending and I can draw transparent textures (PNGs with an alpha channel), but I haven't figured out how to change the alpha of a texture in the code before I draw it. How can I do it?
Logged
Orangy Tang
Talks Too Much
Posts: 199
Fading effect
«
Reply #1 on:
December 03, 2005, 06:47:36 »
Vertex colours will be modulated with the texture colour by default. Change your vertex colours' alpha to something other than 1 and you should fade the whole thing (eg. glColor4f(1.0f, 1.0f, 1.0f, 0.5f); ).
Logged
Ahzraei
Newbie
Posts: 4
Fading effect
«
Reply #2 on:
December 04, 2005, 11:53:18 »
Thanks; that works pretty well. I've had to optimize how many times I use glColor4f though, it can slow things down in the game I'm coding (which uses a lot of two-dimensional textures).
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Programming
-----------------------------
=> Lightweight Java Library Game Development
=> LWJGL Documentation
=> Bug Reports / RFE
=> OpenGL
=> OpenAL
=> General Java Game Development
-----------------------------
Archive
-----------------------------
=> Resolved Bugs/RFE
=> DirectX
=> DevIL
=> FMOD
Loading...