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

Implement easy way to modify the underlying SpriteList glsl program. #1872

Open
DragonMoffon opened this issue Aug 10, 2023 · 2 comments
Open
Milestone

Comments

@DragonMoffon
Copy link
Contributor

Currently, there is no easy way of subtly changing how SpriteLists render sprites. I propose we add new functionality that doesn't break backward compatibility.

There are two main reasons that it is difficult to override SpriteList's drawing functionality. Firstly the SpriteList offers methods for every value that it passes to the GPU, but if you want to add new ones, or remove any already provided you essentially cannot do this. This is because the assigning of values to the buffers is hard coded. Secondly, there is no easy access to the program for setting uniforms

There are many examples of special sprites that basically require a total rewrite of the SpriteList class for very little changes.

  • Billboarded Sprites (always face the camera no matter the orientation).
  • Emissive Sprites (Sprites which write to an extra buffer for glow effects).
  • Lights (They can be implemented using the Sprite interface with a few small tweaks)
  • Multi-Texture Sprites / Colour-Mask Sprites (Sprites which need two or more textures, or only want certain parts of their color changed e.g. Sprites with Team colors or Paintjobs )
  • etc. etc. etc.
@pushfoo
Copy link
Member

pushfoo commented Aug 10, 2023

How much does our shader code rely on pyglet's?

@DragonMoffon
Copy link
Contributor Author

@pushfoo Not at all? The only issue between Arcade and Pyglet is that they share a UBO for the camera matrices, so you can't override the GL UBO slot 1, but even without pyglet that would be true. Secondly, arcade and pyglet conflict slightly regarding blending modes, but this could fix that.

@einarf einarf added this to the Future milestone Jan 16, 2024
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

3 participants