Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 3 123 LastLast
Results 1 to 10 of 26

Thread: Midtown madness snow effect

  1. #1
    Intern Newbie
    Join Date
    Apr 2002
    Location
    France
    Posts
    48

    Midtown madness snow effect

    Hi, I want to do the same effect as the snow effect in midtown madness 1
    so I have a texture for example roof and I want to simulate the snow fall so in midtown madness we can see some white points who apperas on the first texture .... but the fps don't fall down so it is not multipass rendering and I am not sure that it is multi texturing ... how they do what maybe with the accumulation buffer ... thanks and escuse me for my very very poor english

    [This message has been edited by IronRaph (edited 07-03-2002).]
    Software engineer:
    Intertial Measurement Unit, IMU, AHRS, INS :
    www.sbg-systems.com

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    The Round Table at Camelot
    Posts
    1,537

    Re: Midtown madness snow effect

    Now it's been quite a while since I have played Midtown Madness but what I think they use is some type of simple particle system using billboards for the snow flakes. I think doing something like this would work out well. I have seen a particle system a long time ago somewhere that had a snow effect and it looked very much like what I think you want. Too bad I dont know exactly where I downloaded that particle system code. But with a little googling, i'm sure something similar would show up.

    -SirKnight
    -SirKnight

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Oct 2000
    Location
    Belgium
    Posts
    857

    Re: Midtown madness snow effect

    SirKnight, as I understand it he's not asking about the snow flakes themselves -- the snow apparantly accumulates on roofs and stuff.

    You could do this by giving each surface a unique "snow map". This is a texture that starts out blank. Every time a snowflake (from SirKnight's particle system ) hits the surface, you calculate the point of contact, transform it into the snow map's texture space, and draw a white dot to the snow map at that location. You should probably make the snow map an intensity texture, so you can draw it onto the roof using standard alpha blending (or the equivalent multitexturing operation).

    You can score extra points by generating a bumpmap for the snow, to complement the simple grayscale texture.

    -- Tom

  4. #4
    Senior Member OpenGL Guru knackered's Avatar
    Join Date
    Aug 2001
    Location
    UK
    Posts
    3,032

    Re: Midtown madness snow effect

    That's a lot of render-to-texture/copysubimage stuff! Not to mention a lot of collision detection!
    He says the frame rate doesn't drop through the floor - and midtown madness is quite an old game, designed to work on, frankly, ancient hardware. I've never seen it though - I've got midtown madness 2, but not the original - no snow in the sequel, unforunately.
    Maybe they have a series of pre-baked snow textures, and gradually alpha fade each texture in, through all levels of 'snowiness'.

    BTW, Midtown Madness 2 is still one of my favourite games, although I was disappointed they missed out a few familiar streets of London I'd have liked to have driven down!
    LAN multiplayer is a scream! Favourite race: Bridge Bash - I always thought Tower Bridge would make an excellent bit of race game.

    [This message has been edited by knackered (edited 07-04-2002).]
    Knackered

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Oct 2000
    Location
    Belgium
    Posts
    857

    Re: Midtown madness snow effect

    Originally posted by knackered:
    That's a lot of render-to-texture/copysubimage stuff! Not to mention a lot of collision detection!
    Yeah well, the hardware's improved quite a bit since Midtown Madness, so why not?

    Actually, if the collision detection scares you, you could just have one particle system for the snowflakes in your 3D world, and another 2D particle system to deposit snow on the texture. They'd be completely unrelated, but I don't think anyone would notice. The render-to-texture operations should be cheap, as you only ever need to glCopyTexSubImage2D() very small regions of the texture.

    -- Tom

    [This message has been edited by Tom Nuydens (edited 07-04-2002).]

  6. #6
    Senior Member OpenGL Guru knackered's Avatar
    Join Date
    Aug 2001
    Location
    UK
    Posts
    3,032

    Re: Midtown madness snow effect

    Originally posted by Tom Nuydens:
    [B]The render-to-texture operations should be cheap, as you only ever need to glCopyTexSubImage2D() very small regions of the texture.[B]
    Don't they cause a stall?
    Knackered

  7. #7
    Senior Member OpenGL Pro
    Join Date
    Feb 2001
    Location
    Switzerland
    Posts
    1,840

    Re: Midtown madness snow effect

    no stalling. but a glTexSubImage can be usefull as well, no need for rendertotexture and all that.. could be faster because no need to switch around that much.

    for the collisiondetection: generate a heightmap of your scene, with always the highest points in. if snowflake.y < heightmap(snowflake.x,snowflake.y).y collision.

    and if you want it that way:

    if(snowflake.y<heightmap(snowflake.x,snowflake.y). y) {
    heightmap(snowflake.x,snowflake.y).rgba = white;
    }
    glTexSubImage2D(blahblah,heightmap.data());

    and use the heightmap as snowmap directly..

    just as an idea
    http://davepermen.net - if i could stay true to my heart, i would feel totally free

  8. #8
    Senior Member OpenGL Guru knackered's Avatar
    Join Date
    Aug 2001
    Location
    UK
    Posts
    3,032

    Re: Midtown madness snow effect

    I know the game was written by Microsoft, but I think even they would choke at such care-free usage of memory! (especially in the days when you were lucky to assume someone had 16mb of system memory).
    I can imagine whatever the solution they came up, it will be damn simple - nobody would waste much time or resources doing snow.

    BTW, while we're on the subject of games...have you seen the rain drops on the windscreen in Colin McRae Rally 3 yet? It's only a beta version mpeg, but they really add something to the look of the game! I may drive from the drivers viewpoint for once!

    [This message has been edited by knackered (edited 07-04-2002).]
    Knackered

  9. #9
    Junior Member Regular Contributor
    Join Date
    Aug 2001
    Location
    England
    Posts
    174

    Re: Midtown madness snow effect

    I can't imagine how storing a unique map for each surface would be possible - wouldn't you completely wipe out all your texture memory?

    I'd like to know how Half-Life stored it's decals, because they are still some of the best IMHO - it annoys me nowadays when a spot of blood or whatever looks tacked on, and it offends me even more when it disappears after about 30 seconds.
    I'd hazard a guess at some kind of surface caching, since that is what the early Quake engines used... but I can't get over the possibility of running out of memory.
    Whaddya reckon?

    -Mezz

  10. #10
    Senior Member OpenGL Pro
    Join Date
    May 2000
    Location
    Hannover, Germany
    Posts
    1,258

    Re: Midtown madness snow effect

    Mezz, Halflife obviously uses small polygons on top of the geometry, since they disappear after some time (max amount of bulletholes) and they sometimes need glPolyOffset to look correct.
    - Michael Steinberg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •