28 #ifndef OVR_Util_Render_Stereo_h
29 #define OVR_Util_Render_Stereo_h
31 #include "../OVR_Stereo.h"
38 namespace Util {
namespace Render {
55 bool bRendertargetSharedByBothEyes,
56 float pixelDensityInCenter = 1.0f );
60 bool bMakeFovSymmetrical =
false);
64 Sizei const &actualRendertargetSurfaceSize,
65 bool bRendertargetSharedByBothEyes,
66 bool bRightHanded =
true,
67 float zNear = 0.01f,
float zFar = 10000.0f,
68 Sizei const *pOverrideRenderedPixelSize =
NULL,
69 FovPort
const *pOverrideFovport =
NULL,
70 float zoomFactor = 1.0f );
73 StereoEye eyeType,
bool bMonoRenderingMode );
88 Sizei const &actualRendertargetSurfaceSize,
89 Recti const &renderViewport );
92 Sizei const &actualRendertargetSurfaceSize,
93 Sizei const &requestedRenderSize,
94 bool bRendertargetSharedByBothEyes =
false );
97 Sizei const &actualRendertargetSurfaceSize,
98 float pixelDensity = 1.0f,
99 bool bRendertargetSharedByBothEyes =
false );
161 bool rendertargetIsSharedByBothEyes );
180 float pixelDensityInCenter = 1.0f );
226 bool rightHandedProjection =
true );
338 int *pNumVertices,
int *pNumTriangles,
344 int *pNumVertices,
int *pNumTriangles,
372 int *pNumVertices,
int *pNumTriangles,
378 int *pNumVertices,
int *pNumTriangles,
bool rightEye,
407 bool withTimewarp =
true,
408 bool withVsync =
true );
bool IsRendertargetSharedByBothEyes
Transformf GetViewRenderPredictionPose(SensorFusion &sfusion)
void HeightmapMeshCreate(HeightmapMeshVertexData **ppVertices, UInt16 **ppTriangleListIndices, int *pNumVertices, int *pNumTriangles, const StereoEyeParams &stereoParams, const HmdRenderInfo &hmdRenderInfo)
ScaleAndOffset2D EyeToSourceUV
Sizei CalculateRecommendedTextureSize(HmdRenderInfo const &hmd, bool bRendertargetSharedByBothEyes, float pixelDensityInCenter)
ViewportScaleAndOffsetBothEyes SetRenderViewport(Recti const &renderViewportLeft, Recti const &renderViewportRight)
StereoConfig(StereoMode mode=Stereo_LeftRight_Multipass)
Matrix4f TimewarpComputePoseDeltaPosition(Matrix4f const &renderedViewFromWorld, Matrix4f const &predictedViewFromWorld, Matrix4f const &eyeViewAdjust)
StereoEyeParams StereoEye
LensConfig LensOverrideRight
float PresentFlushToTimewarpStart
Transformf EyeRenderPoses[2]
ViewportScaleAndOffset ModifyRenderViewport(StereoEyeParams const ¶ms, Sizei const &actualRendertargetSurfaceSize, Recti const &renderViewport)
void HeightmapMeshDestroy(HeightmapMeshVertexData *pVertices, UInt16 *pTriangleMeshIndices)
ViewportScaleAndOffset ModifyRenderDensity(StereoEyeParams const ¶ms, Sizei const &actualRendertargetSurfaceSize, float pixelDensity, bool bRendertargetSharedByBothEyes)
void JustInTime_BeforeDistortionTimeMeasurement(double timeNow)
float PresentFlushToPresentFlushSeconds
LensConfig LensOverrideLeft
ViewportScaleAndOffset ModifyRenderSize(StereoEyeParams const ¶ms, Sizei const &actualRendertargetSurfaceSize, Sizei const &requestedRenderSize, bool bRendertargetSharedByBothEyes)
double NextFramePresentFlushTime
ViewportScaleAndOffset Left
float DistortionTimes[NumDistortionTimes]
char const * GetDebugNameEyeCupType(EyeCupType eyeCupType)
float SetViewportPixelsPerDisplayPixel
Matrix4f TimewarpComputePoseDelta(Matrix4f const &renderedViewFromWorld, Matrix4f const &predictedViewFromWorld, Matrix4f const &eyeViewAdjust)
float DistortionTimeAverage
void SetExtraEyeRotation(float extraEyeRotationInRadians=0.0f)
void SetZClipPlanesAndHandedness(float zNear=0.01f, float zFar=10000.0f, bool rightHandedProjection=true)
void SetStereoMode(StereoMode mode)
static FovPort CreateFromRadians(float horizontalFov, float verticalFov)
double GetVisiblePixelTimeEnd()
float PresentFlushToPresentFlush
Transformf GetPredictedVisiblePixelPoseEnd(SensorFusion &sfusion)
float PresentFlushToTimewarpEnd
bool RightHandedProjection
Sizei CalculateRecommendedTextureSize(bool rendertargetSharedByBothEyes, float pixelDensityInCenter=1.0f)
double JustInTime_GetDistortionWaitUntilTime()
StereoMode GetStereoMode() const
ViewportScaleAndOffsetBothEyes SetRenderDensity(float pixelsPerDisplayPixel)
double LastFramePresentFlushTime
ViewportScaleAndOffset Right
void SetHmdRenderInfo(const HmdRenderInfo &hmd)
Transformf GetPredictedVisiblePixelPoseStart(SensorFusion &sfusion)
StereoEyeParams CalculateStereoEyeParams(HmdRenderInfo const &hmd, StereoEye eyeType, Sizei const &actualRendertargetSurfaceSize, bool bRendertargetSharedByBothEyes, bool bRightHanded, float zNear, float zFar, Sizei const *pOverrideRenderedPixelSize, FovPort const *pOverrideFovport, float zoomFactor)
bool JustInTime_NeedDistortionTimeMeasurement() const
Matrix4f GetTimewarpDeltaEnd(SensorFusion &sfusion, Transformf const &renderedPose)
void Reset(HmdRenderInfo &renderInfo, bool vsyncEnabled, double timeNow)
Vector3f CalculateEyeVirtualCameraOffset(HmdRenderInfo const &hmd, StereoEye eyeType, bool bmonoRenderingMode)
const HmdRenderInfo & GetHmdRenderInfo() const
StereoEyeParamsWithOrtho EyeRenderParams[2]
enum OVR::Util::Render::StereoConfig::SetViewportModeEnum SetViewportMode
char const * GetDebugNameHmdType(HmdTypeEnum hmdType)
double GetVisiblePixelTimeStart()
ViewportScaleAndOffsetBothEyes setupViewportScaleAndOffsets()
void SetRendertargetSize(Size< int > const rendertargetSize, bool rendertargetIsSharedByBothEyes)
float PresentFlushToRenderedScene
const StereoEyeParamsWithOrtho & GetEyeRenderParams(StereoEye eye)
double DistortionTimeCurrentStart
void DistortionMeshCreate(DistortionMeshVertexData **ppVertices, UInt16 **ppTriangleListIndices, int *pNumVertices, int *pNumTriangles, const StereoEyeParams &stereoParams, const HmdRenderInfo &hmdRenderInfo)
void JustInTime_AfterDistortionTimeMeasurement(double timeNow)
void DistortionMeshDestroy(DistortionMeshVertexData *pVertices, UInt16 *pTriangleMeshIndices)
void AfterPresentAndFlush(double timeNow)
PredictionValues PredictionGetDeviceValues(const HmdRenderInfo &hmdRenderInfo, bool withTimewarp, bool withVsync)
ViewportScaleAndOffsetBothEyes SetRenderSize(Sizei const &renderSizeLeft, Sizei const &renderSizeRight)
void Set2DAreaFov(float fovRadians)
void SetFov(FovPort const *pfovLeft=NULL, FovPort const *pfovRight=NULL)
void SetZeroVirtualIpdOverride(bool enableOverride)
PredictionValues CurrentPredictionValues
Matrix4f GetProjectionWithZoom(StereoEye eye, float fovZoom) const
Vector3< float > Vector3f
void SetFovPortRadians(float horizontal, float vertical)
Matrix4f GetTimewarpDeltaStart(SensorFusion &sfusion, Transformf const &renderedPose)
float ExtraEyeRotationInRadians
FovPort CalculateRecommendedFov(HmdRenderInfo const &hmd, StereoEye eyeType, bool bMakeFovSymmetrical)
double GetViewRenderPredictionTime()
void UpdateComputedState()
void SetLensOverride(LensConfig const *pLensOverrideLeft=NULL, LensConfig const *pLensOverrideRight=NULL)