mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fixed shader formatting in applytransparency.frag (#21071)
This commit is contained in:
parent
5b42da2646
commit
4b0b2a48f6
|
@ -7,7 +7,7 @@ uniform usampler2D uTransparentTex;
|
|||
uniform sampler2D uTransparentDepth;
|
||||
uniform usampler2D uPaletteTex;
|
||||
uniform usampler2D uBlendPaletteTex;
|
||||
// clang-format off
|
||||
// clang-format on
|
||||
|
||||
in vec2 fTextureCoordinate;
|
||||
|
||||
|
@ -15,24 +15,24 @@ out uint oColour;
|
|||
|
||||
void main()
|
||||
{
|
||||
uint opaque = texture(uOpaqueTex, fTextureCoordinate).r;
|
||||
uint opaque = texture(uOpaqueTex, fTextureCoordinate).r;
|
||||
float opaqueDepth = texture(uOpaqueDepth, fTextureCoordinate).r;
|
||||
uint transparent = texture(uTransparentTex, fTextureCoordinate).r;
|
||||
uint transparent = texture(uTransparentTex, fTextureCoordinate).r;
|
||||
float transparentDepth = texture(uTransparentDepth, fTextureCoordinate).r;
|
||||
|
||||
if (opaqueDepth <= transparentDepth)
|
||||
{
|
||||
transparent = 0u;
|
||||
}
|
||||
|
||||
|
||||
uint blendColour = (transparent & 0xff00u) >> 8;
|
||||
if(blendColour > 0u)
|
||||
if (blendColour > 0u)
|
||||
{
|
||||
if((transparent & 0x00ffu) != 0u)
|
||||
if ((transparent & 0x00ffu) != 0u)
|
||||
{
|
||||
oColour = blendColour;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
oColour = texture(uBlendPaletteTex, vec2(opaque, blendColour) / 256.f).r;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue