Allow lm_dynamic to be able to set level-wide in ZDRayInfo
This commit is contained in:
parent
d55409645f
commit
c40a36ea7c
7 changed files with 33 additions and 2 deletions
|
|
@ -22,6 +22,7 @@
|
|||
#include "vm.h"
|
||||
#include "p_setup.h"
|
||||
|
||||
static void UpdateLightmapTiles();
|
||||
static int InvalidateLightmap();
|
||||
static void InvalidateActorLightTraceCache();
|
||||
|
||||
|
|
@ -74,6 +75,16 @@ static bool RequireLightmap()
|
|||
return false;
|
||||
}
|
||||
|
||||
// Forces lightmap tiles update
|
||||
static void UpdateLightmapTiles()
|
||||
{
|
||||
for (auto& tile : level.levelMesh->Lightmap.Tiles)
|
||||
{
|
||||
if (!tile.NeedsInitialBake)
|
||||
tile.ReceivedNewLight = true;
|
||||
}
|
||||
}
|
||||
|
||||
static int InvalidateLightmap()
|
||||
{
|
||||
int count = 0;
|
||||
|
|
@ -251,6 +262,7 @@ DoomLevelMesh::DoomLevelMesh(FLevelLocals& doomMap)
|
|||
Lightmap.SampleDistance = doomMap.LightmapSampleDistance;
|
||||
LightBounce = doomMap.LightBounce;
|
||||
AmbientOcclusion = doomMap.AmbientOcclusion;
|
||||
LevelWideLMDynamic = doomMap.LevelWideLMDynamic;
|
||||
|
||||
// HWWall and HWFlat still looks at r_viewpoint when doing calculations,
|
||||
// but we aren't rendering a specific viewpoint when this function gets called
|
||||
|
|
@ -2717,6 +2729,14 @@ static void InvalidateActorLightTraceCache()
|
|||
}
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(_Lightmap, Update)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
UpdateLightmapTiles();
|
||||
InvalidateActorLightTraceCache();
|
||||
return 0;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(_Lightmap, Invalidate)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue