Jump to content

Antialiased circles and rounded rectangles?


d13
 Share

Recommended Posts

Hi Everyone!

I have an odd problem (in v5) where setting `antialias: true` works with sprites, text and rectangular graphics, but not sprites containing Pixi-created graphics with rounded edges (such as circles and rounded rectangles.)

Has anyone seen this problem before or understand what I'm describing? (Sorry, I would upload an image of what I'm seeing but the board won't let me upload files for some reason.)

 

Thanks!

Rex

 

Link to comment
Share on other sites

antialias cant work on extra framebuffers, such as RenderTexture, only on main one. Several ways to fix it

1. generate textures of bigger resolution and convert them to resolution=1 afterwards.

2. generateCanvasTexture() exists only in pixi-legacy.js ,  https://github.com/pixijs/pixi.js/releases/tag/v5.1.5 - just take the file with canvas2d support.

3. wait when I make PR for MSAA framebuffers in webgl2. wont work in webgl1.

4. New way, was discovered not so long ago: render it in separate canvas, with another webglrenderer and use Texture.from() on it, then draw part of those contexts to a new renderTexture. Its as fast as MSAA variant but it'll work in webgl1 too, basically its the same as blitFramebuffer. One extra problem - Texture.from(anotherCanvas) will have to be updated (texture.update()) every time you draw something new on temporary webgl canvas.

Summary: its old problem that has no easy automatic solution for all existance of webgl. We slowly crawling to solve it but its still there.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...