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

Examples: force background color on ascii example. #19352

Merged
merged 1 commit into from May 13, 2020

Conversation

sciecode
Copy link
Contributor

This is intended to fix a wrong behavior that happens on iOS.

If you don't set a background color, the background is assumed entirely white. Which leads to the wrong result. As followed:

The reason why this happens is a combination of iOS not handling alpha: false as expected and the following check inside AsciiEffect

if ( iAlpha == 0 ) {
// should calculate alpha instead, but quick hack :)
//fBrightness *= (iAlpha / 255);
fBrightness = 1;
}

@zz85 I know it's been a long time since you made this, but do you recall why that check is necessary? It's not immediately obvious to me. I would think that multiplying brightness by the alpha value would be correct here.

This follows @mrdoob recommendation of just filing the minimal friction fix for this, which doesn't change AsciiEffect directly.

@mrdoob mrdoob added this to the r117 milestone May 13, 2020
@mrdoob mrdoob merged commit 8d7d679 into mrdoob:dev May 13, 2020
@mrdoob
Copy link
Owner

mrdoob commented May 13, 2020

Thanks!

@sciecode sciecode deleted the dev-ascii-background branch May 13, 2020 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants