mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Merge branch 'alpha40_BandingBreakup' of https://github.com/Azaezel/Torque3D into Preview4_0_w_alph40_cleanups
This commit is contained in:
commit
638a515702
5 changed files with 29 additions and 13 deletions
|
|
@ -36,6 +36,7 @@
|
|||
#include "materials/shaderData.h"
|
||||
|
||||
#include "gfx/gfxTextureManager.h"
|
||||
#include "scene/reflectionManager.h"
|
||||
|
||||
#include "postFx/postEffect.h"
|
||||
#include "T3D/lighting/reflectionProbe.h"
|
||||
|
|
@ -930,6 +931,14 @@ void RenderProbeMgr::bakeProbe(ReflectionProbe *probe)
|
|||
if (!renderWithProbes)
|
||||
RenderProbeMgr::smRenderReflectionProbes = false;
|
||||
|
||||
GFXFormat reflectFormat;
|
||||
|
||||
if (clientProbe->mUseHDRCaptures)
|
||||
reflectFormat = GFXFormatR16G16B16A16F;
|
||||
else
|
||||
reflectFormat = GFXFormatR8G8B8A8;
|
||||
const GFXFormat oldRefFmt = REFLECTMGR->getReflectFormat();
|
||||
REFLECTMGR->setReflectFormat(reflectFormat);
|
||||
cubeRefl.updateReflection(reflParams);
|
||||
|
||||
//Now, save out the maps
|
||||
|
|
@ -940,16 +949,8 @@ void RenderProbeMgr::bakeProbe(ReflectionProbe *probe)
|
|||
clientProbe->createClientResources();
|
||||
|
||||
//Prep it with whatever resolution we've dictated for our bake
|
||||
if (clientProbe->mUseHDRCaptures)
|
||||
{
|
||||
clientProbe->mIrridianceMap->mCubemap->initDynamic(resolution, GFXFormatR16G16B16A16F);
|
||||
clientProbe->mPrefilterMap->mCubemap->initDynamic(resolution, GFXFormatR16G16B16A16F);
|
||||
}
|
||||
else
|
||||
{
|
||||
clientProbe->mIrridianceMap->mCubemap->initDynamic(resolution, GFXFormatR8G8B8A8);
|
||||
clientProbe->mPrefilterMap->mCubemap->initDynamic(resolution, GFXFormatR8G8B8A8);
|
||||
}
|
||||
clientProbe->mIrridianceMap->mCubemap->initDynamic(resolution, reflectFormat);
|
||||
clientProbe->mPrefilterMap->mCubemap->initDynamic(resolution, reflectFormat);
|
||||
|
||||
GFXTextureTargetRef renderTarget = GFX->allocRenderToTextureTarget(false);
|
||||
|
||||
|
|
@ -980,6 +981,7 @@ void RenderProbeMgr::bakeProbe(ReflectionProbe *probe)
|
|||
probe->setMaskBits(-1);
|
||||
|
||||
Con::warnf("RenderProbeMgr::bake() - Finished bake! Took %g milliseconds", diffTime);
|
||||
REFLECTMGR->setReflectFormat(oldRefFmt);
|
||||
}
|
||||
|
||||
void RenderProbeMgr::bakeProbes()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue