mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
shift capturing from a globalMacro to a sceneRenderstate S32
lets us ditch shader recompilation so that can be done on the fly without hitches, though does cost us a per-shader const for objects and postfx
This commit is contained in:
parent
71e0626ec2
commit
fe26ffc375
13 changed files with 69 additions and 101 deletions
|
|
@ -115,6 +115,8 @@ void ShaderConstHandles::init( GFXShader *shader, CustomMaterial* mat /*=NULL*/)
|
|||
// MFT_HardwareSkinning
|
||||
mNodeTransforms = shader->getShaderConstHandle( "$nodeTransforms" );
|
||||
|
||||
mIsCapturingSC = shader->getShaderConstHandle(ShaderGenVars::isCapturing);
|
||||
|
||||
// Clear any existing texture handles.
|
||||
dMemset( mTexHandlesSC, 0, sizeof( mTexHandlesSC ) );
|
||||
if(mat)
|
||||
|
|
@ -1093,6 +1095,8 @@ void ProcessedShaderMaterial::_setShaderConstants(SceneRenderState * state, cons
|
|||
shaderConsts->setSafe( handles->mAccumTimeSC, MATMGR->getTotalTime() );
|
||||
|
||||
shaderConsts->setSafe(handles->mDampnessSC, MATMGR->getDampnessClamped());
|
||||
shaderConsts->setSafe(handles->mIsCapturingSC, (S32)state->isCapturing());
|
||||
|
||||
// If the shader constants have not been lost then
|
||||
// they contain the content from a previous render pass.
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue