MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / process

Method process

Engine/source/postFx/postEffect.cpp:1387–1557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1385}
1386
1387void PostEffect::process( const SceneRenderState *state,
1388 GFXTexHandle &inOutTex,
1389 const RectI *inTexViewport )
1390{
1391 // If the shader is forced to be skipped... then skip.
1392 if ( mSkip )
1393 return;
1394
1395 // Skip out if we don't support reflection passes.
1396 if ( state && state->isReflectPass() && !mAllowReflectPass )
1397 return;
1398
1399 if ( mOneFrameOnly && !mOnThisFrame )
1400 return;
1401
1402 // Check requirements if the shader needs updating.
1403 if ( mUpdateShader )
1404 {
1405 _checkRequirements();
1406
1407 // Clear the targets if we failed passing
1408 // the requirements at this time.
1409 if ( !mIsValid )
1410 _cleanTargets( true );
1411 }
1412
1413 // If we're not valid then we cannot render.
1414 if ( !mIsValid )
1415 return;
1416
1417 GFXDEBUGEVENT_SCOPE_EX( PostEffect_Process, ColorI::GREEN, avar("PostEffect: %s", getName()) );
1418
1419 preProcess_callback();
1420
1421 GFXTransformSaver saver;
1422
1423 // Set the textures.
1424 for (U32 i = 0; i < NumTextures; i++)
1425 {
1426 if (mTextureType[i] == NormalTextureType)
1427 _setupTexture(i, inOutTex, inTexViewport);
1428 else if (mTextureType[i] == CubemapType)
1429 _setupCubemapTexture(i, mCubemapTextures[i]);
1430 else if (mTextureType[i] == CubemapArrayType)
1431 _setupCubemapArrayTexture(i, mCubemapArrayTextures[i]);
1432 }
1433
1434 _setupStateBlock( state ) ;
1435 _setupTransforms();
1436
1437 bool clearTarget = false;
1438 _setupTarget( state, &clearTarget );
1439
1440 if ( mTargetTex || mTargetDepthStencil )
1441 {
1442 const RectI &oldViewport = GFX->getViewport();
1443 GFXTarget *oldTarget = GFX->getActiveRenderTarget();
1444

Callers 1

renderEffectsMethod · 0.45

Calls 15

avarFunction · 0.85
beginFunction · 0.85
endFunction · 0.85
isReflectPassMethod · 0.80
getActiveRenderTargetMethod · 0.80
getWidthHeightMethod · 0.80
setActiveRenderTargetMethod · 0.80
setShaderConstBufferMethod · 0.80
setVertexBufferMethod · 0.80
onPFXProcessedMethod · 0.80
popActiveRenderTargetMethod · 0.80

Tested by

no test coverage detected