Fix lightmaps bake on D3D12
This commit is contained in:
@@ -188,7 +188,12 @@ bool ShadowsOfMordor::Builder::doWorkInner(DateTime buildStart)
|
||||
tempDesc.Format = HemispheresFormatToPixelFormat[CACHE_NORMALS_FORMAT];
|
||||
_cacheNormals = RenderTargetPool::Get(tempDesc);
|
||||
if (_cachePositions == nullptr || _cacheNormals == nullptr)
|
||||
{
|
||||
LOG(Warning, "Failed to get textures for cache.");
|
||||
_wasBuildCalled = false;
|
||||
_isActive = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
generateHemispheres();
|
||||
|
||||
@@ -228,6 +233,8 @@ bool ShadowsOfMordor::Builder::doWorkInner(DateTime buildStart)
|
||||
if (bounceCount <= 0 || hemispheresCount <= 0)
|
||||
{
|
||||
LOG(Warning, "No data to render");
|
||||
_wasBuildCalled = false;
|
||||
_isActive = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -284,8 +291,8 @@ bool ShadowsOfMordor::Builder::doWorkInner(DateTime buildStart)
|
||||
reportProgress(BuildProgressStep::RenderHemispheres, 1.0f);
|
||||
|
||||
#if DEBUG_EXPORT_HEMISPHERES_PREVIEW
|
||||
for (int32 sceneIndex = 0; sceneIndex < _scenes.Count(); sceneIndex++)
|
||||
downloadDebugHemisphereAtlases(_scenes[sceneIndex]);
|
||||
for (int32 sceneIndex = 0; sceneIndex < _scenes.Count(); sceneIndex++)
|
||||
downloadDebugHemisphereAtlases(_scenes[sceneIndex]);
|
||||
#endif
|
||||
|
||||
// References:
|
||||
@@ -391,6 +398,7 @@ int32 ShadowsOfMordor::Builder::doWork()
|
||||
buildFailed = doWorkInner(buildStart);
|
||||
if (buildFailed && !checkBuildCancelled())
|
||||
{
|
||||
IsBakingLightmaps = false;
|
||||
OnBuildFinished(buildFailed);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -78,6 +78,8 @@ void ShadowsOfMordor::Builder::generateHemispheres()
|
||||
// Fill cache
|
||||
if (runStage(RenderCache))
|
||||
return;
|
||||
if (waitForJobDataSync())
|
||||
return;
|
||||
|
||||
// Post-process cache
|
||||
if (runStage(PostprocessCache))
|
||||
|
||||
@@ -521,7 +521,7 @@ void ShadowsOfMordor::Builder::releaseResources()
|
||||
bool ShadowsOfMordor::Builder::waitForJobDataSync()
|
||||
{
|
||||
bool wasCancelled = false;
|
||||
const int32 framesToSyncCount = 3;
|
||||
const int32 framesToSyncCount = 4;
|
||||
|
||||
while (!wasCancelled)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user