Maniphest T64988

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

Assigned To
Jeroen Bakker (jbakker)
Authored By
Michael Soluyanov (crantisz)
May 22 2019, 12:40 PM
Tags
  • BF Blender
Subscribers
Brecht Van Lommel (brecht)
Jeroen Bakker (jbakker)
Michael Soluyanov (crantisz)

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.

Revisions and Commits

rB Blender
Closed

Related Objects

Mentioned In
rB04fa0511ca5e: DrawEngines: Depth Of Field Units
Mentioned Here
T48352: Blender GLSL viewport DoF doesn't respect world scale

Event Timeline

Michael Soluyanov (crantisz) created this task.May 22 2019, 12:40 PM
Jeroen Bakker (jbakker) lowered the priority of this task from 90 to 50.May 22 2019, 2:30 PM
Jeroen Bakker (jbakker) added subscribers: Brecht Van Lommel (brecht), Jeroen Bakker (jbakker).EditedMay 22 2019, 2:43 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.

Brecht Van Lommel (brecht) added a comment.May 22 2019, 3:01 PM

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) added a revision: D4925: EEVEE: Depth Of Field Units.May 22 2019, 3:26 PM
Jeroen Bakker (jbakker) claimed this task.May 22 2019, 3:45 PM
Jeroen Bakker (jbakker) mentioned this in rB04fa0511ca5e: DrawEngines: Depth Of Field Units.May 22 2019, 4:17 PM
Jeroen Bakker (jbakker) changed the task status from Unknown Status to Resolved.May 22 2019, 4:19 PM