Function ovr_sys::ovr_GetFovTextureSize [] [src]

pub unsafe extern "C" fn ovr_GetFovTextureSize(
    session: ovrSession,
    eye: ovrEyeType,
    fov: ovrFovPort,
    pixelsPerDisplayPixel: f32
) -> ovrSizei

Calculates the recommended viewport size for rendering a given eye within the HMD with a given FOV cone.

Higher FOV will generally require larger textures to maintain quality.

Apps packing multiple eye views together on the same texture should ensure there are at least 8 pixels of padding between them to prevent texture filtering and chromatic aberration causing images to leak between the two eye views.

session Specifies an ovrSession previously returned by ovr_Create.

eye Specifies which eye (left or right) to calculate for.

fov Specifies the ovrFovPort to use.

pixelsPerDisplayPixel Specifies the ratio of the number of render target pixels to display pixels at the center of distortion. 1.0 is the default value. Lower values can improve performance, higher values give improved quality.

Example code

let hmd_desc = ovr_GetHmdDesc(session);
let eye_size_left = ovr_GetFovTextureSize(session, ovrEye_Left,  hmd_desc.DefaultEyeFov[ovrEye_Left as usize],  1.0);
let eye_size_right = ovr_GetFovTextureSize(session, ovrEye_Right, hmd_desc.DefaultEyeFov[ovrEye_Right as usize], 1.0);

Returns the texture width and height size.