Skip to content
This repository was archived by the owner on Mar 15, 2025. It is now read-only.

Implement SpriteSystem. #24

Open
Possseidon opened this issue Mar 3, 2021 · 0 comments
Open

Implement SpriteSystem. #24

Possseidon opened this issue Mar 3, 2021 · 0 comments
Assignees
Labels
dang-gl enhancement New feature or request

Comments

@Possseidon
Copy link
Owner

Possseidon commented Mar 3, 2021

Implement SpriteSystem.

  • TODO: Add support for a scissor test of sorts.
    • Think Scrollbox in a GUI or even just a textbox with left/right scrolling.
    • Possibly have a smooth transition on the border.
  • TODO: Properties with animation support.
    • Scripting is okay for setting values directly.
    • ... but animations should be smooth and efficient.
    • Create some new Property class in dang-utils or similar.
  • TODO: Elaborate on this in general.

Shader Layout

  • Positioned freely on XY.
  • Z for ordering.
    • Any translucent sprites must be sorted and rendered back to front.
    • Opaque/transparent sprites can theoretically be rendered AFTER in arbitrary order.
    • However, then the order for same Z is not consistent.
    • Instead sort all and keep using the add-order by using stable sorting.
    • Maybe improve on this in some way in the future...
  • Tinting.
  • Texture.
    • Two textures for fading.
    • Texture opacity, which can be 0 to disable texture lookup entirely.
    • Texture opacity is NOT applied to alpha, as this would not make much sense.

Shader Attributes

From the list above, these attributes are going to be required for a sprite shader:

  • vec3 pos;
  • vec4 tint;
  • vec2 texcoord1;
  • vec2 texcoord2;
  • float texture_fade;
  • float texture_opacity;
@Possseidon Possseidon added enhancement New feature or request dang-gl labels Mar 3, 2021
@Possseidon Possseidon self-assigned this Mar 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
dang-gl enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant