Add PBR lightprobe thing and always bake probes if encountered

This commit is contained in:
Magnus Norddahl 2025-07-10 03:10:15 +02:00
commit ed0db43eaa
3 changed files with 10 additions and 4 deletions

View file

@ -916,6 +916,13 @@ public:
Level->SunDirection = -FVector3 { pc * angle.Cos(), pc * angle.Sin(), -pitch.Sin() }; // [RaveYard]: is there a dedicated function for this?
Level->lightmaps = true;
}
else if (th->EdNum == 9892) // PBR lightprobe thing
{
LightProbe probe;
probe.position = FVector3((float)th->pos.X, (float)th->pos.Y, (float)th->pos.Z);
probe.index = Level->lightProbes.size();
Level->lightProbes.Push(probe);
}
}
//===========================================================================

View file

@ -56,7 +56,7 @@ EXTERN_CVAR(Bool, gl_bandedswlight)
EXTERN_CVAR(Bool, lm_dynlights);
CVAR(Bool, gl_raytrace, false, 0/*CVAR_ARCHIVE | CVAR_GLOBALCONFIG*/)
CVAR(Bool, gl_lightprobe, false, 0/*CVAR_ARCHIVE | CVAR_GLOBALCONFIG*/)
CVAR(Bool, gl_lightprobe, true, 0/*CVAR_ARCHIVE | CVAR_GLOBALCONFIG*/)
extern bool NoInterpolateView;
@ -405,10 +405,9 @@ sector_t* RenderView(player_t* player)
});
}
if (gl_lightprobe)
if (gl_lightprobe && level.lightProbes.size() > 0)
{
// Render the light probes if not found in a lump
// To do: we need light probe actors
AActor* lightprobe = level.GetThinkerIterator<AActor>(NAME_LightProbe, STAT_INFO).Next();
if (lightprobe)
@ -432,7 +431,6 @@ sector_t* RenderView(player_t* player)
}
else
{
Printf("Warning: spawning LightProbe\n");
auto probe = Spawn(&level, NAME_LightProbe);
probe->ChangeStatNum(STAT_INFO);
}

View file

@ -147,6 +147,7 @@ DoomEdNums
9884 = SpotLightFlickerRandomTraceAttenuated // ZDRay lightmap spotlight (random flickering)
9890 = None // ZDRayInfo
9891 = Fogball
9892 = None // PBR lightprobe
9982 = SecActEyesAboveC
9983 = SecActEyesBelowC
9988 = CustomSprite