mubaidr / rainyday.js

Simulating raindrops falling on a window
https://mubaidr.github.io/rainyday.js/
GNU General Public License v2.0
111 stars 43 forks source link

Can I use rainyday without image source? #14

Open itispey opened 2 years ago

itispey commented 2 years ago

I know it sounds weird but I wanna use rainyday without setting image. I want to use rainyday for a video for example and I want to rainyday use dynamic background like a video. How can I do that?

Ryphna commented 2 years ago

I was planning to do the same and the way I made it work is by creating an almost completely transparent image.

I made a white image in illustrator and set the transparency to 10-20% and saved it as a PNG. By using that as the base and then importing the webpage as a browser source in OBS, I was able to record my video with the raindrop happening "on top" of it. Hope this help.

mubaidr commented 1 year ago

I know it sounds weird but I wanna use rainyday without setting image. I want to use rainyday for a video for example and I want to rainyday use dynamic background like a video. How can I do that?

This library calculates image reflection for droplets. And using it with video will make it very CPU intensive.

https://github.com/mubaidr/rainyday.js/blob/master/src/rainyday.js#L259

But should be doable with some hacks. Get current video frame, and pass it to this function instead of static image.