Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jagged edges (aliasing) on graphics objects #33

Open
jazzyjeff5 opened this issue Oct 26, 2018 · 4 comments
Open

Jagged edges (aliasing) on graphics objects #33

jazzyjeff5 opened this issue Oct 26, 2018 · 4 comments

Comments

@jazzyjeff5
Copy link

https://i.imgur.com/wvEmB1N.jpg

I'm using PIXI.Graphics to draw basic shapes. I'm drawing them twice, once in the correct color and then adding that to PIXI.lights.diffuseGroup, and then again in color 0x7f7fff to create a flat normal, and then adding that to PIXI.lights.normalGroup. First of all is this the correct way to get flat, colored shapes rendering?

Second, see the image I've linked above, the shapes are badly aliased. This goes away when I render the scene normally without pixi-lights. Is there any way to fix this? Thanks!

@ivanpopelyshev
Copy link
Contributor

We need MSAA framebuffers to fix that, they exist only in webgl2

@jazzyjeff5
Copy link
Author

Shame, are there any workarounds available? Unfortunately this may be a dealbreaker for my project :(

@ivanpopelyshev
Copy link
Contributor

ivanpopelyshev commented Oct 26, 2018

Graphics has method generateCanvasTexture() . If you dont change that figure in runtime you may use sprites with generated textures instead. Dont forget to use getLocalBounds to know the offset for a sprite, calculate anchor based on it.

@jazzyjeff5
Copy link
Author

Interesting, I wont be changing the shape itself but I will be rotating and translating it, is that ok?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants