mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-14 00:45:22 +00:00
Side by side rendering
- Side by side rendering implemented throughout the graphics pipeline. - New GuiTSCtrl renderStyle property is set to "stereo side by side" to activate. - You set an IDisplayDevice on the GameConnection to define any vertical FOV, projection offset, and stereo eye offset properties required for the stereo rendering (no display device included with this commit). - Full and Empty templates updated with correct scripts and shaders.
This commit is contained in:
parent
b1feed56fd
commit
b32e7688c2
28 changed files with 465 additions and 41 deletions
|
|
@ -76,6 +76,9 @@ Frustum::Frustum( bool isOrtho,
|
|||
mNumTiles = 1;
|
||||
mCurrTile.set(0,0);
|
||||
mTileOverlap.set(0.0f, 0.0f);
|
||||
|
||||
mProjectionOffset.zero();
|
||||
mProjectionOffsetMatrix.identity();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -433,12 +436,27 @@ void Frustum::mulL( const MatrixF& mat )
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void Frustum::setProjectionOffset(const Point2F& offsetMat)
|
||||
{
|
||||
mProjectionOffset = offsetMat;
|
||||
mProjectionOffsetMatrix.identity();
|
||||
mProjectionOffsetMatrix.setPosition(Point3F(mProjectionOffset.x, mProjectionOffset.y, 0.0f));
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
void Frustum::getProjectionMatrix( MatrixF *proj, bool gfxRotate ) const
|
||||
{
|
||||
if (mIsOrtho)
|
||||
{
|
||||
MathUtils::makeOrthoProjection(proj, mNearLeft, mNearRight, mNearTop, mNearBottom, mNearDist, mFarDist, gfxRotate);
|
||||
proj->mulL(mProjectionOffsetMatrix);
|
||||
}
|
||||
else
|
||||
{
|
||||
MathUtils::makeProjection(proj, mNearLeft, mNearRight, mNearTop, mNearBottom, mNearDist, mFarDist, gfxRotate);
|
||||
proj->mulL(mProjectionOffsetMatrix);
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue