1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Added OpenGL TTF hinting

This commit is contained in:
Michael Bernardi
2023-12-03 18:58:28 +01:00
parent f64706e1d9
commit 8c7d1d149a
18 changed files with 129 additions and 37 deletions

View File

@@ -5,6 +5,7 @@ uniform sampler2D uOpaqueDepth;
uniform usampler2D uTransparentTex;
uniform sampler2D uTransparentDepth;
uniform usampler2D uPaletteTex;
uniform usampler2D uBlendPaletteTex;
in vec2 fTextureCoordinate;
@@ -21,6 +22,21 @@ void main()
{
transparent = 0u;
}
oColour = texture(uPaletteTex, vec2(opaque, transparent) / 256.f).r;
uint blendColour = (transparent & 0xff00u) >> 8;
if(blendColour > 0u)
{
if((transparent & 0x00ffu) != 0u)
{
oColour = blendColour;
}
else
{
oColour = texture(uBlendPaletteTex, vec2(opaque, blendColour) / 256.f).r;
}
}
else
{
oColour = texture(uPaletteTex, vec2(opaque, transparent) / 256.f).r;
}
}

View File

@@ -48,7 +48,21 @@ void main()
}
else
{
texel = fColour;
uint hint_thresh = uint(fFlags & 0xff00) >> 8;
if(hint_thresh > 0u)
{
bool solidColor = texel > 180u;
texel = (texel > hint_thresh) ? fColour : 0u;
texel = texel << 8;
if(solidColor)
{
texel += 1u;
}
}
else
{
texel = fColour;
}
}
}
else