|
@@ -838,7 +838,7 @@ String ReflectionProbe::getIrradianceMapPath()
|
|
return fileName;
|
|
return fileName;
|
|
}
|
|
}
|
|
|
|
|
|
-void ReflectionProbe::bake(String outputPath, S32 resolution)
|
|
|
|
|
|
+void ReflectionProbe::bake(String outputPath, S32 resolution, bool renderWithProbes)
|
|
{
|
|
{
|
|
GFXDEBUGEVENT_SCOPE(ReflectionProbe_Bake, ColorI::WHITE);
|
|
GFXDEBUGEVENT_SCOPE(ReflectionProbe_Bake, ColorI::WHITE);
|
|
|
|
|
|
@@ -846,7 +846,7 @@ void ReflectionProbe::bake(String outputPath, S32 resolution)
|
|
|
|
|
|
U32 startMSTime = Platform::getRealMilliseconds();
|
|
U32 startMSTime = Platform::getRealMilliseconds();
|
|
|
|
|
|
- PostEffect *preCapture = dynamic_cast<PostEffect*>(Sim::findObject("AL_PreCapture"));
|
|
|
|
|
|
+ /*PostEffect *preCapture = dynamic_cast<PostEffect*>(Sim::findObject("AL_PreCapture"));
|
|
PostEffect *deferredShading = dynamic_cast<PostEffect*>(Sim::findObject("AL_DeferredShading"));
|
|
PostEffect *deferredShading = dynamic_cast<PostEffect*>(Sim::findObject("AL_DeferredShading"));
|
|
if (preCapture)
|
|
if (preCapture)
|
|
{
|
|
{
|
|
@@ -855,7 +855,7 @@ void ReflectionProbe::bake(String outputPath, S32 resolution)
|
|
preCapture->enable();
|
|
preCapture->enable();
|
|
}
|
|
}
|
|
if (deferredShading)
|
|
if (deferredShading)
|
|
- deferredShading->disable();
|
|
|
|
|
|
+ deferredShading->disable();*/
|
|
|
|
|
|
GFXCubemapHandle sceneCaptureCubemap;
|
|
GFXCubemapHandle sceneCaptureCubemap;
|
|
|
|
|
|
@@ -904,8 +904,12 @@ void ReflectionProbe::bake(String outputPath, S32 resolution)
|
|
//gEditingMission = false;
|
|
//gEditingMission = false;
|
|
|
|
|
|
//Set this to true to use the prior method where it goes through the SPT_Reflect path for the bake
|
|
//Set this to true to use the prior method where it goes through the SPT_Reflect path for the bake
|
|
|
|
+
|
|
bool probeRenderState = ProbeManager::smRenderReflectionProbes;
|
|
bool probeRenderState = ProbeManager::smRenderReflectionProbes;
|
|
- ProbeManager::smRenderReflectionProbes = false;
|
|
|
|
|
|
+
|
|
|
|
+ if (!renderWithProbes)
|
|
|
|
+ ProbeManager::smRenderReflectionProbes = false;
|
|
|
|
+
|
|
for (U32 i = 0; i < 6; ++i)
|
|
for (U32 i = 0; i < 6; ++i)
|
|
{
|
|
{
|
|
GFXTexHandle blendTex;
|
|
GFXTexHandle blendTex;
|
|
@@ -1023,13 +1027,15 @@ void ReflectionProbe::bake(String outputPath, S32 resolution)
|
|
Con::errorf("ReflectionProbe::bake() - Didn't generate a valid scene capture cubemap, unable to generate prefilter and irradiance maps!");
|
|
Con::errorf("ReflectionProbe::bake() - Didn't generate a valid scene capture cubemap, unable to generate prefilter and irradiance maps!");
|
|
}
|
|
}
|
|
|
|
|
|
- ProbeManager::smRenderReflectionProbes = probeRenderState;
|
|
|
|
|
|
+ if(!renderWithProbes)
|
|
|
|
+ ProbeManager::smRenderReflectionProbes = probeRenderState;
|
|
|
|
+
|
|
setMaskBits(-1);
|
|
setMaskBits(-1);
|
|
|
|
|
|
- if (preCapture)
|
|
|
|
|
|
+ /*if (preCapture)
|
|
preCapture->disable();
|
|
preCapture->disable();
|
|
if (deferredShading)
|
|
if (deferredShading)
|
|
- deferredShading->enable();
|
|
|
|
|
|
+ deferredShading->enable();*/
|
|
|
|
|
|
U32 endMSTime = Platform::getRealMilliseconds();
|
|
U32 endMSTime = Platform::getRealMilliseconds();
|
|
F32 diffTime = F32(endMSTime - startMSTime);
|
|
F32 diffTime = F32(endMSTime - startMSTime);
|
|
@@ -1037,14 +1043,14 @@ void ReflectionProbe::bake(String outputPath, S32 resolution)
|
|
Con::warnf("ReflectionProbe::bake() - Finished bake! Took %g milliseconds", diffTime);
|
|
Con::warnf("ReflectionProbe::bake() - Finished bake! Took %g milliseconds", diffTime);
|
|
}
|
|
}
|
|
|
|
|
|
-DefineEngineMethod(ReflectionProbe, Bake, void, (String outputPath, S32 resolution), ("", 256),
|
|
|
|
|
|
+DefineEngineMethod(ReflectionProbe, Bake, void, (String outputPath, S32 resolution, bool renderWithProbes), ("", 64, false),
|
|
"@brief returns true if control object is inside the fog\n\n.")
|
|
"@brief returns true if control object is inside the fog\n\n.")
|
|
{
|
|
{
|
|
ReflectionProbe *clientProbe = (ReflectionProbe*)object->getClientObject();
|
|
ReflectionProbe *clientProbe = (ReflectionProbe*)object->getClientObject();
|
|
|
|
|
|
if (clientProbe)
|
|
if (clientProbe)
|
|
{
|
|
{
|
|
- clientProbe->bake(outputPath, resolution);
|
|
|
|
|
|
+ clientProbe->bake(outputPath, resolution, renderWithProbes);
|
|
}
|
|
}
|
|
//object->bake(outputPath, resolution);
|
|
//object->bake(outputPath, resolution);
|
|
}
|
|
}
|