right_mesh((GL::VERTEX2, GL::TEXCOORD2,0, GL::TEXCOORD2,1, GL::TEXCOORD2,2)),
shprog(vs_source, fs_source)
{
- width_div = 2;
-
const OculusRiftDevice::Private &dev_priv = device.get_private();
ovrHmd hmd = dev_priv.ovr_hmd;
create_distortion_mesh(right_mesh, hmd, ovrEye_Right, right_fov);
ovrSizei tex_size = ovrHmd_GetFovTextureSize(hmd, ovrEye_Left, left_fov, 1.0);
- oversize = max(tex_size.w*2.0f/hmd->Resolution.w, tex_size.h*1.0f/hmd->Resolution.h);
+ width_factor = tex_size.w*1.0f/hmd->Resolution.w;
+ height_factor = tex_size.h*1.0f/hmd->Resolution.h;
+ float aspect = (inner+outer)/(vertical*2);
+ aspect_factor = aspect*hmd->Resolution.h/hmd->Resolution.w;
shdata.uniform("texture", 0);