diff options
Diffstat (limited to 'source/blender/draw/engines')
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_depth_of_field.c | 6 | ||||
-rw-r--r-- | source/blender/draw/engines/eevee/eevee_motion_blur.c | 8 |
2 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.c b/source/blender/draw/engines/eevee/eevee_depth_of_field.c index 36f433d5ffb..124873add96 100644 --- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c +++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c @@ -45,6 +45,7 @@ #include "BKE_screen.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" #include "eevee_private.h" #include "GPU_extensions.h" @@ -96,7 +97,8 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v if (rv3d->persp == RV3D_CAMOB && v3d->camera) { const float *viewport_size = DRW_viewport_size_get(); - Camera *cam = (Camera *)v3d->camera->data; + Object *camera_object = DEG_get_evaluated_object(draw_ctx->depsgraph, v3d->camera); + Camera *cam = (Camera *)camera_object->data; /* Retreive Near and Far distance */ effects->dof_near_far[0] = -cam->clipsta; @@ -145,7 +147,7 @@ int EEVEE_depth_of_field_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *v float rotation = cam->gpu_dof.rotation; float ratio = 1.0f / cam->gpu_dof.ratio; float sensor = BKE_camera_sensor_size(cam->sensor_fit, cam->sensor_x, cam->sensor_y); - float focus_dist = BKE_camera_object_dof_distance(v3d->camera); + float focus_dist = BKE_camera_object_dof_distance(camera_object); float focal_len = cam->lens; UNUSED_VARS(rotation, ratio); diff --git a/source/blender/draw/engines/eevee/eevee_motion_blur.c b/source/blender/draw/engines/eevee/eevee_motion_blur.c index 10c8ab5744a..b05fbf8c7fb 100644 --- a/source/blender/draw/engines/eevee/eevee_motion_blur.c +++ b/source/blender/draw/engines/eevee/eevee_motion_blur.c @@ -40,6 +40,7 @@ #include "ED_screen.h" #include "DEG_depsgraph.h" +#include "DEG_depsgraph_query.h" #include "eevee_private.h" #include "GPU_texture.h" @@ -147,11 +148,12 @@ int EEVEE_motion_blur_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *veda float persmat[4][4]; float ctime = BKE_scene_frame_get(scene); float delta = BKE_collection_engine_property_value_get_float(props, "motion_blur_shutter"); + Object *camera_object = DEG_get_evaluated_object(draw_ctx->depsgraph, v3d->camera); /* Current matrix */ eevee_motion_blur_camera_get_matrix_at_time(scene, ar, rv3d, v3d, - v3d->camera, + camera_object, ctime, effects->current_ndc_to_world); @@ -165,7 +167,7 @@ int EEVEE_motion_blur_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *veda /* Past matrix */ eevee_motion_blur_camera_get_matrix_at_time(scene, ar, rv3d, v3d, - v3d->camera, + camera_object, ctime - delta, effects->past_world_to_ndc); @@ -173,7 +175,7 @@ int EEVEE_motion_blur_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data *veda /* Future matrix */ eevee_motion_blur_camera_get_matrix_at_time(scene, ar, rv3d, v3d, - v3d->camera, + camera_object, ctime + delta, effects->future_world_to_ndc); #endif |