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:
AzaezelX 2024-04-16 13:51:41 -05:00
parent 71e0626ec2
commit fe26ffc375
13 changed files with 69 additions and 101 deletions

View file

@ -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.
//