Skip to content

Conversation

@drelaptop
Copy link
Contributor

allow set premultiplied value manually, this will solve render texture grey border

issues like this:

image

  • render a white label in white layer to render texture, but grey border appears
  • set premultiplied value to true fixed it, after that render texture become to whole white.

@drelaptop
Copy link
Contributor Author

drelaptop commented May 21, 2019

this PR related with #16113 partly, but now fix saveToFile grey border issue. @PatriceJiang

@PatriceJiang PatriceJiang added this to the next milestone May 22, 2019
@minggo
Copy link
Contributor

minggo commented May 24, 2019

premultiplied flag is used to set blend function, i don't think it is a good idea to set it directly in texture2d

@drelaptop
Copy link
Contributor Author

or manually do like:

auto texture = renderTexture->getSprite()->getTexture();
auto sprite = Sprite::createWithTexture(texture);
sprite->setBlendFunc(BlendFunc::ALPHA_PREMULTIPLIED); //need to do this!

it's so internal, much hard to find it out.

@minggo
Copy link
Contributor

minggo commented May 27, 2019

Yep, the design of premultiplied is not good, but it is hard to change it now.

@minggo
Copy link
Contributor

minggo commented Jun 5, 2019

close this one as #19782 is merged

@minggo minggo closed this Jun 5, 2019
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.

3 participants