Skip to content

wg_engine: invisible effects #3762

@hermet

Description

@hermet

The WGPU engine has fundamental issues with handling moving effects in the scene graph. It seems like the screen coordinating problem.

It should be shown like this:
Image

wgpu doesn't show anything.

struct UserExample : tvgexam::Example
{
    Scene* model;
    Point pos;

    bool content(Canvas* canvas, uint32_t w, uint32_t h) override
    {
        auto shape = Shape::gen();
        shape->appendCircle(0, 0, 100, 100);
        shape->fill(255, 255, 255, 127);
        shape->strokeWidth(8.0f);
        shape->strokeFill(200, 200, 255);

        model = Scene::gen();
        model->push(shape);
        model->translate(pos.x, pos.y);
        model->scale(0.5f);
        canvas->push(model);

        pos = {float(w) * 0.5f, float(h) * 0.5f};

        return true;
    }

    bool update(Canvas* canvas, uint32_t elapsed) override
    {
        model->push(SceneEffect::ClearAll);
        model->push(SceneEffect::DropShadow, 200, 200, 255, 255, 0.0f, 10.0f, 15.0f, 30);
        pos.y -= 0.1f;
        model->translate(pos.x, pos.y);
        canvas->update();
        return true;
    }

};

Metadata

Metadata

Labels

bugSomething isn't workingglOpenGL/WebGL render backendwebgpuWebGPU render backend

Type

No type

Projects

Status

Done 1.0

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions