74 FovPort (
float u,
float d,
float l,
float r ) :
85 result.
UpTan = tanf ( verticalFov * 0.5f );
86 result.
DownTan = tanf ( verticalFov * 0.5f );
87 result.
LeftTan = tanf ( horizontalFov * 0.5f );
88 result.
RightTan = tanf ( horizontalFov * 0.5f );
93 float verticalFovDegrees)
368 float offsetToRightInMeters,
369 float offsetDownwardsInMeters,
370 float lensDiameterInMeters,
384 FovPort fov,
float pixelsPerDisplayPixel );
389 float zNear = 0.01f,
float zFar = 10000.0f );
392 float tanHalfFovX,
float tanHalfFovY,
393 float unitsX,
float unitsY,
float distanceFromCamera,
394 float interpupillaryDistance,
Matrix4f const &projection,
395 float zNear = 0.0f,
float zFar = 0.0f );
400 Recti renderedViewport,
401 Sizei renderTargetSize );
454 const Vector2f &tanEyeAngle,
bool usePolyApprox =
false );
460 #endif // OVR_Stereo_h
struct OVR::HmdRenderInfo::ShutterInfo Shutter
float DistortionFnInverse(float r) const
Vector2f TransformScreenPixelToScreenNDC(Recti const &distortionViewport, Vector2f const &pixel)
const float OVR_DEFAULT_EXTRA_EYE_ROTATION
Vector2f TransformTanFovSpaceToScreenNDC(DistortionRenderDesc const &distortion, const Vector2f &tanEyeAngle, bool usePolyApprox)
Recti GetFramebufferViewport(StereoEye eyeType, HmdRenderInfo const &hmd)
Vector2f TransformScreenPixelToTanFovSpace(Recti const &distortionViewport, DistortionRenderDesc const &distortion, Vector2f const &pixel)
OVR_FORCE_INLINE const T Max(const T a, const T b)
struct OVR::HmdRenderInfo::EyeConfig EyeLeft
float GetMaxSideTan() const
float VsyncToFirstScanline
ScaleAndOffset2D CreateUVScaleAndOffsetfromNDCScaleandOffset(ScaleAndOffset2D scaleAndOffsetNDC, Recti renderedViewport, Sizei renderTargetSize)
float LensSeparationInMeters
struct OVR::HmdRenderInfo::EyeConfig EyeRight
float DistortionFn(float r) const
DistortionRenderDesc Distortion
Vector2f TanEyeAngleScale
FovPort CalculateFovFromHmdInfo(StereoEye eyeType, DistortionRenderDesc const &distortion, HmdRenderInfo const &hmd, float extraEyeRotationInRadians)
Vector3f DistortionFnScaleRadiusSquaredChroma(float rsq) const
void TransformScreenNDCToTanFovSpaceChroma(Vector2f *resultR, Vector2f *resultG, Vector2f *resultB, DistortionRenderDesc const &distortion, const Vector2f &framebufferNDC)
static FovPort CreateFromRadians(float horizontalFov, float verticalFov)
FovPort CalculateFovFromEyePosition(float eyeReliefInMeters, float offsetToRightInMeters, float offsetDownwardsInMeters, float lensDiameterInMeters, float extraEyeRotationInRadians)
Sizei CalculateIdealPixelSize(StereoEye eyeType, DistortionRenderDesc const &distortion, FovPort tanHalfFov, float pixelsPerDisplayPixel)
float MetersPerTanAngleAtCenter
float DistortionFnInverseApprox(float r) const
Matrix4f RenderedProjection
float DistortionFnScaleRadiusSquared(float rsq) const
FovPort(float u, float d, float l, float r)
float ScreenGapSizeInMeters
Vector2f TanAngleToRendertargetNDC(Vector2f const &tanEyeAngle)
FovPort ClampToPhysicalScreenFov(StereoEye eyeType, DistortionRenderDesc const &distortion, FovPort inputFovPort)
LensConfig GenerateLensConfigFromEyeRelief(float eyeReliefInMeters, HmdRenderInfo const &hmd, DistortionEqnType distortionType)
DistortionRenderDesc CalculateDistortionRenderDesc(StereoEye eyeType, HmdRenderInfo const &hmd, const LensConfig *pLensOverride)
FovPort GetPhysicalScreenFov(StereoEye eyeType, DistortionRenderDesc const &distortion)
Vector2f TransformTanFovSpaceToRendertargetNDC(StereoEyeParams const &eyeParams, Vector2f const &tanEyeAngle)
Size< int > ResolutionInPixels
bool SaveLensConfig(UByte *pbuffer, int bufferSizeInBytes, LensConfig const &config)
int SaveLensConfigSizeInBytes(LensConfig const &config)
Matrix4f CreateProjection(bool rightHanded, FovPort tanHalfFov, float zNear, float zFar)
static FovPort Min(const FovPort &a, const FovPort &b)
ScaleAndOffset2D EyeToSourceUV
HMDInfo CreateDebugHMDInfo(HmdTypeEnum hmdType)
float GetVerticalFovRadians() const
float LensDiameterInMeters
float InvK[NumCoefficients]
FovPort(float sideTan=0.0f)
void SetUpInverseApprox()
float GetHorizontalFovRadians() const
struct ovrFovPort_ ovrFovPort
Vector2f TransformTanFovSpaceToRendertargetTexUV(StereoEyeParams const &eyeParams, Vector2f const &tanEyeAngle)
bool FitCubicPolynomial(float *pResult, const float *pFitX, const float *pFitY)
ScaleAndOffset2D(float sx=0.0f, float sy=0.0f, float ox=0.0f, float oy=0.0f)
ScaleAndOffset2D CreateNDCScaleAndOffsetFromFov(FovPort tanHalfFov)
static FovPort CreateFromDegrees(float horizontalFovDegrees, float verticalFovDegrees)
bool LoadLensConfig(LensConfig *presult, UByte const *pbuffer, int bufferSizeInBytes)
float GetHorizontalFovDegrees() const
static FovPort Max(const FovPort &a, const FovPort &b)
float LensSurfaceToMidplateInMeters
float GetVerticalFovDegrees() const
EyeConfig GetEyeCenter() const
OVR_FORCE_INLINE const T Min(const T a, const T b)
Matrix4f CreateOrthoSubProjection(bool rightHanded, StereoEye eyeType, float tanHalfFovX, float tanHalfFovY, float unitsX, float unitsY, float distanceFromCamera, float interpupillaryDistance, Matrix4f const &projection, float zNear, float zFar)
Vector2f TransformScreenNDCToTanFovSpace(DistortionRenderDesc const &distortion, const Vector2f &framebufferNDC)
float ChromaticAberration[4]
Size< float > ScreenSizeInMeters
float NoseToPupilInMeters
float FirstScanlineToLastScanline
Vector2f PixelsPerTanAngleAtCenter
Vector2f TransformRendertargetNDCToTanFovSpace(const ScaleAndOffset2D &eyeToSourceNDC, const Vector2f &textureNDC)
Vector2f TransformScreenNDCToRendertargetTexUV(DistortionRenderDesc const &distortion, StereoEyeParams const &eyeParams, Vector2f const &pixel)
Vector2f TransformScreenPixelToRendertargetTexUV(Recti const &distortionViewport, DistortionRenderDesc const &distortion, StereoEyeParams const &eyeParams, Vector2f const &pixel)
HmdRenderInfo GenerateHmdRenderInfoFromHmdInfo(HMDInfo const &hmdInfo, Profile const *profile, DistortionEqnType distortionType, EyeCupType eyeCupOverride)
ScaleAndOffset2D EyeToSourceNDC
float CenterFromTopInMeters