mirror of
https://github.com/ValveSoftware/openvr.git
synced 2026-11-17 02:11:36 +00:00
2
IVRSystem::ComputeDistortion
Ryan Speets edited this page 2017-02-26 20:08:46 -05:00
bool ComputeDistortion( Hmd_Eye eEye, float fU, float fV, DistortionCoordinates_t *pDistortionCoordinates )
Gets the result of a single distortion value for use in a distortion map. Input UVs are in a single eye's viewport, and output UVs are for the source render target in the distortion shader.
Returns true for success. False indicates values are unsuitable.
eEye-Eye_LeftorEye_Right. Determines which eye the function should return the distortion value for.fU- horizontal texture coordinate for the output pixel within the viewportfV- vertical texture coordinate for the output pixel within the viewportDistortionCoordinates_t *pDistortionCoordinates- The struct to be updated with the distortion values
ComputeDistortion returns distortion values using the following structure: struct DistortionCoordinates_t { float rfRed[2]; float rfGreen[2]; float rfBlue[2]; };
rfRed contains the UVs for the red channel, rfGreen contains the UVs for the green channel, and rfBlue contains the UVs for the blue channel.