mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-22 21:05:39 +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() );
|
||||
|
||||
|
|
|
|||
|
|
@ -142,6 +142,7 @@ protected:
|
|||
GFXShaderConstHandle *mAccumTimeSC;
|
||||
GFXShaderConstHandle *mDeltaTimeSC;
|
||||
GFXShaderConstHandle *mInvCameraMatSC;
|
||||
GFXShaderConstHandle *mMatCameraToWorldSC;
|
||||
|
||||
bool mAllowReflectPass;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue