Jump to content

  • Log In with Google      Sign In   
  • Create Account


3D Rain Particle System


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 domok   Members   -  Reputation: 184

Like
0Likes
Like

Posted 14 February 2012 - 07:58 PM

Hi

I'm working on a 3d rain particle system. Till now I have used billboards (with ID3DXSprite) but this doesn't look nice if you look up to the sky because then the rain drops (they are more like lines) still look the same. The lines can't always show the camera but I don't know how to make it look real.
Another problem with billboards is that you can't make diagonal rain (or I haven't found out how...).
The rain can't just be a 2D overlay because it interacts with the terrain.

What is the best way to draw real looking and always correctly oriented rain drops?

Sponsor:

#2 Lee A. Stripp   Members   -  Reputation: 373

Like
0Likes
Like

Posted 14 February 2012 - 09:32 PM

Would depend on your engine, but I'd try Geometry Instancing to use real rain drop shapes.

http://http.develope..._chapter03.html

But billboards are still fine for slower machines, not sure what options DX9 gives you on controlling them, cant you rotate them? can you maybe shift the lower UVs to move the line to match the fall direction? can you lock a rotation so it wont look directly at the camera but still follow it position.

Anyway Good luck !

Cheers

Lee

 

Code is Life
C/C++, ObjC Programmer, 3D Artist, Media Production

 

Website : www.leestripp.com
Skype : lee.stripp@bigpond.com
Gmail : leestripp@gmail.com


#3 domok   Members   -  Reputation: 184

Like
0Likes
Like

Posted 15 February 2012 - 02:40 AM

The problem with rotating the billboards is that the rotation depends on the position of the camera.

If the drops fall down with a vector (1, -1, 0) and your view direction is parallel to the yz-plane then the lines should be diagonal but if your view is parallel to the xy-plane the lines should be straight down.

I'd like to have them fall straight down correctly first. I disabled billboarding and the result was much better, but now if you watch from a certain angle, you can see almost no drops, because the quads are parallel to the view direction.

What I need to have is billboarding that only affects the y-axis. Is that what you meant with:

can you lock a rotation so it wont look directly at the camera but still follow it position.


Anyway I don't know if I can, I probably do but I don't know how...?

#4 domok   Members   -  Reputation: 184

Like
0Likes
Like

Posted 15 February 2012 - 03:13 AM

Ok it was easier than I thought.

You just calculate the angle between the view direction (with y = 0) and the vector (0, 0, 1), then create a rotation matrix around y-axis with this angle.

I think I'll find out the rest with diagonal rain

Thanks!

#5 Adam_42   Crossbones+   -  Reputation: 2426

Like
0Likes
Like

Posted 15 February 2012 - 03:16 AM

Here's how to build a matrix that keeps it vertical and facing the camera (taken from http://www.gamedev.net/topic/546352-billboard-rotating-along-one-axis/ ):

One axis is fixed, 'up' is always (0,1,0)
'Forward' will obviously be (cameraPosition - raindropPosition) normalized.
'Right' is the cross product of 'up' and 'forward'
'forward' needs to be made orthogonal by another cross product of 'right' and 'up'

The columns of the transformation matrix are 'right'|'up'|'forward'|'position'

#6 domok   Members   -  Reputation: 184

Like
0Likes
Like

Posted 15 February 2012 - 03:23 AM

Wow nice this works great! Thanks

#7 Lee A. Stripp   Members   -  Reputation: 373

Like
0Likes
Like

Posted 16 February 2012 - 09:29 AM

yeah, Adam_42 is right on the money..

Cheers

Lee

 

Code is Life
C/C++, ObjC Programmer, 3D Artist, Media Production

 

Website : www.leestripp.com
Skype : lee.stripp@bigpond.com
Gmail : leestripp@gmail.com





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS