After two posts full of boring text and graphs I feel like I have to give away a crowd pleaser. Again, not a realtime simulation. About 120.000 particles, running at almost one FPS.
When I implemented bokeh depth of field I stumbled upon a neat blending trick almost by accident. In my opinion, the quality of depth of field is more related to how objects of different depths blend together, rather than the blur itself. Sure, bokeh is nicer than gaussian, but if the blending is off the whole thing falls flat. There seems to be many different approaches to this out there, most of them requiring multiple passes and sometimes separation of what's behind and in front of the focal plane. I experimented a bit and stumbled upon a nice trick, almost by accident. I'm not going to get into technical details about lenses, circle of confusion, etc. It has been described very well many times before, so I'm just going to assume you know the basics. I can try to summarize what we want to do in one sentence – render each pixel as a discs where the radius is determined by how out of focus it is, also taking depth into consideration "somehow". Taking depth i
Reminds me of my 2 year old when she's got a glass of milk in one hand and is in the mood for some fun!
ReplyDeleteIs the simulation on its own at 1 FPS, or does that include the rendering?
Oops, better not show it to her to inspire any ideas.. The simulation time varies of course, but ranges from 600 ms up to maybe 1200. Rendering is about 300 ms, almost entirely consumed by marching cubes..
ReplyDelete