Skip to content

Problem with multiple transparent textures #3566

Answered by kpreid
B1azA asked this question in Q&A
Discussion options

You must be logged in to vote

Correct transparency rendering, in the general case, is a fundamentally hard problem which GPUs cannot just solve for you implicitly.

In your case, it looks like you're interested in shapes that are either fully opaque or fully transparent; you can handle these by checking the alpha value in the fragment shader and running discard; if it is zero. This will stop the A being hidden in the first case. It will not help with semi-transparent antialiased edges; you can either remove all partial transparency from your input textures and live with jagged edges, or use signed distance field (SDF) rendering, which can make a smooth edge at any scale from a properly prepared texture. (This is partic…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by B1azA
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants