mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-16 00:54:54 +00:00
Merge pull request #864 from Azaezel/alpha401/lightcapturefix
adds light fade and cap trackign to probe manager
This commit is contained in:
commit
8da0cd07c9
2 changed files with 24 additions and 3 deletions
|
|
@ -470,6 +470,21 @@ void RenderProbeMgr::reloadTextures()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RenderProbeMgr::preBake()
|
||||||
|
{
|
||||||
|
Con::setVariable("$Probes::Capturing", "1");
|
||||||
|
mRenderMaximumNumOfLights = AdvancedLightBinManager::smMaximumNumOfLights;
|
||||||
|
mRenderUseLightFade = AdvancedLightBinManager::smUseLightFade;
|
||||||
|
|
||||||
|
AdvancedLightBinManager::smMaximumNumOfLights = -1;
|
||||||
|
AdvancedLightBinManager::smUseLightFade = false;
|
||||||
|
}
|
||||||
|
void RenderProbeMgr::postBake()
|
||||||
|
{
|
||||||
|
Con::setVariable("$Probes::Capturing", "0");
|
||||||
|
AdvancedLightBinManager::smMaximumNumOfLights = mRenderMaximumNumOfLights;
|
||||||
|
AdvancedLightBinManager::smUseLightFade = mRenderUseLightFade;
|
||||||
|
}
|
||||||
void RenderProbeMgr::bakeProbe(ReflectionProbe* probe)
|
void RenderProbeMgr::bakeProbe(ReflectionProbe* probe)
|
||||||
{
|
{
|
||||||
GFXDEBUGEVENT_SCOPE(RenderProbeMgr_Bake, ColorI::WHITE);
|
GFXDEBUGEVENT_SCOPE(RenderProbeMgr_Bake, ColorI::WHITE);
|
||||||
|
|
@ -477,7 +492,7 @@ void RenderProbeMgr::bakeProbe(ReflectionProbe* probe)
|
||||||
Con::warnf("RenderProbeMgr::bakeProbe() - Beginning bake!");
|
Con::warnf("RenderProbeMgr::bakeProbe() - Beginning bake!");
|
||||||
U32 startMSTime = Platform::getRealMilliseconds();
|
U32 startMSTime = Platform::getRealMilliseconds();
|
||||||
|
|
||||||
Con::setVariable("$Probes::Capturing", "1");
|
preBake();
|
||||||
|
|
||||||
String path = Con::getVariable("$pref::ReflectionProbes::CurrentLevelPath", "levels/");
|
String path = Con::getVariable("$pref::ReflectionProbes::CurrentLevelPath", "levels/");
|
||||||
U32 resolution = Con::getIntVariable("$pref::ReflectionProbes::BakeResolution", 64);
|
U32 resolution = Con::getIntVariable("$pref::ReflectionProbes::BakeResolution", 64);
|
||||||
|
|
@ -598,7 +613,7 @@ void RenderProbeMgr::bakeProbe(ReflectionProbe* probe)
|
||||||
if (!renderWithProbes)
|
if (!renderWithProbes)
|
||||||
RenderProbeMgr::smRenderReflectionProbes = probeRenderState;
|
RenderProbeMgr::smRenderReflectionProbes = probeRenderState;
|
||||||
|
|
||||||
Con::setVariable("$Probes::Capturing", "0");
|
postBake();
|
||||||
|
|
||||||
cubeRefl.unregisterReflector();
|
cubeRefl.unregisterReflector();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -290,6 +290,11 @@ private:
|
||||||
/// </summary>
|
/// </summary>
|
||||||
bool mUseHDRCaptures;
|
bool mUseHDRCaptures;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// holds the normal render state for light fade so we can capture them before and restore them after baking
|
||||||
|
/// </summary>
|
||||||
|
S32 mRenderMaximumNumOfLights;
|
||||||
|
bool mRenderUseLightFade;
|
||||||
protected:
|
protected:
|
||||||
/// The current active light manager.
|
/// The current active light manager.
|
||||||
static RenderProbeMgr* smProbeManager;
|
static RenderProbeMgr* smProbeManager;
|
||||||
|
|
@ -413,7 +418,8 @@ public:
|
||||||
/// Takes a reflection probe and runs the cubemap bake process on it, outputting the resulting files to disk
|
/// Takes a reflection probe and runs the cubemap bake process on it, outputting the resulting files to disk
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void bakeProbe(ReflectionProbe* probe);
|
void bakeProbe(ReflectionProbe* probe);
|
||||||
|
void preBake();
|
||||||
|
void postBake();
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Runs the cubemap bake on all probes in the current scene
|
/// Runs the cubemap bake on all probes in the current scene
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue