Skip to content

Canvases and multisampling #57

@PSteinhaus

Description

@PSteinhaus

Ok, this is the most annoying bug for me in ggez currently.
I thought good-web-game just wouldn't have it, but it turns out I was wrong.

In ggez 0.6 trying to create a Canvas with a NumSamples count other than 1 leads to this bug: ggez/ggez#695

If we stick to 1 things work out ok, but as soon as multisampling is activated globally the canvas starts to get drawn slightly blurry. This effect increases with multisampling level.

Now the sad thing is: good-web-game currently has the same bug. To recreate try the 03_drawing example, set multisampling to 16 (uncomment a line in the boilerplate) and press a button to switch between drawing onto the screen directly and drawing onto the offscreen canvas, which is then drawn onto the screen.

drawn directly:
no_canvas

drawn on canvas:
canvas

As you can see by looking at the white thing somewhat in the middle (which is drawn using a nearest neighbor filter) no MSAA has been applied when drawing it in the second case. The only reason it looks less jagged (but still wrong) is because the whole canvas was drawn somewhat blurry...

The good news is: This replicates the ggez behavior when using a Canvas with multisample count 1 perfectly, so we might fix it by somehow specifying that the framebuffer supplied by a canvas is supposed to have the same level of multisampling as the application. But, AFAIK, there is currently no feature present in miniquad to achieve this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions