Exclude fullbright stuff from tracelighting

This commit is contained in:
nashmuhandes 2024-12-17 10:07:44 +08:00
commit be36118017
3 changed files with 11 additions and 4 deletions

View file

@ -306,7 +306,7 @@ public:
void AddOtherFloorPlane(int sector, gl_subsectorrendernode * node, FRenderState& state);
void AddOtherCeilingPlane(int sector, gl_subsectorrendernode * node, FRenderState& state);
void GetDynSpriteLight(AActor *self, float x, float y, float z, FLightNode *node, int portalgroup, float *out);
void GetDynSpriteLight(AActor *self, float x, float y, float z, FLightNode *node, int portalgroup, float *out, bool fullbright);
void GetDynSpriteLight(AActor *thing, particle_t *particle, float *out);
void PreparePlayerSprites(sector_t * viewsector, area_t in_area, FRenderState& state);

View file

@ -120,8 +120,11 @@ float inverseSquareAttenuation(float dist, float radius, float strength)
return (b * b) / (dist * dist + 1.0) * strength;
}
void HWDrawInfo::GetDynSpriteLight(AActor *self, float x, float y, float z, FLightNode *node, int portalgroup, float *out)
void HWDrawInfo::GetDynSpriteLight(AActor *self, float x, float y, float z, FLightNode *node, int portalgroup, float *out, bool fullbright)
{
if (fullbright)
return;
FDynamicLight *light;
float frac, lr, lg, lb;
float radius;
@ -234,11 +237,11 @@ void HWDrawInfo::GetDynSpriteLight(AActor *thing, particle_t *particle, float *o
{
if (thing != NULL)
{
GetDynSpriteLight(thing, (float)thing->X(), (float)thing->Y(), (float)thing->Center(), thing->section->lighthead, thing->Sector->PortalGroup, out);
GetDynSpriteLight(thing, (float)thing->X(), (float)thing->Y(), (float)thing->Center(), thing->section->lighthead, thing->Sector->PortalGroup, out, (thing->flags5 & MF5_BRIGHT));
}
else if (particle != NULL)
{
GetDynSpriteLight(NULL, (float)particle->Pos.X, (float)particle->Pos.Y, (float)particle->Pos.Z, particle->subsector->section->lighthead, particle->subsector->sector->PortalGroup, out);
GetDynSpriteLight(NULL, (float)particle->Pos.X, (float)particle->Pos.Y, (float)particle->Pos.Z, particle->subsector->section->lighthead, particle->subsector->sector->PortalGroup, out, (particle->flags & SPF_FULLBRIGHT));
}
}
@ -249,6 +252,9 @@ void hw_GetDynModelLight(HWDrawContext* drawctx, AActor *self, FDynLightData &mo
if (self)
{
if ((self->flags5 & MF5_BRIGHT))
return;
auto &addedLights = drawctx->addedLightsArray;
addedLights.Clear();

View file

@ -32,6 +32,7 @@ class Corona : Actor abstract
{
RenderStyle "Add";
RenderRadius 1024.0;
+BRIGHT
+NOINTERACTION
+NOGRAVITY
+FORCEXYBILLBOARD