Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContentCAO: Fix threshold of alpha channel textures #14213

Merged
merged 3 commits into from Jan 10, 2024

Conversation

SmallJoker
Copy link
Member

With disabled shaders, the material EMT_TRANSPARENT_ALPHA_CHANNEL uses the parameter as an alpha threshold to decide whether to draw the texture. Thus lowering this limit fixes the issue of vanishing textures below alpha 128.

Fixes #14204

To do

This PR is Ready for Review.

How to test

1.- Set enable_shaders = false in MT
2. Install the Citadel game (ContentDB)
3. Teleport/travel to (5, 2, 12)
4. Look south and upwards, and see (or don't) the ghost
5. edit games/citadel/mods/citadel_core/ghost.lua. Modify the opacity in the line self.object:set_texture_mod to 10, 127, 128 and make sure the texture is still rendered.

With disabled shaders, the material EMT_TRANSPARENT_ALPHA_CHANNEL uses the
parameter as an alpha threshold to decide whether to draw the texture.
Thus lowering this limit fixes the issue of vanishing textures below alpha 128.
src/client/content_cao.cpp Outdated Show resolved Hide resolved
Copy link
Member

@sfan5 sfan5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sfan5 sfan5 merged commit a7eaee7 into minetest:master Jan 10, 2024
13 checks passed
rubenwardy pushed a commit that referenced this pull request Mar 24, 2024
With disabled shaders, the material EMT_TRANSPARENT_ALPHA_CHANNEL uses the
parameter as an alpha threshold to decide whether to draw the texture.
Thus lowering this limit fixes the issue of vanishing textures below alpha 128.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Alpha-blending entities disappear completely when enable_shaders=false and alpha <= 127
4 participants