mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-28 11:03:49 +00:00
Added propagated multibake mode.
Temporarily disabled Precapture post effect.
This commit is contained in:
parent
b89e189047
commit
a25f188200
4 changed files with 24 additions and 12 deletions
|
|
@ -838,7 +838,7 @@ String ReflectionProbe::getIrradianceMapPath()
|
|||
return fileName;
|
||||
}
|
||||
|
||||
void ReflectionProbe::bake(String outputPath, S32 resolution)
|
||||
void ReflectionProbe::bake(String outputPath, S32 resolution, bool renderWithProbes)
|
||||
{
|
||||
GFXDEBUGEVENT_SCOPE(ReflectionProbe_Bake, ColorI::WHITE);
|
||||
|
||||
|
|
@ -846,7 +846,7 @@ void ReflectionProbe::bake(String outputPath, S32 resolution)
|
|||
|
||||
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"));
|
||||
if (preCapture)
|
||||
{
|
||||
|
|
@ -855,7 +855,7 @@ void ReflectionProbe::bake(String outputPath, S32 resolution)
|
|||
preCapture->enable();
|
||||
}
|
||||
if (deferredShading)
|
||||
deferredShading->disable();
|
||||
deferredShading->disable();*/
|
||||
|
||||
GFXCubemapHandle sceneCaptureCubemap;
|
||||
|
||||
|
|
@ -904,8 +904,12 @@ void ReflectionProbe::bake(String outputPath, S32 resolution)
|
|||
//gEditingMission = false;
|
||||
|
||||
//Set this to true to use the prior method where it goes through the SPT_Reflect path for the bake
|
||||
|
||||
bool probeRenderState = ProbeManager::smRenderReflectionProbes;
|
||||
ProbeManager::smRenderReflectionProbes = false;
|
||||
|
||||
if (!renderWithProbes)
|
||||
ProbeManager::smRenderReflectionProbes = false;
|
||||
|
||||
for (U32 i = 0; i < 6; ++i)
|
||||
{
|
||||
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!");
|
||||
}
|
||||
|
||||
ProbeManager::smRenderReflectionProbes = probeRenderState;
|
||||
if(!renderWithProbes)
|
||||
ProbeManager::smRenderReflectionProbes = probeRenderState;
|
||||
|
||||
setMaskBits(-1);
|
||||
|
||||
if (preCapture)
|
||||
/*if (preCapture)
|
||||
preCapture->disable();
|
||||
if (deferredShading)
|
||||
deferredShading->enable();
|
||||
deferredShading->enable();*/
|
||||
|
||||
U32 endMSTime = Platform::getRealMilliseconds();
|
||||
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);
|
||||
}
|
||||
|
||||
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.")
|
||||
{
|
||||
ReflectionProbe *clientProbe = (ReflectionProbe*)object->getClientObject();
|
||||
|
||||
if (clientProbe)
|
||||
{
|
||||
clientProbe->bake(outputPath, resolution);
|
||||
clientProbe->bake(outputPath, resolution, renderWithProbes);
|
||||
}
|
||||
//object->bake(outputPath, resolution);
|
||||
}
|
||||
|
|
@ -240,7 +240,7 @@ public:
|
|||
//Baking
|
||||
String getPrefilterMapPath();
|
||||
String getIrradianceMapPath();
|
||||
void bake(String outputPath, S32 resolution);
|
||||
void bake(String outputPath, S32 resolution, bool renderWithProbes = false);
|
||||
};
|
||||
|
||||
typedef ProbeRenderInst::ProbeShapeType ReflectProbeType;
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ ConsoleDocClass( MissionMarker,
|
|||
|
||||
MissionMarker::MissionMarker()
|
||||
{
|
||||
mTypeMask |= StaticObjectType;
|
||||
mTypeMask |= StaticObjectType | MarkerObjectType;
|
||||
mDataBlock = 0;
|
||||
mAddedToScene = false;
|
||||
mNetFlags.set(Ghostable | ScopeAlways);
|
||||
|
|
|
|||
|
|
@ -28,15 +28,21 @@ function ProbeBakeDlg_RunBake::onClick(%this)
|
|||
%currentProgressValue = 0;
|
||||
|
||||
ProbeBakeDlg_Progress.setValue(%currentProgressValue);
|
||||
Canvas.repaint();
|
||||
|
||||
for(%iter=0; %iter < %numIter; %iter++)
|
||||
{
|
||||
%renderWithProbes = false;
|
||||
|
||||
if(%iter != 0)
|
||||
%renderWithProbes = true;
|
||||
|
||||
for(%i=0; %i < %probeCount; %i++)
|
||||
{
|
||||
%probe = getWord(%probeIds, %i);
|
||||
|
||||
%path = filePath($Server::MissionFile) @ "/" @ fileBase($Server::MissionFile) @ "/probes/";
|
||||
%probe.bake(%path, %resolution);
|
||||
%probe.bake(%path, %resolution, %renderWithProbes);
|
||||
|
||||
%currentProgressValue += %progressStep;
|
||||
ProbeBakeDlg_Progress.setValue(%currentProgressValue);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue