Skip to content

Conversation

@Wuzzy2
Copy link
Contributor

@Wuzzy2 Wuzzy2 commented Dec 16, 2025

This PR updates the texture modifier documentation by making it somewhat more accurate and precise.

Work based on https://docs.luanti.org/for-creators/api/texture-modifiers/, the texts are basically copied from there with minor changes. Thanks to @appgurueu.

(Ideally, it would have been better if those changes would have gone to lua_api.md first, but … oh well)

To do

How to test

Read the changes. ;-)

@cx384 cx384 added @ Documentation Improvements or additions to documentation Textures labels Dec 16, 2025
Work based on docs.luanti.org, thanks to @appgurueu
@Wuzzy2 Wuzzy2 force-pushed the doc_texture_modifiers_appgurueu branch from d8ca450 to 97ed4f0 Compare December 16, 2025 12:11
texture to the maximum value (255).

As the red, green and blue channels aren't premultiplied with alpha in PNGs,
this might reveal hidden colors of otherwise transparent portions of an image.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this affects other operations like [invert, too. Perhaps make this a general comment with a suitable link to e.g. https://en.wikipedia.org/wiki/Alpha_compositing (not sure if that is a good resource, though).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the documentation already implies that texture modifiers "stack" so I don't see a need to update.

Copy link
Contributor

Choose a reason for hiding this comment

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

I might be missing something, but I think [noalpha is not the only modifier capable of changing pixel alpha from zero to a non zero value. IIUC [invert can do it, too, if mode contains a. And those modifiers (not sure if there are more) could benefit from a similar comment.

@Wuzzy2
Copy link
Contributor Author

Wuzzy2 commented Jan 4, 2026

Addressed your comments.
I also completely rewrote the [crack documentation because it turns out that [crack behaves much differently than we previously believed (determined by testing).

So my recommended use of [crack is the 2-parameter version both for normal and animated textures. The 3-parameter version seems rather esoteric because it creates a grid of cracks. I suppose this could be used for tilesheets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

@ Documentation Improvements or additions to documentation Textures

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants