Eevee: Make Depth of field zoom invariant.

Multiply the sensor size by the viewcamtexcofac which is basicaly how scaled is the viewport relativly to the camera frame.
This commit is contained in:
Clément Foucault 2017-05-10 00:57:53 +02:00
parent 965571cca7
commit 1c18d07a1c
1 changed files with 1 additions and 1 deletions

View File

@ -298,7 +298,7 @@ void EEVEE_effects_init(EEVEE_Data *vedata)
effects->dof_params[0] = aperture * fabsf(focal_len_scaled / (focus_dist - focal_len_scaled));
effects->dof_params[1] = -focus_dist;
effects->dof_params[2] = viewport_size[0] / sensor_scaled;
effects->dof_params[2] = viewport_size[0] / (rv3d->viewcamtexcofac[0] * sensor_scaled);
effects->dof_bokeh[0] = blades;
effects->dof_bokeh[1] = rotation;
effects->dof_bokeh[2] = ratio;