- use texture clamping for skies, because these textures do not always wrap.

This commit is contained in:
Christoph Oelckers 2019-10-19 19:29:59 +02:00
parent 39e32d560c
commit 5fa879d5d1
3 changed files with 3 additions and 2 deletions

View file

@ -116,6 +116,7 @@ enum {
DAMETH_CLAMPED = 4,
DAMETH_MODEL = 8,
DAMETH_SKY = 16,
DAMETH_WALL = 32, // signals a texture for a wall (for r_npotwallmode)

View file

@ -503,7 +503,7 @@ static void polymost_drawpoly(vec2f_t const * const dpxy, int32_t const n, int32
static int32_t skyzbufferhack_pass = 0;
if (flatskyrender && skyzbufferhack_pass == 0)
{
polymost_flatskyrender(dpxy, n, method, tilesize);
polymost_flatskyrender(dpxy, n, method|DAMETH_SKY, tilesize);
return;
}

View file

@ -156,7 +156,7 @@ bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int
auto mtex = LoadTexture(tex, TextureType, lookuppal);
if (mtex)
{
auto sampler = (method & DAMETH_CLAMPED) ? (sampleroverride != -1 ? sampleroverride : SamplerClampXY) : SamplerRepeat;
auto sampler = method & DAMETH_SKY? SamplerClampXY : (method & DAMETH_CLAMPED) ? (sampleroverride != -1 ? sampleroverride : SamplerClampXY) : SamplerRepeat;
if (TextureType == TT_INDEXED) sampler = sampler + SamplerNoFilterRepeat - SamplerRepeat;
BindTexture(0, mtex, sampler);