## Need help with depth of field

Please use this forum for general user support and related questions.

Moderator: coordinators

Forum rules
Please include your operating system type/version, LuxRender version and Exporter version used when submitting a support post.

Make sure you have read the Release forum thread for Release and RC (Release Candidates) builds as these threads contain information on known problems and workarounds: Test Builds Forum

### Need help with depth of field

Greetings,

I am working on a scene where I wish to enable depth of field. I have built the scene using DAZ Studio, and exported it to LuxRender using Reality 2.11. However, the depth-of-field effect is non-existent, and I would like to verify the parameters Reality has generated for the camera.

In DAZ, the camera is a 45mm lens stopped to f/8, with a focal distance of 336.06cm and set for 16x9 render aspect ratio. Reality translated this into:
Code: Select all
Camera "perspective" "float fov" [42.501]  "float screenwindow" [-1.777778 1.777778 -1 1] "float lensradius" [0.002813] "float focaldistance" [3.330505]

In DAZ, the scene renders with expected depth of field based on my experience as a photographer. However, in the Lux render, I can see pretty much to the horizon with only the most distance items starting to show any signs of blur.

Looking at the scene file wiki, it states that lensradius = (focallength_in_mm / 1000.0) / ( 2.0 * fstop ). Based on this formula, it looks like Reality is generated the correct lensradius. (45/1000)/(2*8) == .045 / 16 == .0028125. However, if I hand edit the .lxs file and increase the lensradius value by a factor of 10, to .028125, I get a DoF effect more in line with what I expect. (At least, with only a handful of S/p rendered so far, it appears to be more correct.)

Can anyone explain what LuxRender is really expecting here?

Thanks
cwichura

Posts: 353
Joined: Sun Feb 12, 2012 11:31 pm

### Re: Need help with depth of field

Is your scene modelled to the right scale?
Linux builds packager

SATtva

Posts: 5498
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

### Re: Need help with depth of field

I believe DAZ does everything in cm, while Lux is meters, right? I have to assume that Reality is doing the proper conversion of scale when exporting to LuxRender. After all, if you look at the focaldistance it generated, that is basically a factor of 100 scaled in for the conversion between DAZ and Lux.

I don't have a way to read the mesh files it generates to see what the coordinate scale in them is. But the LookAt entry for the camera also shows a 100:1 scaling from cm to m for the camera coordinates. This leads me to believe that Reality is, indeed, doing the proper scaling.
cwichura

Posts: 353
Joined: Sun Feb 12, 2012 11:31 pm