[vulkan] Ignore light map alpha

Needed to use an rgba format to use floats (and optimal layout), but
having to set the alpha to 1 even for full-dark luxels is not very
efficient. Better to just ignore the alpha in the shader. Fixes the
occasional transparent surface in shadowed areas.
This commit is contained in:
Bill Currie 2021-01-22 13:08:33 +09:00
parent 55badea1ae
commit c016ad9f55
2 changed files with 3 additions and 3 deletions

View file

@ -117,9 +117,9 @@ main (void)
}*/
c = texture (Texture, t_st);
if (doLight) {
c *= texture (Lightmap, l_st);
c *= vec4 (texture (Lightmap, l_st).xyz, 1);
}
c += texture (Glowmap, t_st);
c = texture (Lightmap, l_st);
c = vec4(texture (Lightmap, l_st).xyz, 1);
frag_color = c;//fogBlend (c);
}

View file

@ -167,7 +167,7 @@ Vulkan_BuildLightMap (msurface_t *surf, vulkan_ctx_t *ctx)
*out++ += *lightmap++ * scale / 65536.0;
*out++ += *lightmap++ * scale / 65536.0;
*out++ += *lightmap++ * scale / 65536.0;
*out++ = 1;
out++;
}
}
}