View Full Version : Blending for Clouds....
07-13-2005, 10:01 PM
I have two 512x512 32-bit cloud like bitmaps.
I've placed one slighty above the other.
( layer-1 at y, and layer-2 at y+1 ).
Camera is at Origin looking at +Y-Axis.
I want to use BLENDING to make the bottom layer semi-transparent so that both the layers can be seen.
You'll probably want to use
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);b efore you render your clouds (don't forget to disable blending before you render normal geometry again).
Also, with this type of blending, you'll have to ensure that you render back to front, and it's generally a good idea to enable the depth test but disable depth writes when you render transparent textures.
You'll have to make up your own mind on whether or not you want to use an alphachannel for blending.
If the whole bottom texture is cloudy but with lighter and darker areas, you'll probably get a good effect with just a fixed alpha for the whole quad. If you're going for loose clouds, use an alpha channel in the texture.
07-15-2005, 01:30 AM
Thanks T101 !
Could you please give me some pointers on 2nd order interpolation ? ( i.e using velocity and acceleration. )
input data :
time(s) ; X(m) ; Y(m) ; Z(m)
0.1 0 1.2 0
0.2 0 2.0 0
0.3 0 3.0 0
0.4 0 4.5 0
0.5 1 7.0 0.5
... ... ... ...
col1=time (in seconds).
col2=X coord of object in metres.
col3=Y coord of object in metres.
col4=Z coord of object in metres.
Powered by vBulletin® Version 4.2.3 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.