Jump to content
  • Advertisement
Sign in to follow this  
JBond

Rain in WoW

This topic is 3795 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

The particle rain system in WoW looks amazing, I want to implement something similar however I could not figure out how they did their water splatter; After some careful examination it seems to me that they had collision detection of every rain particle with the arbitary shaped terrain geometry. It seems to me that this collision detection is computationally prohibitive.. Could anybody give me some insight into how they did their water splatter with their rain? Any suggestion on how I can implement this is welcome thanks guys :)

Share this post


Link to post
Share on other sites
Advertisement
I havent examined the rain in WoW to any mentionable degree beyond just seeing it but I bet you could create the illusion of rain very easily:

1. Have a few transparent billboards in front of the user to render the falling rain. Basically, these billboards would just show a falling rain animation

2. Superimpose a splattering animation on the surfaces which rain can hit.

It wont be necessarily true that you could follow a droplet to its splatter, but who cares? It's probably good enough and it's not computationally expensive.

Share this post


Link to post
Share on other sites
I don't know how they do it (I don't personally play WoW), but if it was me, I'd probably just cheat and have two seperate particle effects:

-falling rain
-rain splatters

The two wouldn't be necessarily related really, but you could trick the user since there would be so many rain drops that identifying whether or not the splatter is correct would be difficult/impossible.

If you really want to do accurate stuff then I guess using a heightmap's value is easier than doing actual collision detection.

Share this post


Link to post
Share on other sites

Hi,

about the collision detection, there are ways to come around it. I didn't check if the water splatting actually occured on building or so, but anyway here's a simplified idea:

Instead of doing vector-terrain collision test, why not just get a random 2d-point at random radius from the view point and then fetch the terrain height at that point. So this works basically backwards. You'll start up by knowing the point of intersection.

From the end point you'll just trace up the rain particle path at a constant speed (the rain drop should have it's maximum speed so close to the ground) for few seconds. Each particle has a time to live counter which you'll decrease every frame update, and when it reaches zero, you'll just draw the splat at the calculated end point.

Handling buildings and other terrain objects will make the system more complicated, but it is doable.

Best regards!

Share this post


Link to post
Share on other sites
Hi,
Just to clarify some things for people wanted to help the Op :)

- The rain in WoW is handled drop by drop. I mean each particle is only 1 droplet. The advantage is that when you travel fast, the rain doesn't continue to fall vertically, like it would do with a billboard with animated texture.

- And for the impacts on the ground, I'm 99% sure it does collision detection, since buildings and stuff like that are handled (the rain collide with the roof, or any "collidable" surface and stops there)


Now, they also display the strict minimum amount of particles. If you look carefully, you won't see that many particles. Then the emitter always follow the user (stand still in the game, and jump and you'll see what I mean :)

And since the trajectory of the particles are a simple ray, I assume each time a particle is created, a simple ray against mesh / terrain is done to get the point where the droplet touch the ground. Knowing the time of impact and the location, it's not hard to create a little effect (maybe another particle system)
The point is : ray intersection is really cheap, and you only need to do it once for each new particle created.

Share this post


Link to post
Share on other sites
Personally I don't think they're doing collision detection for the rain.

Even if the buildings have splatters it's not difficult to do without collision detection. For most fx I've seen that deal directly with surfaces a surface flag is created say something like #define FX_RAIN 0x02 or something like that.

When a building is created, a modeler can apply a shader to the building with FX_RAIN defined on for the surface so when the game detects its time for rain to start, the splatter animation begins on all surfaces flagged for FX_RAIN. This lets the content creators define which objects are affected by rain easily.

The falling rain animation is probably just overlaid across the users view so the rain effect is controlled on the client-side rather than server. The server most likely just tosses a message to clients saying "hey it's raining" and the client goes "oh ok Ill draw rain"

Share this post


Link to post
Share on other sites
I personally see no reason why each raindrop couldn't be using collision detection.. it's not exactly as ray-testing once for each raindrop is a lot of stress on the cpu, not since there's probably only 300-400 drops going on at any given time.

If you combine various sizes and speeds the illusion of dense rain can quite easily be achieved.

/Robert

Share this post


Link to post
Share on other sites
Quote:
Original post by Rasmadrak
I personally see no reason why each raindrop couldn't be using collision detection.. it's not exactly as ray-testing once for each raindrop is a lot of stress on the cpu, not since there's probably only 300-400 drops going on at any given time.

If you combine various sizes and speeds the illusion of dense rain can quite easily be achieved.

/Robert


I'd say even 300 at a time is pushing it. Collision detection is completely feasible.

Share this post


Link to post
Share on other sites
Back when a Pentum3 600mhz was a good CPU I added a rain particle system to Half-Life 1, which used the HL1 engine's collision detection system to simulate between 500 and 3000 "rain-drops" with full collisions. The CPU handled that fine.

It all depends on how fast your ray-tests are...

Share this post


Link to post
Share on other sites
I don't think it's so much as "it's too intense on the processor to do collision detection for rain drops" as it is "it's a waste of cycles doing collision detection for rain drops".

Those are just my thoughts though :) The only for-sure way of figuring the rain system out is actually talking with one of Blizzard's programmers.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!