mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
from user Ewyncat: adds invcameratrans, cameratoscrren, and screentocamera postfx and shader matrix interfaces.
also a bit of backend work to normalize those later once we've proof-of-concepted the calcs
This commit is contained in:
parent
7c3bd49615
commit
022b87cac2
9 changed files with 53 additions and 1 deletions
|
|
@ -945,6 +945,30 @@ void PostEffect::_setupConstants( const SceneRenderState *state )
|
|||
mShaderConsts->set(mMatCameraToWorldSC, tempMat);
|
||||
}
|
||||
|
||||
if (mInvCameraTransSC->isValid())
|
||||
{
|
||||
MatrixF mat = state->getCameraTransform();
|
||||
mat.fullInverse();
|
||||
mShaderConsts->set(mInvCameraTransSC, mat, mInvCameraTransSC->getType());
|
||||
}
|
||||
//Projection Matrix
|
||||
if (mMatCameraToScreenSC->isValid())
|
||||
{
|
||||
|
||||
MatrixF tempMat = thisFrame.cameraToScreen;
|
||||
mShaderConsts->set(mMatCameraToScreenSC, tempMat, mMatCameraToScreenSC->getType());
|
||||
}
|
||||
|
||||
|
||||
//Inverse Projection Matrix
|
||||
if (mMatScreenToCameraSC->isValid())
|
||||
{
|
||||
|
||||
MatrixF tempMat = thisFrame.cameraToScreen;
|
||||
tempMat.fullInverse();
|
||||
|
||||
mShaderConsts->set(mMatScreenToCameraSC, tempMat, mMatScreenToCameraSC->getType());
|
||||
}
|
||||
mShaderConsts->setSafe( mAccumTimeSC, MATMGR->getTotalTime() );
|
||||
mShaderConsts->setSafe( mDeltaTimeSC, MATMGR->getDeltaTime() );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue