Add missing file and only include static lights in the lightmaps

This commit is contained in:
Magnus Norddahl 2023-09-05 17:47:55 +02:00 committed by Christoph Oelckers
parent 8fa46c722d
commit 04941cab43
2 changed files with 55 additions and 29 deletions

View file

@ -305,6 +305,8 @@ void DoomLevelMesh::CreateLightList(DoomLevelMeshSurface* surface, FLightNode* n
{
FDynamicLight* light = node->lightsource;
if (light->Trace())
{
DVector3 pos = light->PosRelative(portalgroup);
LevelMeshLight meshlight;
@ -337,6 +339,7 @@ void DoomLevelMesh::CreateLightList(DoomLevelMeshSurface* surface, FLightNode* n
meshlight.Color.Z = light->GetBlue() * (1.0f / 255.0f);
surface->LightListBuffer.push_back(meshlight);
}
node = node->nextLight;
}

View file

@ -0,0 +1,23 @@
layout(set = 0, binding = 0) uniform sampler2D tex;
layout(location = 0) in vec3 worldpos;
layout(location = 0) out vec4 fragcolor;
void main()
{
ivec2 size = textureSize(tex, 0);
vec2 texCoord = gl_FragCoord.xy / vec2(size);
#if defined(BLUR_HORIZONTAL)
fragcolor =
textureOffset(tex, texCoord, ivec2( 0, 0)) * 0.5 +
textureOffset(tex, texCoord, ivec2( 1, 0)) * 0.25 +
textureOffset(tex, texCoord, ivec2(-1, 0)) * 0.25;
#else
fragcolor =
textureOffset(tex, texCoord, ivec2(0, 0)) * 0.5 +
textureOffset(tex, texCoord, ivec2(0, 1)) * 0.25 +
textureOffset(tex, texCoord, ivec2(0,-1)) * 0.25;
#endif
}