I just tried setting up a scene with a DOF effect, but I couldn't get it to work properly. Attached is an example scene with a series of cubes progressively further away from the camera.
I only get a blurred image if I either set the F-stop as low as possible (0.01) or if I set the focus distance extremely close (something like 1).
For a distant focus, all objects are sharp (except at F-stop = 0.01).
With I simple setup like this it always feels like I am missing something trivial... Any help?
(Both v2.1 stable and daily build tested.)
Camera DOF
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Camera DOF
- Attachments
-
- fstop_error.blend
- (530.54 KiB) Downloaded 130 times
Re: Camera DOF
F-stop has nothing to do with DOF, it is a tone mapping parameter, focal distance and lens radius are the important parameters, did you changed the lens radius ?
Re: Camera DOF
I can't see a lens radius setting (in Blender). There is only F-stop in teh depth of Field section of the camera settings. it has the tool tip: "Aperture, lower values result in a stronger depth of field effect"
Re: Camera DOF
I found this line of code in the BlendLuxCore source:
so I'm not missing the radius in blender. The formula also seems correct, assuming that LuxCore calculates in meters and Blender in mm.
Could this be the error? It would explain why you need extremely small f-stop values for an effect, as they would be off by a factor of 1000
Code: Select all
definitions["lensradius"] = (camera.data.lens / 1000) / (2 * camera.data.luxcore.fstop)
Could this be the error? It would explain why you need extremely small f-stop values for an effect, as they would be off by a factor of 1000
Re: Camera DOF
Your camera is 500 m away from the nearest cube, and 1 km from the farthest.
You are using a 50 mm lens.
I think the DoF effect you get is correct, in the real world you wouldn't get much of a DoF effect either with this kind of setup.
Possible solutions:
- scale down the scene
- move the camera closer to the focal object (e.g. put it 5 meters away, not 500)
- use more tele (e.g. a 600 mm lens)
You are using a 50 mm lens.
I think the DoF effect you get is correct, in the real world you wouldn't get much of a DoF effect either with this kind of setup.
Possible solutions:
- scale down the scene
- move the camera closer to the focal object (e.g. put it 5 meters away, not 500)
- use more tele (e.g. a 600 mm lens)
Re: Camera DOF
Ok if Luxcore assumes the natural units of Blender to be metres that makes sense. But normally they are supposed to be mm, at least that is how all CAD import/export behaves.
Re: Camera DOF
1 Blender unit is by default 1 meter (but this is not LuxCore specific, it's the same for Cycles).
You can specify a unit scale, but usually I would not do this (you sign up as a bug finder for really rare and hidden bugs if you do it ).
You can specify a unit scale, but usually I would not do this (you sign up as a bug finder for really rare and hidden bugs if you do it ).
Re: Camera DOF
After a quick test suggest to me that it is more a Blender thing than related to LuxCore.
- If I create a cube in default-units after I start Blender and set its size to "20" and export as stl I get a 20mm cube.
- I switch units to mm. It shows me the cube is "2cm". I export stl, get 20mm cube
- I switch units to cm, It shows the cube is "20cm". I export as stl, but still get a 20mm cube. (Also happens when I create a new cube after switching units).
Not really the behaviour I expected, but at least I no know a bit better how to get LuxCore to do what I want
So thanks for the help!
Edit: Ok after a bit more testing and reading up on file formats this is not so surprising anymore, although the export discrepancy between cm and mm could be annoying in practice
I guess I was just used to a combination of factors that made everything work for me so far
- If I create a cube in default-units after I start Blender and set its size to "20" and export as stl I get a 20mm cube.
- I switch units to mm. It shows me the cube is "2cm". I export stl, get 20mm cube
- I switch units to cm, It shows the cube is "20cm". I export as stl, but still get a 20mm cube. (Also happens when I create a new cube after switching units).
Not really the behaviour I expected, but at least I no know a bit better how to get LuxCore to do what I want
So thanks for the help!
Edit: Ok after a bit more testing and reading up on file formats this is not so surprising anymore, although the export discrepancy between cm and mm could be annoying in practice
I guess I was just used to a combination of factors that made everything work for me so far