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

tiny bit of cruft around transparent png with quadblitter #1065

Closed
dankamongmen opened this issue Oct 18, 2020 · 8 comments
Closed

tiny bit of cruft around transparent png with quadblitter #1065

dankamongmen opened this issue Oct 18, 2020 · 8 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@dankamongmen
Copy link
Owner

Blitting Celes onto the FF1 overworld map with the Quadblitter definitely shows some transparency residue cruft:

2020-10-18-003449_722x857_scrot

This does not happen with the halfblock blitter:

2020-10-18-003622_722x857_scrot

@dankamongmen dankamongmen self-assigned this Oct 18, 2020
@dankamongmen dankamongmen added the bug Something isn't working label Oct 18, 2020
@dankamongmen dankamongmen added this to the 2.0.1 milestone Oct 18, 2020
@dankamongmen
Copy link
Owner Author

CelesF

@dankamongmen
Copy link
Owner Author

What's odd is that we don't see this cruft when displaying directly with notcurses-view.

@dankamongmen
Copy link
Owner Author

To tighten in and expand, look at the upperleftmost part of the quadblitted picture at the top. There's a repeated dark blue portion in which we have becrufted some white. The top row of Celes's sprite renders as:

▀▀▟▟▀▙▟▌

the first two cells are both being rendered as U+2580 UPPER HALF BLOCK with the proper dark blue background, but white foreground. The foreground ought also be dark blue, or better yet this ought be rendered as a space with a dark blue background.

To the left and right of the top row of Celes, we have the repeating pattern

▀▀▌▀▙▀▟▌, ▀▀▌▀▙▀▟▌

So it looks like we're probably not crapping a glyph onto this upperleft cell (the underlying world map renders a U+2580 by itself), but we're setting the foreground to white. Interestingly, if we use NCVISUAL_OPTION_BLEND, we get the exact same pattern, but with kind of an off-grey instead of white.

Save the cheerleader, save the world. Focus on this cell.

(I'm also interested in why quadblitter is rendering this as an upper block rather than a space. Are the two colors actually different? Space would be more efficient).

@dankamongmen
Copy link
Owner Author

Work in #1067 has slightly improved the situation, and adds evidence to this investigation. Correctly emitting the efficient space in the quadblitter has resolved the upperleft corner, which is completely transparent in the Celes image. Where the underlying plane (the world map) is not emitting a space, however, we're still leaving cruft. Let us now focus on the lowerleft corner. We're rendering:

▀▌▜▛▜▛▀▛

the world map here is:

▀▌ ▀▛

the Celes sprite here is:

▜▛▜▛

So the lowermost row of Celes has two transparent cells at the beginning. The underlying map has an UPPER HALF and a LEFT HALF. The UPPER and LEFT parts are being painted with a white foreground, but the correct background. So I'm guessing that when we write a NUL glyph for transparency, we're not setting the foreground transparent?

@dankamongmen
Copy link
Owner Author

Yep, that got it! Yay! We now look perfect.

2020-10-18-173225_722x857_scrot

@dankamongmen
Copy link
Owner Author

Welll...almost perfect. Look at Celes's upper right. We seem to be inserting a light blue top half (above the black bottom half) where it ought be dark blue, no? But this is much better.

@dankamongmen
Copy link
Owner Author

It's easy to see here, and I notice a trend: we seem to be using the most recent back or foreground where we shouldn't be. Here, it's green, whereas above, it's light blue.

2020-10-18-181954_722x1417_scrot

@dankamongmen
Copy link
Owner Author

The issue shown above is due to #1068, which is a sufficiently different (and deep) issue that I've made its own bug. This quadblitter problem is resolved.

@dankamongmen dankamongmen modified the milestones: 2.0.1, 2.1.0 Oct 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant