Thread: New cloud effect for engine

  1. #1
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607

    New cloud effect for engine

    I loaded up one of my earlier 3D terrain engines and altered the cloud effect a bit.

    Now that I understand more of what is going in during alpha blending and how to create cool DDS textures that make use of it....I can achieve more effects than before.

    The sun glare is still not done because it's not quite right yet. It will require some new techniques to get it to look like a flare instead of a billboard behind the clouds.

  2. #2
    Registered User
    Join Date
    Mar 2003
    Posts
    580
    That looks very nice, keep up the good work.

    When doing the alpha blending, are you actually skipping 'alpha pixels', i.e so that like if you wanted to render a fence you would be able to see through the fence where the alpha pixels, but everything else is opaque. I guess that's what you must be doing. I don't know how to do that in OpenGL.
    See you in 13

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Yes i just took the clouds texture and grey-scaled it. Then I painted in areas of nearly black and smoothed the thing about a trillion times. Then I fired up DX Tex Tool and used the color pic, changed the surface format to A8R8G8B8 and opened the grey-scale texture onto the alpha channel of the final texture. Saved it as a DDS and loaded it in game with D3DXCreateTextureFromFile().

    The sun is rendered first and it's y coord is higher than the clouds. Then the clouds are rendered and alpha-blended with what's already in the buffer (namely the sun). I've also chosen a sky color to represent the sky since the sky is no longer a part of the actual texture. The sky is really just the color I clear the render target with but since the clouds are alpha-blended...it looks as though the clouds are moving through the sky.

    I will probably add a skybox to produce a gradient sky but right now I'm having problems with mirroring textures on my card. For some odd reason it puts seams at the borders and it shouldn't.
    Last edited by VirtualAce; 01-27-2005 at 12:46 PM.

  4. #4
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    that looks very cool bubbs, I havent done any graphics programming in a while but seeing this kind of thing makes me want to get back to it.

    Is this integrated into the voxel terrain you were working on before? I bet that sky would look nice all together with it.

  5. #5
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218
    That is just awesome!!!

  6. #6
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    No this is in the 3D terrain engine. Currently the terrain is not rendered - hence the 250 FPS im getting. I'm re-working the terrain drawing code.

  7. #7
    Banned
    Join Date
    Oct 2004
    Posts
    250
    Bubba how long did it take you to get this good, how long have you been programming for, what books did you buy, are you going to release the code for your game it looks amazing and would be helpfull to people learning D3D.

  8. #8
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    looks rlly good bro, nice job!

  9. #9
    the lowly newb
    Join Date
    Jan 2005
    Location
    IL
    Posts
    49
    looks awesome! i aspire to your greatness

  10. #10
    Pokemon Master digdug4life's Avatar
    Join Date
    Jan 2005
    Location
    Mystic Island, NJ
    Posts
    91
    u guys r awsome i wish i knew how to do that

  11. #11
    Pokemon Master digdug4life's Avatar
    Join Date
    Jan 2005
    Location
    Mystic Island, NJ
    Posts
    91
    this is a great site but the tutorial dont help me much

  12. #12
    Registered User caroundw5h's Avatar
    Join Date
    Oct 2003
    Posts
    751
    Bubba is sick with the game programming!! nice work dude!!
    Warning: Opinions subject to change without notice

    The C Library Reference Guide
    Understand the fundamentals
    Then have some more fun

  13. #13
    Trolley boy JackGL's Avatar
    Join Date
    Jan 2005
    Location
    UK
    Posts
    15
    Quote Originally Posted by Darkness
    When doing the alpha blending, are you actually skipping 'alpha pixels', i.e so that like if you wanted to render a fence you would be able to see through the fence where the alpha pixels, but everything else is opaque. I guess that's what you must be doing. I don't know how to do that in OpenGL.
    It's a blend mode, so you could do

    glBlendMode(GL_ONE, GL_ONE)

    I can't really remember how it's done to be honest, it's been a few months since I wrote any GL stuff.

  14. #14
    Registered User
    Join Date
    Mar 2003
    Posts
    580
    You cannot achieve those effects doing what you just said, but bubba explained it to me anyway.

    It also doesn't help that there's no such thing as glblendmode

    you probably meant glblendfunc
    See you in 13

  15. #15
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Here are the textures: I combined these to produce a DDS file in DirectX Texture Tool. You could also just as well use a PNG or any other format that supported alpha channels.

    I'm including the alpha channel grey scale here as well as the color bitmap.
    Hopefully you can see from this what is taking place.

    Remember:

    Black - completely transparent
    Grey - 50 transparent/50 opaque
    White - completely opaque

    Here is the color bitmap.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Type Writer Effect help please.
    By Fujitaka in forum C Programming
    Replies: 6
    Last Post: 02-01-2009, 10:11 AM
  2. cin.get() twice for effect
    By 74466 in forum C++ Programming
    Replies: 16
    Last Post: 03-02-2006, 11:27 AM
  3. operator has no effect ??
    By studentc in forum C Programming
    Replies: 3
    Last Post: 05-28-2004, 07:28 AM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Side effect of various operations
    By xds4lx in forum C++ Programming
    Replies: 3
    Last Post: 03-11-2002, 10:12 AM