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

IMDraw is unaffected by SetSmooth or MSAA #263

Open
NabeelAhmed1721 opened this issue Oct 24, 2020 · 5 comments
Open

IMDraw is unaffected by SetSmooth or MSAA #263

NabeelAhmed1721 opened this issue Oct 24, 2020 · 5 comments

Comments

@NabeelAhmed1721
Copy link

  • Is there a reason why IMDraw shapes tend to have jagged edges?
  • Is there a way to solve this?

win.SetSmooth(true) doesn't seem to work.

Example:

Screen Shot 2020-10-24 at 2 11 41 PM

@dusk125
Copy link
Collaborator

dusk125 commented Jun 22, 2021

Looking through the canvas code, I'm not sure if SetSmooth would have an effect on this... this might be fixed with #285 however, but I would have to test it.
If you want to try, you can clone a PR using git fetch origin pull/285/HEAD; git checkout -b antialias FETCH_HEAD.

@trisub
Copy link

trisub commented Apr 17, 2022

May I ask if there is an update on this issue?

@cebarks
Copy link
Collaborator

cebarks commented Apr 18, 2022

My assumption is that this is the correct behavior. This is most likely caused by the resolution of your window and not caused. Is this problem still present even after #285 was merged @trisub

@trisub
Copy link

trisub commented Apr 18, 2022

I just checked with pixel v0.11.0-beta and it doesn't seem to make a difference. When I draw polygons or circles (on an IMDraw) there is no antialias at all which looks kinda ugly. I tried with window.SetSmooth(true) and also by setting the property SampleMSAA on the WindowConfig struct itself to different values. Sadly, both without any effect on the shapes.

However, I when draw to an intermediary canvas and do some matrix transformations (other than just translating, i.e. rotating or scaling) and then draw that canvas to the window, there is some antialiasing (when using window.SetSmooth(true)). So I could essentially draw my shapes slightly bigger and then just scale them down to get the same shape but with antialiasing. This workaround is kinda ugly though. Maybe I could look into shaders? Still, I would love if it worked automatically (without even having to set up an intermediary canvas).

@cebarks
Copy link
Collaborator

cebarks commented Apr 18, 2022

Shaders or an intermediary is your best bet I think

@cebarks cebarks changed the title IMDraw smoothness IMDraw is unaffected by SetSmooth or MSAA Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants