| 222 | } |
| 223 | |
| 224 | bool VolumetricFogRTManager::Resize() |
| 225 | { |
| 226 | if (mTargetScale < 1 || GFX->getAdapterType() == Direct3D11) |
| 227 | mTargetScale = 1; |
| 228 | |
| 229 | mWidth = mFloor(mPlatformWindow->getClientExtent().x / mTargetScale); |
| 230 | mHeight = mFloor(mPlatformWindow->getClientExtent().y / mTargetScale); |
| 231 | |
| 232 | if (mWidth < 16 || mHeight < 16) |
| 233 | return false; |
| 234 | |
| 235 | if (mFrontTarget.isRegistered()) |
| 236 | mFrontTarget.setTexture(NULL); |
| 237 | |
| 238 | if (mDepthTarget.isRegistered()) |
| 239 | mDepthTarget.setTexture(NULL); |
| 240 | |
| 241 | if (mDepthBuffer.isValid()) |
| 242 | mDepthBuffer->kill(); |
| 243 | |
| 244 | if (mFrontBuffer.isValid()) |
| 245 | mFrontBuffer->kill(); |
| 246 | |
| 247 | mFrontBuffer = GFXTexHandle(mWidth, mHeight, GFXFormatR32F, |
| 248 | &GFXRenderTargetProfile, avar("%s() - mFrontBuffer (line %d)", __FUNCTION__, __LINE__)); |
| 249 | if (!mFrontBuffer.isValid()) |
| 250 | { |
| 251 | Con::errorf("VolumetricFogRTManager::Resize() Fatal Error: Unable to create front buffer"); |
| 252 | return false; |
| 253 | } |
| 254 | mFrontTarget.setTexture(mFrontBuffer); |
| 255 | |
| 256 | mDepthBuffer = GFXTexHandle(mWidth, mHeight, GFXFormatR32F, |
| 257 | &GFXRenderTargetProfile, avar("%s() - mDepthBuffer (line %d)", __FUNCTION__, __LINE__)); |
| 258 | if (!mDepthBuffer.isValid()) |
| 259 | { |
| 260 | Con::errorf("VolumetricFogRTManager::Resize() Fatal Error: Unable to create Depthbuffer"); |
| 261 | return false; |
| 262 | } |
| 263 | mDepthTarget.setTexture(mDepthBuffer); |
| 264 | return true; |
| 265 | } |
| 266 | |
| 267 | S32 VolumetricFogRTManager::setQuality(U32 Quality) |
| 268 | { |
nothing calls this directly
no test coverage detected