mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-28 12:30:46 +00:00
- fixed clamp mode setup.
This commit is contained in:
parent
ab2686db34
commit
783dff41b6
2 changed files with 10 additions and 13 deletions
|
@ -40,7 +40,7 @@ FMaterial::FMaterial(FGameTexture * tx, int scaleflags)
|
||||||
mShaderIndex = SHADER_Default;
|
mShaderIndex = SHADER_Default;
|
||||||
sourcetex = tx;
|
sourcetex = tx;
|
||||||
auto imgtex = tx->GetTexture();
|
auto imgtex = tx->GetTexture();
|
||||||
mTextureLayers.Push({ imgtex, scaleflags });
|
mTextureLayers.Push({ imgtex, scaleflags, -1 });
|
||||||
|
|
||||||
if (tx->GetUseType() == ETextureType::SWCanvas && static_cast<FWrapperTexture*>(imgtex)->GetColorFormat() == 0)
|
if (tx->GetUseType() == ETextureType::SWCanvas && static_cast<FWrapperTexture*>(imgtex)->GetColorFormat() == 0)
|
||||||
{
|
{
|
||||||
|
@ -52,7 +52,8 @@ FMaterial::FMaterial(FGameTexture * tx, int scaleflags)
|
||||||
{
|
{
|
||||||
mShaderIndex = tx->GetShaderIndex();
|
mShaderIndex = tx->GetShaderIndex();
|
||||||
}
|
}
|
||||||
// no brightmap for cameratexture
|
mTextureLayers.Last().clampflags = CLAMP_CAMTEX;
|
||||||
|
// no additional layers for cameratexture
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -65,7 +66,7 @@ FMaterial::FMaterial(FGameTexture * tx, int scaleflags)
|
||||||
{
|
{
|
||||||
for (auto &texture : { tx->Normal.get(), tx->Specular.get() })
|
for (auto &texture : { tx->Normal.get(), tx->Specular.get() })
|
||||||
{
|
{
|
||||||
mTextureLayers.Push({ texture, 0 });
|
mTextureLayers.Push({ texture, 0, -1 });
|
||||||
}
|
}
|
||||||
mShaderIndex = SHADER_Specular;
|
mShaderIndex = SHADER_Specular;
|
||||||
}
|
}
|
||||||
|
@ -73,7 +74,7 @@ FMaterial::FMaterial(FGameTexture * tx, int scaleflags)
|
||||||
{
|
{
|
||||||
for (auto &texture : { tx->Normal.get(), tx->Metallic.get(), tx->Roughness.get(), tx->AmbientOcclusion.get() })
|
for (auto &texture : { tx->Normal.get(), tx->Metallic.get(), tx->Roughness.get(), tx->AmbientOcclusion.get() })
|
||||||
{
|
{
|
||||||
mTextureLayers.Push({ texture, 0 });
|
mTextureLayers.Push({ texture, 0, -1 });
|
||||||
}
|
}
|
||||||
mShaderIndex = SHADER_PBR;
|
mShaderIndex = SHADER_PBR;
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,15 +67,11 @@ bool GLInstance::SetTexture(int picnum, FGameTexture* tex, int paletteid, int me
|
||||||
if (!PickTexture(picnum, tex, paletteid, texpick)) return false;
|
if (!PickTexture(picnum, tex, paletteid, texpick)) return false;
|
||||||
|
|
||||||
int TextureType = (texpick.translation & 0x80000000) ? TT_INDEXED : TT_TRUECOLOR;
|
int TextureType = (texpick.translation & 0x80000000) ? TT_INDEXED : TT_TRUECOLOR;
|
||||||
auto sampler = (method & DAMETH_CLAMPED) ? (sampleroverride != -1 ? sampleroverride : SamplerClampXY) : SamplerRepeat;
|
auto sampler = (method & DAMETH_CLAMPED) ? (sampleroverride != -1 ? sampleroverride : SamplerClampXY) : SamplerRepeat;
|
||||||
if (TextureType == TT_INDEXED)
|
if (TextureType == TT_INDEXED)
|
||||||
{
|
{
|
||||||
sampler = sampler + SamplerNoFilterRepeat - SamplerRepeat;
|
sampler = sampler + SamplerNoFilterRepeat - SamplerRepeat;
|
||||||
}
|
}
|
||||||
else if (tex->isHardwareCanvas())
|
|
||||||
{
|
|
||||||
sampler = CLAMP_CAMTEX;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// This is intentionally the same value for both parameters. The shader does not use the same uniform for modulation and overlay colors.
|
// This is intentionally the same value for both parameters. The shader does not use the same uniform for modulation and overlay colors.
|
||||||
|
|
Loading…
Reference in a new issue