Results 1 to 3 of 3

Thread: Blending for Clouds....

  1. #1
    Member Newbie
    Join Date
    Jul 2004
    Location
    Bangalore
    Posts
    37

    Blending for Clouds....

    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.

    Thanks.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jan 2004
    Posts
    314

    Re: Blending for Clouds....

    http://www.rush3d.com/reference/open...chapter07.html

    You'll probably want to use
    Code :
     glEnable(GL_BLEND);
     glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
    before 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.

  3. #3
    Member Newbie
    Join Date
    Jul 2004
    Location
    Bangalore
    Posts
    37

    Re: Blending for Clouds....

    Thanks T101 !

    Problem-2:

    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.

    thanks.

Similar Threads

  1. Blending question: clouds & pbuffers
    By Lyve in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 08-10-2004, 05:57 AM
  2. volumetric clouds
    By JanHH in forum OpenGL: Advanced Coding
    Replies: 29
    Last Post: 07-25-2003, 09:28 AM
  3. Rotating clouds
    By mkardesci in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 05-30-2003, 06:21 PM
  4. Blending clouds and sun
    By dcd in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 05-30-2002, 10:49 AM
  5. Dynamic clouds?
    By in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 05-13-2001, 04:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean