-void OculusRiftCombiner::update_parameters()
-{
- left_shdata.uniform4("distortion", distortion);
- left_shdata.uniform4("chromatic", chromatic);
- right_shdata.uniform4("distortion", distortion);
- right_shdata.uniform4("chromatic", chromatic);
-
- // Set lens center positions, in output texture coordinates
- left_shdata.uniform("lens_center", 1.0f-lens_separation, 0.5);
- right_shdata.uniform("lens_center", lens_separation, 0.5);
-
- /* Compute distance between eye and lens centers, in sampling texture
- coordinates. */
- float eye_offset = distort((eye_separation-lens_separation)*2);
- left_shdata.uniform("eye_center", -eye_offset, 0.0f);
- right_shdata.uniform("eye_center", eye_offset, 0.0f);
-
- /* Determine the necessary scaling factor to avoid quality degradation in
- the center of the screen. */
- float horiz_oversize = distort((fill_factor-lens_separation)*2)/((fill_factor-lens_separation)*2)-eye_offset;
- float vert_oversize = distort(1.25f*fill_factor)/(1.25f*fill_factor);
- oversize = min(horiz_oversize, vert_oversize);
-
- left_shdata.uniform("scale", 2.0f, 2.5f, oversize);
- right_shdata.uniform("scale", 2.0f, 2.5f, oversize);
-
- fov = Geometry::atan(oversize*0.625f/view_distance/2)*2.0f;
- frustum_skew = lens_separation*2-1;
-}
+ create_distortion_mesh(left_mesh, hmd, ovrEye_Left, left_fov);
+ create_distortion_mesh(right_mesh, hmd, ovrEye_Right, right_fov);