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

With stencil strokes enabled, strokewidth = 1. is invisible on non-retina screen #14

Open
olilarkin opened this issue Mar 24, 2019 · 12 comments

Comments

@olilarkin
Copy link
Contributor

This didn't used to be the case. Here is a test project demonstrating the problem:

https://github.com/olilarkin/TestNVGMetal/blob/master/TestNVGMetal/Renderer.m#L13

@olliwang
Copy link
Member

Is it visible on a retina screen?

@olilarkin
Copy link
Contributor Author

yes

@olilarkin
Copy link
Contributor Author

Screen Shot 2019-03-24 at 21 08 07

this is how the Moui demo looks on non-retina if i enable stencil strokes

@olilarkin
Copy link
Contributor Author

I believe on retina screen the strokes are also thinner than they should be

@olliwang
Copy link
Member

olliwang commented Mar 28, 2019

@olilarkin Are you using macOS older than 10.14? I saw the same effect on my old MacBook Air with macOS 10.13.x installed. However, the issue is gone after I upgraded the macOS to Mojave (10.14). But Mojave introduces other new weird effects on my old MacBook Air. WIll investigate into it later.

@olilarkin
Copy link
Contributor Author

yes. this is on 10.13

@olliwang
Copy link
Member

olliwang commented Mar 28, 2019

So that's the issue only happened on 10.13. Unfortunately, all of my mac devices are upgraded to 10.14. You will need to fix it by yourself if you want to run it on 10.13.

I also found that there is a problem when resizing window on 10.13 and the issue is gone on 10.14.

@olliwang
Copy link
Member

@olilarkin It seems that commenting out this line would fix the issue:

[mtl.renderEncoder setRenderPipelineState:mtl.stencilOnlyPipelineState];

Can you test it in your real project to check if there is any side effect?

@olilarkin
Copy link
Contributor Author

i'm away from my non-retina screen at the moment, but i can test next week

@olliwang
Copy link
Member

Sure. Please test your real project on both retina and non-retina screens. :)

@olilarkin
Copy link
Contributor Author

Good work :-) it fixes the problem. My project and Moui NanoVG demo look fine on both screens now

@olliwang
Copy link
Member

olliwang commented Apr 3, 2019

@olilarkin Thanks for reporting. I just found that the transparency is gone for this solution. We'll need another solution. :(

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