Wax78's Depth of field software

Whatever you want to talk about, but keep it clean
Wax
Posts: 12
Joined: Tue Sep 22, 2009 5:36 pm

Wax78's Depth of field software

Post by Wax » Tue Sep 22, 2009 5:48 pm

Hello to everyone,

I've recently made a little software that i'd like to share with you because it make me gain some times when rendering with KT of another program. U'll probably tell me there's others one that work pretty well i know, but i'd like to learn the technics beside ... :)

That program enable you to input an image and his depth map to compute a simple but enough effective for my eyes Depth of Field effect.

- You can change the distance point, the amount of ray deviation, and number of samples.
- Make animation with distance that change on each frames. (BMP export).
- Use the "realtime" module (GPU) to check in realtime the params effects.

You can download it by looking at my website http://renaud.warnotte.be/ or directly by http://renaud.warnotte.be/Projects/DOFPro/. (browser for latest version).

Thanks you for your listen.
doepfer404_0001_Layer 2.jpg
doepfer404_0001_Layer 2.jpg (75.55 KiB) Viewed 13987 times
Notes :

You need java 1.6 and windows (should work on other os but don't have time to try/release stg).

You also need a graphics cards with OPENGL and shaders support because there's a preview mode that enable you to see in realtime the effect of each parameters. (not really accurate, but really more fast than cpu).
Last edited by Wax on Sun Feb 07, 2010 3:09 pm, edited 2 times in total.

Solo
Posts: 225
Joined: Tue Aug 25, 2009 4:32 pm

Re: Wax78's Depth of field software

Post by Solo » Tue Sep 22, 2009 6:05 pm

Works great, but the resulting image looks a little fuzzy.
Attachments
resultdepth.png
resultdepth.png (224.27 KiB) Viewed 14504 times

Wax
Posts: 12
Joined: Tue Sep 22, 2009 5:36 pm

Re: Wax78's Depth of field software

Post by Wax » Tue Sep 22, 2009 6:11 pm

Cool, nice to see someone interested :)

Did you changed the sample value ? How much do you put ? (You can double click on the "slider controler" to have an edit box where you can enter values manually).

Anyway, my current algorithm is a little tricky to. I used random values to do modulation instead of calculating the "real optical value" if i can see it like that has i'm not ultra specialist.

Note : Can you try with another image more complex or with a lot of cube, like the one in samples. To understand exactly, thanks.

Wax
Posts: 12
Joined: Tue Sep 22, 2009 5:36 pm

Re: Wax78's Depth of field software

Post by Wax » Sat Sep 26, 2009 12:13 pm

Hello everyone again,

I made this little video (badly compressed by youtube :|) to show the result of my software.

I've made a simple photo of my dog. Then I made a depth map by hand with photoshop (this depth map is not really accurate has done by hand ultra quickly).

Then I used my software to produce the animation, here's result

[youtube]http://www.youtube.com/watch?v=ls2FiAU9zA0[/youtube]
*edit by Fletch - for some reason, to use the youtube tags, you must delete most of the link until you get just the video number AFTER the "=" sign.like this:

Code: Select all

[youtube]ls2FiAU9zA0[/youtube]  

Fletch
Posts: 12906
Joined: Fri Mar 20, 2009 2:41 pm
OS: PC 64bit
SketchUp: 2016-2023
Contact:

Re: Wax78's Depth of field software

Post by Fletch » Sat Sep 26, 2009 10:57 pm

If you download the trial version of Twilight, and do a test yourself by rendering a simple scene, and it's depth mask, you can create a good tutorial for us all.

I want to remind folks that animating DOF in Twilight is easy and very possible already.
How to get DOF (Depth of Field) in your image [Video]

See the video
still shot
Image

Wax
Posts: 12
Joined: Tue Sep 22, 2009 5:36 pm

Re: Wax78's Depth of field software

Post by Wax » Sat Oct 03, 2009 10:57 am

Seems a nice idea Fletch. So i've made a little screenshots and explanation on how to render a scene in Twillight (i'm not expert at twillight) and use my software after. I hope that's what you were suggesting

Of course, using the DOF of twillight (or another "tracer") will give far better result but in more time i think. (Correct me if I'm wrong please :).

Anyway here's my instructions on how to use twillight with my soft :

1) First load Twillight render and create/load your scene,
Tutorial_0005_Layer 4.jpg
Tutorial_0005_Layer 4.jpg (97.24 KiB) Viewed 14285 times
.

Then choose the Render method to Depth Map [Specialized] and render the image.
Tutorial_0004_Layer 1.jpg
Tutorial_0004_Layer 1.jpg (127.6 KiB) Viewed 14283 times
Result should look like this, so save that image somewhere.
Tutorial_0003_Layer 5.jpg
Tutorial_0003_Layer 5.jpg (130.76 KiB) Viewed 14275 times
Last edited by Wax on Sat Oct 03, 2009 11:16 am, edited 1 time in total.

Wax
Posts: 12
Joined: Tue Sep 22, 2009 5:36 pm

Re: Wax78's Depth of field software

Post by Wax » Sat Oct 03, 2009 11:07 am

2) Then make the same to render the image in the way you want (Photon map, MLT, ...) and save it somewhere too.
Tutorial_0002_Layer 6.jpg
Tutorial_0002_Layer 6.jpg (145.57 KiB) Viewed 14268 times
You have now the colored image and his depth map.

3) Load my little DOF software, then load the 2 images (Menu->File->Load...) You'll obtain 3 images inside GUI (The original image, his map, and the result).
Tutorial_0001_Layer 8.jpg
Tutorial_0001_Layer 8.jpg (114.78 KiB) Viewed 14256 times
.

4) Then you'll have to change the 3 parameters.
Tutorial_0000_6.jpg
Tutorial_0000_6.jpg (118.39 KiB) Viewed 14247 times
Params description :

1. Distance : The reference distance (0 for very near to 256 very far). This will be used to determine where the focus will be on.
2. Deviance : The amount each pixel will be "deviating" his original position when far for the "Focus point".
3. Samples : Amount of pixel to use for each pixel (Smaller is faster but uglier). (Notes : with GLSL don't hesitate to multiply this by 4 or 8).[/list]

After that you can make 3 operations :

4. Compute the image to obtain the result image with CPU algorithm.
5. Show a little window where you can preview effect of parameter on the result. Using GPU to "simulate" fastly the CPU algorithm. (Not very beautyfull but usefull).
6. Make an animation : When pressed go and take a coffee somewhere ... This button will generate 256 or 512 Image with Distance raising from 0 to 256 or 512.

Note that the output will be BMP file in the outs folder.

remon_v
Posts: 41
Joined: Thu Sep 17, 2009 8:26 pm

Re: Wax78's Depth of field software

Post by remon_v » Sat Oct 03, 2009 2:23 pm

nice tutorial.... I'll try it sometime :D

Wax
Posts: 12
Joined: Tue Sep 22, 2009 5:36 pm

Re: Wax78's Depth of field software

Post by Wax » Wed Feb 03, 2010 2:14 pm

Here are some news for this project...

I've just finished debbugging the alpha stage of the new GPU version of the software. It's about 50 * faster than with the CPU.

There's no GUI for the moment or something usable for everyone but it'll come soon.

So here are 2 new video of my dof software result : (From far to near or the invert).

[youtube]http://www.youtube.com/watch?v=lPtteWUMlk4[/youtube]
[youtube]http://www.youtube.com/watch?v=QHVPxkkASrM[/youtube]

Enjoy

Equis
Posts: 25
Joined: Fri Dec 04, 2009 4:31 am

Re: Wax78's Depth of field software

Post by Equis » Wed Feb 03, 2010 9:23 pm

I was just looking for a GIMP plugin that did this. I thought for sure it'd be an easy enough task to affix the focus on any point in the gradient and figured someone else had already thought the same thing. I suppose the difference is that no many people work with a grayscale depthmap like we can in renderings.

Post Reply

Who is online

Users browsing this forum: No registered users and 34 guests