Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


OpenGL Generating a rain effect in OpenGL?

This topic is 5492 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

Has anyone had any experience or ideas on this? I need a rain effect over isometric RTS type game board. Maybe use GL_LINES and stream down the screen, causing a few to have collisons with on screen object? JP

Share this post

Link to post
Share on other sites
Well I have never programmed an RTS type game, but i suppose you could go to ortho mode and use drops or something made in a paint program, you could use masking to make the drop only visible and write and algo that just chooses random spots at top of screen and drops the drop down, you could add variables for wind etc to make it look a little more real falling.

Like said I have never tried it, that would be what I tried first though.

Share this post

Link to post
Share on other sites
See rain.cpp and rain.h
Initialize rain
InicializarLLuvia(rain,numgotas); //rain structure and number of drops
Draw the rain

I think is a inefficient method, perhaps it is possible to be used putting the rain box with few drops over the camara

some translations :
numgotas=number of drops

The drops are lines where
xd,yd,zd:are the bottom vertex of the line
xt,yt,zt:are the top vertex of the line
visib=color alpha of the drop
xv,yv,zv: velocity of the drop

the rain:
x,y,z //dimensions of the rain box
grosor: thickness of the drops
longitud: length of the drops
xg,yg,zg: forces in the three axis (gravity,wind)
GOTA *gotas array of drops

Tell me if you need something, bye

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!