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

Method getRefractTex

Engine/source/scene/reflectionManager.cpp:280–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

278}
279
280GFXTextureObject* ReflectionManager::getRefractTex( bool forceUpdate )
281{
282 GFXTarget *target = GFX->getActiveRenderTarget();
283 GFXFormat targetFormat = target->getFormat();
284 const Point2I &targetSize = target->getSize();
285
286 // D3D11 needs to be the same size as the active target
287 U32 desWidth = targetSize.x;
288 U32 desHeight = targetSize.y;
289
290
291 if ( mRefractTex.isNull() ||
292 mRefractTex->getWidth() != desWidth ||
293 mRefractTex->getHeight() != desHeight ||
294 mRefractTex->getFormat() != targetFormat )
295 {
296 mRefractTex.set( desWidth, desHeight, targetFormat, &RefractTextureProfile, "mRefractTex" );
297 mUpdateRefract = true;
298 }
299
300 if ( forceUpdate || mUpdateRefract )
301 {
302 target->resolveTo( mRefractTex );
303 mUpdateRefract = false;
304 }
305
306 return mRefractTex;
307}
308
309BaseMatInstance* ReflectionManager::getReflectionMaterial( BaseMatInstance *inMat ) const
310{

Callers 4

innerRenderMethod · 0.80
renderObjectMethod · 0.80
setupSceneGraphInfoMethod · 0.80
setupSceneGraphInfoMethod · 0.80

Calls 8

getActiveRenderTargetMethod · 0.80
getFormatMethod · 0.45
getSizeMethod · 0.45
isNullMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45
setMethod · 0.45
resolveToMethod · 0.45

Tested by

no test coverage detected