-
Notifications
You must be signed in to change notification settings - Fork 160
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
Hardware accelerated DynamicSprite #2059
Comments
The idea about accelerated dynamic sprite is to make it a "operation batch", where the operations are stored as a list of commands and performed at the render stage, instead of being applied immediately to pixels. In other words, when you call This implies that graphics driver interface should be expanded, instead of having just DrawSprite, it should have an interface of a draw command (or "operation") items and lists. An example of this may be found in SDL2's Renderer code, I believe (I might find this again later). Somewhat on the downside there's a case where you want to access DynamicSprite's surface to get pixels. In this case, it's likely that all the saved operations will have to be performed right away. This task should not be rushed, and requires a good task list.
|
Uhm, the way you propose is very different than what I had in mind, but with what you propose, I think the hardest thing but that can be useful would be having a command for the text drawing (thinking about drawing text in screen resolution). Ah, dear imgui has a command system too, with compatibility with lots of different renderers, perhaps something to look into. |
Right, this may be done in two major stages: 1. Stage one: DynamicSprite transformations.
2. Stage two: accelerated DrawingSurface.
These stages may of course be documented as separate tickets. |
Describe the problem
Dynamic sprites are currently manipulated in software mode only, writing an implementation for 3D renderers too might enhance rendering perfomance and make further expansion of its API with new effects more interesting. But this may also require adjusting a way of how sprites are refered to and handled in the engine.
Suggested change
Looking at the ScriptAPI for Dynamic Sprites, the Crop, Resize, Rotate and Tint are things that can make sense either by applying it to all pixels and actually modifying the pixel data (the surface) or through a transformation matrix or some graphics renderer command (for Tint).
There is an issue that once these are done through transformation, then operating the pixel data for these will require an API for it (DrawingSurface?), and that this change is not backwards compatible (ags4?). Or perhaps some parameter would specify if the change is in the data or in the containers (
eSurface
,eAccelerated
oreDestructible
,eNondestructible
).This will create an additional hierarchy/abstraction for the Sprites, and maybe an additional relationship between character, object sprite transformation on top of this additional transformation.
We may also back-out of this if we decided is not needed, overall there was no ticket for it reference in #1298 , so I just wanted to open one. I also wondered if #969 was related to this.
additional context
The text was updated successfully, but these errors were encountered: