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).]

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, 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

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).]

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).]

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?

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

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).]

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

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.

Ah yes, Mike, I’d forgotton they had a polygon offset parameter in there!

However, I still found it a feat because the default maximum for wall markings was in the thousands - I think thats better than time delayed disappearing.
They also looked a lot more natural, compared with the fake “I’ve just attached this to the surface for a short while” look that most markings have in Serious Sam / Quake3.
Is it because they are modulated with the surface lighting? I can’t verify that right now because I don’t have Half-Life around.

-Mezz

Does this “snow-algo” apply to every surface in Midtown Madness? I would guess it’s only the top of the cars, perhaps even only the top of the racing cars (only one? - don’t remember from the demo I played years ago). Then it would be just a single texture. Sidewalks, roads and houses can have static snowy textures (they’re only swoshing by anyway, you wouldn’t notice if it’s dynamic or static).

I think using the CPU to update the dynamic snowmaps would be the best solution (and glTexSubImage2D).

I haven’t seen the effect, but i can imagine it’s simply an animated (repeating, and pretty low-res probably) texture.

Y.

Originally posted by marcus256:
Does this “snow-algo” apply to every surface in Midtown Madness?

It appears on all the roads and pavements, but not the cars (they’re all moving too fast to accumulate snow anyway). I’m guessing that they randomly place snowflakes (using the Direct3D equivalent of TexSubImage) on the road and pavement textures. As only a few textures are used for the entire city, this wouldn’t be very costly at all.

hehe thanks for your answer !!
so I must use the multitexturing and a ‘snow texture’ as a decale … yes
I will do it thanks

Mezz, I’m not sure, but I can imagine that they assume that the wall marks are distributed evenly on the geometry by the user. That way one only sees up to 100 bulletholes or something at a time. I’d implement the max per cluster however.

Mike,
Per-cluster? Do you mean like a section of the BSP level or something?

I can see what you’re getting at with the maximum visible at one time, it would be fairly easy to set up that maximum and wipe out all the other markings on the level, if my assumption was correct about the per-cluster setting (you could just cull them away like you do non-visible planes I guess?)

-Mezz

Mezz, it doesnt really matter how many marks you have in the complete level, but how many marks are visible at one time. I find it crappy if one shoots at a wall in one section of a level, and in a completely different section other marks disappear because of a level-wide maximum. Well, i guess it’s a matter of taste.

No! sorry, I didn’t mean wipe them out as in delete them - I meant not send them down the rendering pipeline because they weren’t visible, my apologies for not making that clearer.
I have big problems about how to efficiently selectively render marks on walls, based on viewing location - especially when you have a few thousand to choose from. That’s why I guessed about culling them out with other parts of the BSP.

-Mezz

  1. The snow accumulates only on the road.

2)The “collision” with the ground aren’t exact: the position where the white dots are created are random, and do not depend on where the snow particules did fall.

  1. The road texture seems to be updated from time to time. Maybe they start displaying a blended texture adding smoothly some new dots, and after they mix it with the road texture. As the texture is not updated that often (something like every couple of seconds, if I remember well), this does not create noticable stall in the fps.

(just some assumptions)