| 278 | } |
| 279 | |
| 280 | GFXTextureObject* 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 | |
| 309 | BaseMatInstance* ReflectionManager::getReflectionMaterial( BaseMatInstance *inMat ) const |
| 310 | { |
no test coverage detected