I have been working slowly these days probably due to the hot temperature in Tunisia,anyway i have just implemented DOF and i thought that i can share my progress,nothing out of the extraordinary, it’s just a simple scene but I’m willing to expand the ray tracer by adding an xml-parser probably, but nothing is for sure…
I think depth of field is not well explained in most of cg papers that’s why I’ll shortly describe the algorithm to calculate it:
- First ,we need to specify how farther our focal plane is from the camera origin (this is called the focal distance)
- Second ,we calculate our ray direction as we normally do
- Third,we calculate our point in focus for that given pixel (point=ray.origin+ray.direction*focal_distance)
- Fourth,we calculate a random point on the lens and displace the ray origin by the coordinates of this point
- Finally ,the new ray direction is ( point-ray.origin).normalize()
Sorry for the excessive use of the word “calculate”
Here’s my results:


Thanks to lyc ,I’m now interested in fractals ,I wrote a program to render the Mandelbrot set and the Julia set ,it’s quite an easy task ,what impress me though is that how such simple formulas (Zn+1=Zn*Zn+C where Zn+1,Zn and C are complex numbers) can generate very beautiful shapes.
The first image represents the Mandelbrot set, the second and the third ones are the Julia set with different values of C.



Yeah, Lyc’s fractal art is really beautiful.
Found an interactive Julia: http://markmclaren.com/blog/julia-baby/
Yeah,fractals are beautiful and it is worthy to learn their math.
Most of lyc 2d fractals are based on the fractal flame algorithm btw.
p.s: thanks for the link
wow, found this by chance (got a google alert on ray tracing), amazing so many people know about my stuff o.O
your progress is really excellent, great work!
Well ,I told you man that you are special but you didn’t believe me
.
Thanks for visiting my blog.
nothing special here, everyone is these days doing the same stuff as me… ray tracing, fractals, maths, go… these are pretty cliche by now unfortunately
What you’re saying is right but you forgot to mention something very important.
For example you can take 2 ray tracers ,and use them to render a scene,the first one took 20 hours and the second tooks only 45 min ,well they are both called ray tracers but the difference between them is HUGE.
I hope you understood what i’m trying to say.