Skip to content

sw_engine: effect + clipping doesn't properly applied #3125

@hermet

Description

@hermet
  1. blurred image without clipping:
        auto scene = tvg::Scene::gen();

        auto shape1 = tvg::Shape::gen();
        shape1->appendRect(100, 100, 600, 600);
        shape1->fill(255, 0, 255, 160);
        scene->push(shape1);
        scene->push(tvg::SceneEffect::GaussianBlur, 450.0f, 0, 0, 10);

        canvas->push(scene);

result:
Zrzut ekranu 2025-01-13 o 16 20 34

  1. I want to clip this blurred image:
        auto scene = tvg::Scene::gen();

        auto shape1 = tvg::Shape::gen();
        shape1->appendRect(100, 100, 600, 600);
        shape1->fill(255, 0, 255, 160);
        scene->push(shape1);

        auto clipShape = tvg::Shape::gen();
        clipShape->appendRect(100, 100, 100, 100);
        scene->clip(clipShape);

        scene->push(tvg::SceneEffect::GaussianBlur, 50.0f, 0, 0, 10);

        canvas->push(scene);

result:

Zrzut ekranu 2025-01-13 o 16 25 10
  1. this is what I'd expect:
Zrzut ekranu 2025-01-13 o 16 25 10

I don't see how to achieve this effect in TVG. Am I missing something?

Originally posted by @mgrudzinska in #2893 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingrendererCore rendering

    Type

    No type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions