Render preview banners with transparent patterns correctly #72
No reviewers
Labels
No Label
blocker
bug
code quality
confirmed
critical
discussion
high priority
incompatibility
incomplete feature
invalid
low priority
missing feauture
needs testing
packet spam
performance
project
regression
translations
unconfirmed
in review
ready for review
No Milestone
No project
No Assignees
2 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Mineclonia/Mineclonia#72
Loading…
Reference in New Issue
No description provided.
Delete Branch "banner-mask-fix-3"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Without this fix, the banner pattern preview generation does not mask
the banner pattern, so the alpha channel of the banner pattern is not
taken into account. This lead to preview banners with color gradients
showing up as a solid color banner and opaque pixel artifacts for the
bottom triangle pattern.
How to test
As a reviewer, please copy the entire section and check what you have tested. Even partial reviews help!
With this patch applied, craft banners in survival mode with patterns on a crafting table. A preview banner should appear in the crafting result preview field of the crafting table. The preview banner should have a light gray background with a downscaled version of the new banner pattern. Verify that the previewed is correct by actually crafting the banner and placing it in the world.
Verify that the following preview banners are rendered correctly (patterns ingredients in parentheses):
Verify that at least one banner wtih a partially transparent motive can be placed and looks correct. Mention in your review which banner you placed.
This replaces #70 – I will now run the tests myself.
@erlehmann Just to clarify, do you mean to apply each of these patterns to the original pair of banners, or to make a new pair for each of these patterns?
Passed: (Base)
Passed: (First batch)
Passed: (Second batch)
Failed: Banners no longer accepted dyes after this point
I did not think about that actually. :(
@e what exactly do you mean with
(first batch)
and(second batch)
?@erlehmann Crafted banners are limited to some number of layers (8?). I assumed your test meant to put as many test patterns on each pair of banners as possible. I crafted 4 banners (2 yellow, 2 white), and after the first pair stopped accepting new patterns, I started using the second pair. The first pair stopped accepting patterns after the dark green pattern. The second pair stopped accepting new patterns after adding the brown chevron, which seems wrong.
@e I found the following in
mods/ITEMS/mcl_banners/patterncraft.lua
:Seems https://github.com/minetest/minetest/issues/6210 was fixed though … this must be made a new issue!
@e I think the issue is not with my PR, do you agree?
@e do you think I need to change something here?
@erlehmann Thanks for looking in to that. The same behavior is indeed visible on master, and I've filed #73 accordingly. It should be a fairly quick PR, so I've assigned it to myself.
In the meantime, I'll continue testing this PR with a third batch of banners.
Passed: (Base)
Passed: (First batch)
Passed: (Second batch)
Passed: (Third batch)
@ -389,2 +389,3 @@
local layer = "(([combine:20x40:-2,-2="..pattern.."^[resize:16x24^[colorize:"..color..":"..layer_ratio.."))"
local layer = "(([combine:20x40:-2,-2=" .. pattern .. "^[resize:16x24^[colorize:" .. color .. ":" .. layer_ratio .. "))"
local mask = "(([combine:20x40:-2,-2=" .. pattern .. "^[resize:16x24" .. "))"
I don't think it's necessary to use two parentheses for either
layer
ormask
here. Probably not worth a commit to fix them, though.Please elaborate on that and propose an alternative. I just cargo culted it until it worked.
layer
andmask
both start with((
and end with))
, despite having no intervening parentheses, meaning (at least) one pair of parens is unneeded.A screenshot of the combined banners is attached. From left to right:
Closed in favor of rebased and fixed PR: #158