Rain effect based on what's already on screen

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
Tismas
Posts: 3
Joined: January 6th, 2017, 9:36 pm

Rain effect based on what's already on screen

Post by Tismas » January 6th, 2017, 9:45 pm

Hi guys

Is there a simple way of doing some rain effect/blur action on already drawn things? I came up with two solutions: modifing drawing methods of all entities and somehow managing to check drawn pixels and then redraw thing with modified values, but neither of them satisfies me :(
Is there a better way?

albinopapa
Posts: 4373
Joined: February 28th, 2013, 3:23 am
Location: Oklahoma, United States

Re: Rain effect based on what's already on screen

Post by albinopapa » January 6th, 2017, 10:00 pm

When you say rain effect, are you talking about water droplets on camera lens? If so, you could try creating a method in the Graphics class that after everything is done drawing, you call this method. The method would read from the system buffer, and modify the pixels on the back buffer. If you just want to blur each object as a mist is bouncing off each object, then you could render an object, then blur the resulting image before pasting to the back buffer.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com

Tismas
Posts: 3
Joined: January 6th, 2017, 9:36 pm

Re: Rain effect based on what's already on screen

Post by Tismas » January 6th, 2017, 10:16 pm

I actually meant water droplets on camera and bouncing off the ground :) So I think I'll try modifing pixels on the back buffer for both of them. Time for deep dive into Graphics class, Thanks! :)

User avatar
chili
Site Admin
Posts: 3948
Joined: December 31st, 2011, 4:53 pm
Location: Japan
Contact:

Re: Rain effect based on what's already on screen

Post by chili » January 7th, 2017, 8:37 am

Yeah, some simple solution to blurring involve re-using the contents of previous frames i think.

This is something I was playing with in 2012.
Attachments
Noisy Balls.zip
(79.21 KiB) Downloaded 152 times
Chili

Post Reply