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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

SpriteBatch, FilterMode and src/offset #10

Merged
merged 1 commit into from
Jun 7, 2019
Merged

Conversation

maciejhirsz
Copy link
Contributor

@maciejhirsz maciejhirsz commented Jun 6, 2019

Added couple of things:

  • SpriteBatch compatible with ggez. It's working, although it's actually not batching anything, so room for improvement here!
  • FilterMode for Image via set_filter. Works as intended, although I'm not particularly fond of having to use a dirty boolean flag, so this also can be done better.
  • The src on DrawParam actually works now. I'd appreciate if someone actually looked at what I did here as this was first time in my life I touched GLSL :P.
  • Fixed scale and offset on DrawParam.

I hope I haven't broken anything in Zemeroth with this 馃槄. I've uploaded a demo video of what I'm building, all sprite animations and font rendering is done via atlases, so src not working broke things horribly.

@not-fl3 not-fl3 merged commit 0b66d91 into ggez:master Jun 7, 2019
@not-fl3
Copy link
Collaborator

not-fl3 commented Jun 7, 2019

Wow, happy to see good-web-game actually used in another project!
And thank you very much for the great PR!

Can confirm that it did not break Zemeroth 馃憤

I don't have any quick fixes to avoid the dirty flag right now. I think it should should be possible to use webgl's set_filter just in the image's set_filter immediately. I see the texture binding problem leaded to the dirty flag, but I am considering this as a good-web-game's issue that should be fixed somehow.
Going to try a few things soon - maybe introduce some internal dirty flag to force rebind cached uniforms? Not sure yet.

@maciejhirsz
Copy link
Contributor Author

Caching uniforms would help a bit, though for me biggest win in FPS would definitely come form sprite batching, I'll make an issue for that.

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

Successfully merging this pull request may close these issues.

None yet

2 participants