Skip to content

[BUG] renderTexture->saveToFile() bugged for image alpha values, wrong output  #18980

@Anywhere-Music-Player

Description

@Anywhere-Music-Player

This issue was reported a long time ago: #18193

Still NOT fixed. ClippingNodeor not whatever: just renderTexture->saveToFile works wrong with any graphics: layers, gradients and sprites.
I have on my scene a LayerGradient and after render it's colors gets changed, dramatically. It's renderTexture output renders wrong image.

Just take examples from this my comment: #18193 (comment).
As you can see - Spriteand LayerGradient are differently rendered on output image!
This is currently same bug for cocos2d-x v3.17.

I can't simply create a screen-shoot of the scene!

RenderTexture *render = RenderTexture::create(WS.width, WS.height);
render->begin();
this->visit();
render->end();
render->saveToFile("render.png");

This code renders me a very different image of what I see. Please help!

@minggo @drelaptop @walzer

upd.: also, setBlendFunc(BlendFunc::DISABLE);works ONLY for render->getSprite() - Sprite object, but when I just do render->saveToFile- it's looks like ignored.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions