mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
USe correct frustum projections in reflections in separate rt mode
This commit is contained in:
parent
1b2abbeaaa
commit
de48afc00c
|
|
@ -28,6 +28,7 @@
|
|||
#include "console/consoleTypes.h"
|
||||
#include "core/tAlgorithm.h"
|
||||
#include "math/mMathFn.h"
|
||||
#include "math/mathUtils.h"
|
||||
#include "T3D/gameBase/gameConnection.h"
|
||||
#include "ts/tsShapeInstance.h"
|
||||
#include "gui/3d/guiTSControl.h"
|
||||
|
|
@ -134,12 +135,22 @@ void ReflectionManager::update( F32 timeSlice,
|
|||
// Setup a culler for testing the
|
||||
// visibility of reflectors.
|
||||
Frustum culler;
|
||||
culler.set( false,
|
||||
query.fov,
|
||||
(F32)resolution.x / (F32)resolution.y,
|
||||
query.nearPlane,
|
||||
query.farPlane,
|
||||
query.cameraMatrix );
|
||||
|
||||
S32 stereoTarget = GFX->getCurrentStereoTarget();
|
||||
if (stereoTarget != -1)
|
||||
{
|
||||
MathUtils::makeFovPortFrustum(&culler, false, query.nearPlane, query.farPlane, query.fovPort[stereoTarget]);
|
||||
}
|
||||
else
|
||||
{
|
||||
culler.set(false,
|
||||
query.fov,
|
||||
(F32)resolution.x / (F32)resolution.y,
|
||||
query.nearPlane,
|
||||
query.farPlane,
|
||||
query.cameraMatrix);
|
||||
}
|
||||
|
||||
|
||||
// Manipulate the frustum for tiled screenshots
|
||||
const bool screenShotMode = gScreenShot && gScreenShot->isPending();
|
||||
|
|
|
|||
|
|
@ -548,16 +548,24 @@ void PlaneReflector::updateReflection( const ReflectParams ¶ms )
|
|||
|
||||
// store current matrices
|
||||
GFXTransformSaver saver;
|
||||
|
||||
Point2I viewport(params.viewportExtent);
|
||||
if(GFX->getCurrentRenderStyle() == GFXDevice::RS_StereoSideBySide)
|
||||
{
|
||||
viewport.x *= 0.5f;
|
||||
}
|
||||
F32 aspectRatio = F32( viewport.x ) / F32( viewport.y );
|
||||
|
||||
Frustum frustum;
|
||||
frustum.set(false, params.query->fov, aspectRatio, params.query->nearPlane, params.query->farPlane);
|
||||
|
||||
S32 stereoTarget = GFX->getCurrentStereoTarget();
|
||||
if (stereoTarget != -1)
|
||||
{
|
||||
MathUtils::makeFovPortFrustum(&frustum, false, params.query->nearPlane, params.query->farPlane, params.query->fovPort[stereoTarget]);
|
||||
}
|
||||
else
|
||||
{
|
||||
Point2I viewport(params.viewportExtent);
|
||||
if (GFX->getCurrentRenderStyle() == GFXDevice::RS_StereoSideBySide)
|
||||
{
|
||||
viewport.x *= 0.5f;
|
||||
}
|
||||
F32 aspectRatio = F32(viewport.x) / F32(viewport.y);
|
||||
frustum.set(false, params.query->fov, aspectRatio, params.query->nearPlane, params.query->farPlane);
|
||||
}
|
||||
|
||||
// Manipulate the frustum for tiled screenshots
|
||||
const bool screenShotMode = gScreenShot && gScreenShot->isPending();
|
||||
|
|
|
|||
Loading…
Reference in a new issue