Workbench engine used active camera to setup DOF effect even when
camera was overridden.
Pass correct camera explicitly to workbench_dof_engine_init()
Differential D9952
Fix T84160: Wrong DOF when camera is overriden Authored by Richard Antalik (ISS) on Dec 29 2020, 7:49 PM.
Details Workbench engine used active camera to setup DOF effect even when Pass correct camera explicitly to workbench_dof_engine_init()
Diff Detail
Event TimelineComment Actions Looking at the bug report and the playing around with the file:
If this is the case I would say the error is somewhere in the source/blender/render. One thing I see is that the camera_override is only set when there is a v3d what isn't the case for final image rendering. During final image rendering only the re->camera_override is set. Comment Actions I guess I will add to commit message that I had to override scene in DRW_render_to_image(), because engine has own dependency graph created by engine_depsgraph_init() Therefore it uses different evaluated scene than render pipeline. Comment Actions Rendering should not modify evaluated scene data, that's read-only outside of depsgraph evaluation. There should be no assumption that the evaluated scene will only be used for this one render. Comment Actions Thanks for checking this. Are you suggesting that each engine should handle camera override properties internally? Or is there any simpler universal solution? I have checked case for eevee, that seems like a simple change, I will check other engines as well and update patch. I have expected much more complicated setup. Comment Actions Currently each engine should handle the camera override internally. A more universal solution is possible at the render pipeline / depsgraph level, but it's more complex and I would not bother with this right now. Comment Actions Eevee and cycles works correctly, so no change was necessary. I guess I could have mentioned this in commit message. Comment Actions I have noticed just now that this change produces complier warning, because workbench_dof_engine_init() parameter list is different to what is defined in DrawEngineType So I will probably need to store camera override in WORKBENCH_Data that is passed to workbench_dof_engine_init() Comment Actions
|