mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
WIP shader work - not complete!
This commit is contained in:
parent
a44d885885
commit
6e17475f86
52 changed files with 1315 additions and 589 deletions
|
|
@ -309,7 +309,8 @@ PostEffect::PostEffect()
|
|||
mCameraForwardSC( NULL ),
|
||||
mAccumTimeSC( NULL ),
|
||||
mDeltaTimeSC( NULL ),
|
||||
mInvCameraMatSC( NULL )
|
||||
mInvCameraMatSC( NULL ),
|
||||
mMatCameraToWorldSC( NULL)
|
||||
{
|
||||
dMemset( mTexSRGB, 0, sizeof(bool) * NumTextures);
|
||||
dMemset( mActiveTextures, 0, sizeof( GFXTextureObject* ) * NumTextures );
|
||||
|
|
@ -615,6 +616,8 @@ void PostEffect::_setupConstants( const SceneRenderState *state )
|
|||
mDeltaTimeSC = mShader->getShaderConstHandle( "$deltaTime" );
|
||||
|
||||
mInvCameraMatSC = mShader->getShaderConstHandle( "$invCameraMat" );
|
||||
|
||||
mMatCameraToWorldSC = mShader->getShaderConstHandle("$cameraToWorld");
|
||||
}
|
||||
|
||||
// Set up shader constants for source image size
|
||||
|
|
@ -749,6 +752,13 @@ void PostEffect::_setupConstants( const SceneRenderState *state )
|
|||
mShaderConsts->set( mAmbientColorSC, ambientColor );
|
||||
}
|
||||
|
||||
if (mMatCameraToWorldSC->isValid())
|
||||
{
|
||||
MatrixF tempMat = thisFrame.worldToCamera;
|
||||
tempMat.inverse();
|
||||
mShaderConsts->set(mMatCameraToWorldSC, tempMat);
|
||||
}
|
||||
|
||||
mShaderConsts->setSafe( mAccumTimeSC, MATMGR->getTotalTime() );
|
||||
mShaderConsts->setSafe( mDeltaTimeSC, MATMGR->getDeltaTime() );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue