mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-23 10:51:58 -05:00
0aaac728b5
This improves GLES compatiblity due to missing rectangle textures, but NPOT 2D ones being universally available.
26 lines
710 B
GLSL
26 lines
710 B
GLSL
#version 150
|
|
|
|
uniform usampler2D uOpaqueTex;
|
|
uniform sampler2D uOpaqueDepth;
|
|
uniform usampler2D uTransparentTex;
|
|
uniform sampler2D uTransparentDepth;
|
|
uniform usampler2D uPaletteTex;
|
|
|
|
in vec2 fTextureCoordinate;
|
|
|
|
out uint oColour;
|
|
|
|
void main()
|
|
{
|
|
uint opaque = texture(uOpaqueTex, fTextureCoordinate).r;
|
|
float opaqueDepth = texture(uOpaqueDepth, fTextureCoordinate).r;
|
|
uint transparent = texture(uTransparentTex, fTextureCoordinate).r;
|
|
float transparentDepth = texture(uTransparentDepth, fTextureCoordinate).r;
|
|
|
|
if (opaqueDepth <= transparentDepth)
|
|
{
|
|
transparent = 0u;
|
|
}
|
|
|
|
oColour = texture(uPaletteTex, vec2(opaque, transparent) / 256.f).r;
|
|
}
|