Page MenuHome

Depth of field doesn't correlate between Cycles and EEVEE (lookdev) with unit scale less than 1
Closed, ResolvedPublic

Description

System Information
Operating system: Linux-4.15.0-47-generic-x86_64-with-debian-buster-sid 64 Bits
Graphics card: GeForce GTX 1070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 390.116

Blender Version
Broken: version: 2.80 (sub 71), branch: master, commit date: 2019-05-20 22:03, hash: rBe78770039397

Short description of error
Depth of field doesn't correlate between Cycles and EEVEE (lookdev) with unit scale less than 1

Exact steps for others to reproduce the error
Open file


set shading mode to lookdev:

Cycles:

If you will set unit scale to 1, DOF looks equal.

Details

Differential Revisions
D4925: EEVEE: Depth Of Field Units
Type
Bug

Event Timeline

Jeroen Bakker (jbakker) lowered the priority of this task from Needs Triage by Developer to Confirmed, Medium.May 22 2019, 2:30 PM

Not sure which engine is correct.

Eevee assumes focal length and sensors are in mm and uses the unitscale to convert it into worldspace

eevee_depth_of_field.c#143-148

/* this is factor that converts to the scene scale. focal length and sensor are expressed in
 * mm unit.scale_length is how many meters per blender unit we have. We want to convert to
 * blender units though because the shader reads coordinates in world space, which is in
 * blender units.
 * Note however that focus_distance is already in blender units and shall not be scaled here
 * (see T48157). */

What seems to be correct. Not sure what cycles does. @Brecht Van Lommel (brecht) What do you think?
Setting this scale to 1.0 will give consistent results between cycles and eevee.

There is an old bug report that goes into this, not sure how much of it is still relevant: T48352: Blender GLSL viewport DoF doesn't respect world scale

We may be able to improve things here, but I think ignoring unit scale in this case and using 1.0 gets us closer to the right solution.

In general the unit system was designed to not affect renders at all, it is merely a feature for display and editing. The camera parameters ideally should be configurable independent of scene scale, and mostly this works by having lens and sensor be in a fixed mm independent of scene scale, and f-stop being unitless. However when objects get close to the camera the size of the lens in relation to the object starts to matter. Anyway, that's not an issue we have to solve now. Just matching Cycles is fine I think.

Jeroen Bakker (jbakker) closed this task as Resolved.May 22 2019, 4:19 PM