Logo by bib - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Support us via Flattr FLATTR Link
 
*
Welcome, Guest. Please login or register. October 28, 2020, 07:18:45 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: 1 [2] 3   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Depth Of Field test  (Read 6226 times)
0 Members and 1 Guest are viewing this topic.
Tglad
Fractal Molossus
**
Posts: 703


WWW
« Reply #15 on: April 12, 2010, 04:43:47 AM »

The effect is awesome Buddhi!
Logged
aluminumstudios
Conqueror
*******
Posts: 135


« Reply #16 on: April 12, 2010, 05:01:10 AM »

Very nice.

In photography, as a lens focuses on a further and further object, typically the depth of field increases.  So a shallow depth of field can often imply a close-up or even a macro image of a small object.  You could use this technique very effectively to  create illusions of small scale or very close-up examination.
Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #17 on: April 12, 2010, 08:21:39 AM »

depth of field is one of my favorite effects for creating realism ( beside global illumination )
it leads the eye through a scene, especially in animations

@buddhi those images have really great impact on me and look amazing !
Logged

---

divide and conquer - iterate and rule - chaos is No random!
David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #18 on: April 12, 2010, 11:42:20 PM »

I was just wondering how to apply depth of field (style) effects without a z-buffer and realised that it should be possible by modifying the dynamic DE threshold adjustment code - will try it......
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Dinkydau
Fractal Senior
******
Posts: 1616



WWW
« Reply #19 on: April 13, 2010, 04:25:14 PM »

As I said on DeviantART, that's very cool!
Logged

David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #20 on: April 14, 2010, 01:34:00 AM »

An attempt to get results similar to z-buffer based depth of field without a z-buffer by modifying the distance estimator threshold distance based on the distance of the surface from a specified focal distance.
The effect is nice but needs more work to look like true depth of field and will always suffer from the issue of most colouring methods causing the colour to deviate from the "correct" value.
It prompts the idea that using more sophisticated positional variation of the distance threshold could be used to produce nice animation effects - which also prompts the idea that positional variation of other parameters such as the power may also produce interesting results wink

<a href="http://www.youtube.com/v/-uJosDRUcsI&rel=1&fs=1&hd=1" target="_blank">http://www.youtube.com/v/-uJosDRUcsI&rel=1&fs=1&hd=1</a>
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
Buddhi
Fractal Iambus
***
Posts: 895



WWW
« Reply #21 on: April 14, 2010, 06:12:16 PM »

An attempt to get results similar to z-buffer based depth of field without a z-buffer by modifying the distance estimator threshold distance based on the distance of the surface from a specified focal distance.
The effect is nice but needs more work to look like true depth of field and will always suffer from the issue of most colouring methods causing the colour to deviate from the "correct" value.
It prompts the idea that using more sophisticated positional variation of the distance threshold could be used to produce nice animation effects - which also prompts the idea that positional variation of other parameters such as the power may also produce interesting results wink

I think it will be difficult to get DOF effect using DE but of course it is possible. You have made first good step with adaptation of distance threshold according to focal distance. But now is bigger problem. Edge of detail which is out of focus should be transparent. It means that when program find edge which should be blur, must remember colour of this element and calculate proper transparency (according to distance to the fractal surface). Next program should still trace ray to find deeper edges (and also remember these) until find solid fractal surface. I hope my explanation is understandable - I still has some problems with my English  sad
Logged

David Makin
Global Moderator
Fractal Senior
******
Posts: 2286



Makin' Magic Fractals
WWW
« Reply #22 on: April 14, 2010, 07:19:32 PM »

An attempt to get results similar to z-buffer based depth of field without a z-buffer by modifying the distance estimator threshold distance based on the distance of the surface from a specified focal distance.
The effect is nice but needs more work to look like true depth of field and will always suffer from the issue of most colouring methods causing the colour to deviate from the "correct" value.
It prompts the idea that using more sophisticated positional variation of the distance threshold could be used to produce nice animation effects - which also prompts the idea that positional variation of other parameters such as the power may also produce interesting results wink

I think it will be difficult to get DOF effect using DE but of course it is possible. You have made first good step with adaptation of distance threshold according to focal distance. But now is bigger problem. Edge of detail which is out of focus should be transparent. It means that when program find edge which should be blur, must remember colour of this element and calculate proper transparency (according to distance to the fractal surface). Next program should still trace ray to find deeper edges (and also remember these) until find solid fractal surface. I hope my explanation is understandable - I still has some problems with my English  sad

Ideally you'd find "solid" at an extra distance (or distances) on each ray (distance/s based on the focal distance) and compute the colour/lighting for each as well as the original surface point and then merge the values together with weighting based on the distances between them.
Logged

The meaning and purpose of life is to give life purpose and meaning.

http://www.fractalgallery.co.uk/
"Makin' Magic Music" on Jango
cbuchner1
Fractal Phenom
******
Posts: 443


« Reply #23 on: April 18, 2010, 10:08:15 PM »

My algorithm is based on z-buffer but this is not typical blur. With normal blurring methods it is nearly impossible to render DOF effect on first image plane. On the edges of near objects it have to blur only nearest object without blurring background. I used something like "reverse blur".

I've looked at the source code of your Depth of Field post rendering and I have a few ideas / comments.

I think parallelization is possible by binning the resulting Z buffer values into a limited number of groups, each bin containing only the pixels that have a very similar blur radius.

Then for each group run a separable convolution kernel (e.g. a gaussian blur) on an image containing only the pixels belonging to that group (set all other pixels to black). Separable convolution is reasonably fast, also there is CUDA code available to do it quickly. Instead of a gaussian blur one could also use a disk shaped blur (but that is not separable and requires a more complicated 2D convolution).

The final image would be the simple arithmetic sum of the images for all groups (radius bins). EDIT: I just realized that it is not that easy. For each layer you definitely need an alpha mask as well, and one needs to add them up *in order* (with alpha weighting) from the far to the near plane. So memory requirement is definitely going up.

This could be done nearly in realtime in CUDA, I think. Also on the CPU could be doing this in parallel by computing these pixel groups in different threads. For the final summation the CPU could form tiles that are being processed in parallel.

UPDATE: I came across this article which suggests to use disk shaped convolution kernels instead of gaussian blurs for more realism. The reason being optics:

http://beautifulpixels.blogspot.com/2008/03/higher-fidelity-depth-of-field-effects.html

« Last Edit: April 19, 2010, 12:14:24 AM by cbuchner1 » Logged
Softology
Conqueror
*******
Posts: 120


« Reply #24 on: July 02, 2010, 04:25:53 AM »

My algorithm is based on z-buffer but this is not typical blur. With normal blurring methods it is nearly impossible to render DOF effect on first image plane. On the edges of near objects it have to blur only nearest object without blurring background. I used something like "reverse blur". In normal blur method we can use for example convolution matrix. Actual point is computed as a weighted sum of adjacent pixels.
In my method z-buffer is sorted form the farthest pixels to the nearest. Next starting form the farthest pixels, each actual pixel is spread to adjacent pixels with proper opacity, according to blur strength and distance form centre pixel. Final effect is nice and rendering is not so slow but now I don't have idea how to use multiple CPUs for rendering this effect. Pixels has to be rendered in proper order and in this case it is difficult to divide operations for many threads.

Nice effect.  I had a go with using the z-buffer for DOF (and Fog).  For the DOF I used a similar method, but without the alpha blended spreading.

1. Sort all pixels by z-buffer depth.
2. Go from farthest to nearest pixels.
3. The new pixel value is taken by averaging the pixel with pixels in front of it in the z-buffer depth.  The radius of the blur grows as it gets further away from the focal point.

This method seems to work fine (and fast) without needing to spread to adjacent pixels and use opacity.

A few samples (right-click View Image to see full resolution)...







Jason.
« Last Edit: July 02, 2010, 04:33:28 AM by Softology » Logged
Pauldelbrot
Fractal Senior
******
Posts: 2592



pderbyshire2
« Reply #25 on: July 02, 2010, 04:47:04 PM »

Whoa! What fractal is that last image?
Logged

kram1032
Fractal Senior
******
Posts: 1863


« Reply #26 on: July 02, 2010, 05:02:27 PM »

Those looks great, especially the last one cheesy

It's one of the 3D Kaleidoscopic IFS, right? smiley
Logged
Softology
Conqueror
*******
Posts: 120


« Reply #27 on: July 03, 2010, 05:49:11 AM »

Yes, the last one is a kaleidoscopic (octo sierpinski) ifs.

Jason.
Logged
Pauldelbrot
Fractal Senior
******
Posts: 2592



pderbyshire2
« Reply #28 on: July 04, 2010, 12:32:56 AM »

Someone ought to try making a "mandelbrot" version of it, so, with the transforms varying from point to point according to some rule.
Logged

Buddhi
Fractal Iambus
***
Posts: 895



WWW
« Reply #29 on: July 04, 2010, 08:42:44 AM »

Nice effect.  I had a go with using the z-buffer for DOF (and Fog).  For the DOF I used a similar method, but without the alpha blended spreading.

1. Sort all pixels by z-buffer depth.
2. Go from farthest to nearest pixels.
3. The new pixel value is taken by averaging the pixel with pixels in front of it in the z-buffer depth.  The radius of the blur grows as it gets further away from the focal point.

This method seems to work fine (and fast) without needing to spread to adjacent pixels and use opacity.

Jason.

Your DOF effect looks nice. But I'm wondering how it will looks when there will be also foreground out of focus. Like on my images in first post: http://www.fractalforums.com/images-showcase-%28rate-my-fractal%29/deep-of-field-test/msg15608/#msg15608
Logged

Pages: 1 [2] 3   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Rusty Ball Bearings (Depth of Field) Images Showcase (Rate My Fractal) ClydeFrog 0 720 Last post July 04, 2012, 07:49:05 AM
by ClydeFrog
Depth of Field in animation Mandelbulb 3d porco 4 2014 Last post January 17, 2013, 12:08:54 PM
by porco
Problems with field-depth and unwanted colour-cycling (with video) Mandelbulb 3d Chillheimer 2 1304 Last post February 01, 2014, 11:38:34 PM
by Chillheimer
urgent issue with depth of field Bug Reporting taurus 2 1159 Last post January 29, 2014, 02:13:14 PM
by taurus
Are there any tutorials out there for using Depth Of Field? Tutorials chaos_crystal 2 1790 Last post May 14, 2014, 04:01:37 AM
by Kausemus

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.192 seconds with 27 queries. (Pretty URLs adds 0.008s, 2q)