Making rain using Love2d

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
drunken_munki
Party member
Posts: 134
Joined: Tue Mar 29, 2011 11:05 pm

Re: Making rain using Love2d

Post by drunken_munki »

zorg wrote:You could cheat by using an image (a rain texture) with a mesh; each update, modifying the texture position, so it looks like it's falling; I'll create a demo thing in a jiffy :3
Edit: Attached. Press space to make it REAL intense, and escape exits (if you'd want to test it on android)

Edit2: Uploaded a new version, just to be sure, it checks both keycode and scancode for escape and space, maybe it will work for you now, Bobby :3
God that's so simple and effective, looks really nice too!

Does the rain texture need to be tilable? I've taken a closer look, doesn't seem to be.
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Making rain using Love2d

Post by zorg »

drunken_munki wrote: God that's so simple and effective, looks really nice too!

Does the rain texture need to be tilable? I've taken a closer look, doesn't seem to be.
Probably not that big of an issue if it's not tileable, but introducing some variation into the uv coordinate updating may give a more "natural" look, like how "wind" would occasionally blow the rain sideways, etc. (and using multiple layers of it certainly looks nice if i may say so myself! :3)
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
teschio
Prole
Posts: 3
Joined: Sun Mar 13, 2016 10:32 pm

Re: Making rain using Love2d

Post by teschio »

nuno wrote:something like this?

Hello Nuno,

Very nice effect!

Would be it possible to share the code or to provide some directions to reproduce it?

Thank you
User avatar
nuno
Party member
Posts: 137
Joined: Wed Dec 11, 2013 12:00 pm
Location: Portugal
Contact:

Re: Making rain using Love2d

Post by nuno »

teschio wrote: Hello Nuno,

Very nice effect!

Would be it possible to share the code or to provide some directions to reproduce it?

Thank you
here: http://www.bitoutsidethebox.com/simulat ... r-effects/
as for the code, I explain in the post why I didn't share it, but you can look at it if you want, just download the game and unzip the love file...its open by definition ;)
teschio
Prole
Posts: 3
Joined: Sun Mar 13, 2016 10:32 pm

Re: Making rain using Love2d

Post by teschio »

Great! Thanks so so so much, Nuno! I am looking into it now!
User avatar
nuno
Party member
Posts: 137
Joined: Wed Dec 11, 2013 12:00 pm
Location: Portugal
Contact:

Re: Making rain using Love2d

Post by nuno »

teschio wrote:Great! Thanks so so so much, Nuno! I am looking into it now!
welcome :) the code might be a bit messy, so if you need any help, just let me know and I'll gladly explain.

PS - not sure if you are the one that bought the game on itch.io today, if you are, thanks for the tip ;)
teschio
Prole
Posts: 3
Joined: Sun Mar 13, 2016 10:32 pm

Re: Making rain using Love2d

Post by teschio »

Yes, I was :), I read your post on why the game is free, and I just decided to make a donation considering the incredible amount of work you have done.

I am looking into the code and I am trying to extract just the part I am interested. Indeed, I just had a partial success (sky and clouds working, but no rain), and your offer of helping me is truly appreciated.

I will review the code this week and next week (I hope to have time) and, if you don't mind, I will contact you if I have questions :)

Thank you so much for your availability and prompt response, Nuno. Truly appreciate it!
User avatar
nuno
Party member
Posts: 137
Joined: Wed Dec 11, 2013 12:00 pm
Location: Portugal
Contact:

Re: Making rain using Love2d

Post by nuno »

teschio wrote:Yes, I was :), I read your post on why the game is free, and I just decided to make a donation considering the incredible amount of work you have done.

I am looking into the code and I am trying to extract just the part I am interested. Indeed, I just had a partial success (sky and clouds working, but no rain), and your offer of helping me is truly appreciated.

I will review the code this week and next week (I hope to have time) and, if you don't mind, I will contact you if I have questions :)

Thank you so much for your availability and prompt response, Nuno. Truly appreciate it!
no problem :) just shoot me an email nuno@bitoutsidethebox.com so we dont spam the forum here :)
uederson
Prole
Posts: 30
Joined: Mon May 23, 2016 7:59 pm
Location: Brazil
Contact:

Re: Making rain using Love2d

Post by uederson »

zorg wrote: Fri Feb 19, 2016 11:33 am You could cheat by using an image (a rain texture) with a mesh; each update, modifying the texture position, so it looks like it's falling; I'll create a demo thing in a jiffy :3
Edit: Attached. Press space to make it REAL intense, and escape exits (if you'd want to test it on android)

Edit2: Uploaded a new version, just to be sure, it checks both keycode and scancode for escape and space, maybe it will work for you now, Bobby :3
Thank you so much for share this with us!
I am using it on my game!
I will give you credit!
User avatar
zorg
Party member
Posts: 3468
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Making rain using Love2d

Post by zorg »

uederson wrote: Mon May 29, 2017 7:21 pm
zorg wrote: Fri Feb 19, 2016 11:33 am You could cheat by using an image (a rain texture) with a mesh; each update, modifying the texture position, so it looks like it's falling; I'll create a demo thing in a jiffy :3
Edit: Attached. Press space to make it REAL intense, and escape exits (if you'd want to test it on android)

Edit2: Uploaded a new version, just to be sure, it checks both keycode and scancode for escape and space, maybe it will work for you now, Bobby :3
Thank you so much for share this with us!
I am using it on my game!
I will give you credit!
Necroing aside, you're welcome!

Still, now that this happened, i have an excuse to say that the .love file in my previous attachment didn't deal with the fact that the screen seemingly became "lighter" when the rain was overlaid, since the droplets are white; this one actually corrects that. (press space to change weather, there's 3 separate modes)
Attachments
raintest2.love
(278.3 KiB) Downloaded 184 times
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot], Amazon [Bot], Bing [Bot], Google [Bot] and 9 guests