Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen Bakker <j.bakker@atmind.nl>2019-05-17 17:57:31 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-17 18:59:26 +0300
commitbc3139d79226896cf6c2b0813a1188eda70fad09 (patch)
treee5c7f1f878b4769def10e2ddbc75aacebda4afd5 /source/blender/blenkernel/intern/camera.c
parent043299ab69ca47a42fc8ca4f629727f8a6a2dd31 (diff)
Cycles/Eevee: unify depth of field settings for cameras
There is now a checkbox to enable/disable depth of field per camera. For Eevee this replace the scene level setting. For Cycles there is now only an F-Stop value, no longer a Radius. Existing files are converted based on Cycles or Eevee being set in the scene. Differential Revision: https://developer.blender.org/D4882
Diffstat (limited to 'source/blender/blenkernel/intern/camera.c')
-rw-r--r--source/blender/blenkernel/intern/camera.c23
1 files changed, 6 insertions, 17 deletions
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index 25399d342e1..a17cbb29550 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -66,8 +66,9 @@ void BKE_camera_init(Camera *cam)
cam->flag |= CAM_SHOWPASSEPARTOUT;
cam->passepartalpha = 0.5f;
- cam->gpu_dof.fstop = 128.0f;
- cam->gpu_dof.ratio = 1.0f;
+ cam->dof.aperture_fstop = 5.6f;
+ cam->dof.aperture_ratio = 1.0f;
+ cam->dof.focus_distance = 10.0f;
/* stereoscopy 3d */
cam->stereo.interocular_distance = 0.065f;
@@ -134,13 +135,13 @@ float BKE_camera_object_dof_distance(Object *ob)
if (ob->type != OB_CAMERA) {
return 0.0f;
}
- if (cam->dof_ob) {
+ if (cam->dof.focus_object) {
float view_dir[3], dof_dir[3];
normalize_v3_v3(view_dir, ob->obmat[2]);
- sub_v3_v3v3(dof_dir, ob->obmat[3], cam->dof_ob->obmat[3]);
+ sub_v3_v3v3(dof_dir, ob->obmat[3], cam->dof.focus_object->obmat[3]);
return fabsf(dot_v3v3(view_dir, dof_dir));
}
- return cam->dof_distance;
+ return cam->dof.focus_distance;
}
float BKE_camera_sensor_size(int sensor_fit, float sensor_x, float sensor_y)
@@ -1016,18 +1017,6 @@ void BKE_camera_multiview_params(RenderData *rd,
}
}
-void BKE_camera_to_gpu_dof(struct Object *camera, struct GPUFXSettings *r_fx_settings)
-{
- if (camera->type == OB_CAMERA) {
- Camera *cam = camera->data;
- r_fx_settings->dof = &cam->gpu_dof;
- r_fx_settings->dof->focal_length = cam->lens;
- r_fx_settings->dof->sensor = BKE_camera_sensor_size(
- cam->sensor_fit, cam->sensor_x, cam->sensor_y);
- r_fx_settings->dof->focus_distance = BKE_camera_object_dof_distance(camera);
- }
-}
-
CameraBGImage *BKE_camera_background_image_new(Camera *cam)
{
CameraBGImage *bgpic = MEM_callocN(sizeof(CameraBGImage), "Background Image");