Browse Source

Added propagated multibake mode.
Temporarily disabled Precapture post effect.

Areloch 6 years ago
parent
commit
43c1abbc96

+ 15 - 9
Engine/source/T3D/lighting/reflectionProbe.cpp

@@ -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);
 }

+ 1 - 1
Engine/source/T3D/lighting/reflectionProbe.h

@@ -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;

+ 1 - 1
Engine/source/T3D/missionMarker.cpp

@@ -82,7 +82,7 @@ ConsoleDocClass( MissionMarker,
 
 MissionMarker::MissionMarker()
 {
-   mTypeMask |= StaticObjectType;
+   mTypeMask |= StaticObjectType | MarkerObjectType;
    mDataBlock = 0;
    mAddedToScene = false;
    mNetFlags.set(Ghostable | ScopeAlways);

+ 7 - 1
Templates/Full/game/tools/worldEditor/scripts/probeBake.ed.cs

@@ -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);