dimforge / dimforge/kiss3d

add a "SpriteGroup" to reduce a number of "draw" calls

Open
#173 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.8k
Forks
194
Avg merge
1d 14h
Merged PRs (30d)
2

Description

When drawing a lot of sprites that have the same texture a lot of draw calls are issued which slows down the rendering of a frame. A workaround is to create a mesh with a lot of rectangles that is drawn in a single draw call.
I am not sure how we make this play well with current hierarchical nodes api, so the sprites are "children" of a PlanarSceneNode, so maybe separate creation of a SpriteGroup and then "add_sprite_group" to a PlanarSceneNode. Maybe it makes sense to start developing this as a separate crate, that provides SpriteGroup as a "PlanarSceneObject" and merge it in when it is ready and it makes sense to do so.
Best naming variant, should this be "SpriteGroup", "SpriteBatch" or something else is not quite clear as well.

References: https://docs.rs/ggez/0.4.1/ggez/graphics/spritebatch/struct.SpriteBatch.html

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the current PlanarSceneNode and PlanarSceneObject APIs to understand how hierarchical children are represented. Compare the proposed design with ggez's SpriteBatch reference, then determine whether SpriteGroup belongs in a separate crate or the existing API. Done means a settled name and design for batching same-texture sprites without breaking the node hierarchy.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.