-
Notifications
You must be signed in to change notification settings - Fork 41
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
Fix for #29: Failed to compile vertex shader #30
base: master
Are you sure you want to change the base?
Conversation
Also added GetGlobalAlpha() to the Canvas to allow apps a way to set a new global alpha based on the existing global alpha.
Sorry this is taking a while, but unfortunately the change in the shader is now incompatible with my Android phone. Looks like I'm going to have to make the OpenGL version configurable somehow. |
No worries. On a side-note, I don't seem to be seeing any sort of anti-aliasing in any of the resulting graphics, so curves don't have a smooth appearance, etc. Is this expected or am I not configuring something correctly? |
That needs to be configured when setting up the OpenGL context. Looking at the code you wrote in the issue, I think you need to add |
Thanks, that fixed the lack of anti-aliasing. A few more questions, if you have the time (and if there is a better place to be asking these, please let me know and I'll shift to that):
|
Hmm, the color problem sounds strange. I just tried it, but for me the right color comes out. Sounds like maybe there's some color processing going on on the system. Gamma correction? Something with sRGB maybe? I'm afraid I don't really know. The performance difference certainly sounds bad. I hoped it wouldn't be that bad. Partly it depends on what you are doing though. Are you doing a lot of text? I'm pretty sure that could be a lot faster than it is currently. For shape drawing, using the NewPath2D instead of recreating a path every frame is much faster, so you can try that in case it applies. In general though the Quartz project is very likely to be much more optimized than my library... |
Quartz is Apple's standard drawing library, so I'm sure it is heavily optimized. This particular example has very little text and is more of a sample than anything real -- just strokes and fills of rectangles and lines, for the most part, although a few curves and a few short pieces of text are in the mix as well. Even a factor of 2x would probably work for what I'm doing... but 15-20x is certainly more than the app can afford. Unfortunate, as I was really hoping to use this library to eliminate the need to write custom drawing logic for every platform. |
This pulls in the changes @tfriedel6 suggested in the discussion in #29.
Also added GetGlobalAlpha() to the Canvas to allow apps a way to set a new global alpha based on the existing global alpha.