Hey Milotron, thank you a lot for this standalone project, it makes it really easy to study principles of FOW and implement it into your own poroject ! And of course THANKS to **** for this great FREE AND OPEN solution!
I just want to put my 5 cents into this project; on UE 4.14.3 I experiencied a crash while launching FOW project on standalone game mode with EnablePostProcess set to ON in LevelInfo_BP:
MachineId:A06E43CE4CF1C48A0533C49DB547D1D4
EpicAccountId:333cfc2535634313bd4d2bff030c90c3
Access violation - code c0000005 (first/second chance not available)
nvwgf2umx
nvwgf2umx
nvwgf2umx
d3d11
UE4Editor_D3D11RHI!FD3D11DynamicRHI::RHIUpdateTexture2D() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\windows\d3d11rhi\private\d3d11texture.cpp:1540]
UE4Editor_RHI!FDynamicRHI::UpdateTexture2D_RenderThread() [d:\build\++ue4+release-4.14+compile\sync\engine\source\runtime\rhi\private\rhicommandlist.cpp:1966]
UE4Editor_O2Project_5697!`AFogOfWarManager::UpdateTextureRegions'::`5'::EURCMacro_UpdateTextureRegionsData::DoTask() [e:\unreal\o2projectnew\source\o2project\fogofwarmanager.cpp:241]
I don not know why, but in standalone mode in AFogOfWarManager something goes wrong with LastFOWTexture->UpdateResourceW() (be consequence it pass incorrect result into AFogOfWarManager::UpdateTextureRegions and as following - in RHIUpdateTexture2D). My simple solution is just to not perform LastFOWTexture->UpdateResourceW() on first tick with an additional bool variable and the following modification of code:
void AFogOfWarManager::Tick(float DeltaSeconds) {
Super::Tick(DeltaSeconds);
if (FOWTexture && LastFOWTexture && bHasFOWTextureUpdate && bIsDoneBlending) {
if (!bFirstFOWTextureUpdate) { //do not UpdateResource for LastFOWTexture on first tick
bFirstFOWTextureUpdate = true;
}
else {
LastFOWTexture->UpdateResourceW();
}
UpdateTextureRegions(LastFOWTexture, (int32)0, (uint32)1, textureRegions, (uint32)(4 * TextureSize), (uint32)4, (uint8*)LastFrameTextureData.GetData(), false);
FOWTexture->UpdateResourceW();
UpdateTextureRegions(FOWTexture, (int32)0, (uint32)1, textureRegions, (uint32)(4 * TextureSize), (uint32)4, (uint8*)TextureData.GetData(), false);
bHasFOWTextureUpdate = false;
bIsDoneBlending = false;
//Trigger the blueprint update
OnFowTextureUpdated(FOWTexture, LastFOWTexture);
}
}
Hope it helps others suffering the same issue with FOW, and it would be great if Milotron could includ this (or a better one) fix into his sample project :rolleyes: