-
Notifications
You must be signed in to change notification settings - Fork 460
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
Flixel lacks of rendering optimisations #3364
Comments
This is just a vague aimless rant, I want real specific targets and goals. You mention:
If you wanna make actual proposals, they will be appreciated! It's also really important that you start with actual problems, not theoretical problems. Good example: This relatively simple code has perf issues when it (or similar systems) would perform well in other frameworks, the bottleneck seems to be in this code where it does [thing] when [better thing] is available Bad Example: Doing this would probably be faster, though I have no actual case of having to work around the current system due to performance issues, or if I do, I didn't look into why it was happening and how that would perform in my vaguely proposed system |
Sorry if I was rude or violent, it wasn't my intention at all. I just started this issue so we could discuss about potential solutions, because I personally experienced flixel struggling to keep stability when rendering a lot of objects (even when they have the same graphics, due to ordering, and only way to solve this is to write spaghetti code). HaxeUI is also a good example, flixel doesn't keep up well with huge and complex UIs, and often causes a lot of GC pressure. Note that I'm not a professional on low level rendering, I just thought packing automatically would be a viable solution even though I do agree it's not the most efficient method |
There's no problem I'm just telling you what type of conversations are helpful
Generalized stuff like this can be the basis that gets you started in looking for specific actionable changes and proposals, but on their own they just vague complaints |
This could refer to "Maturing the auto-batcher in the OpenGL renderer" in OpenFL9. I'm not very familiar with the rendering implementation in HaxeFlixel. Is it possible to take advantage of this rendering acceleration in OpenFL9? |
It's great having concrete examples like this, and something to strive for, but what comes next? How would Flixel need to change in order to prevent this? I tried making the quad renderer batch unlike colored sprites by using colored vertices but either I did something wrong or theres some limitation I'm not aware of.
This is kind of a blanket statement that really ignores a lot of the nuance in the role of a dev. Sure, if we find a one-size-fits-all solution that doesn't have side effects that slow down other situations, we should absolutely work towards implementing it. But we shouldn't implement an ad-hoc fix in the framework for this specific issue assuming that this is how everyone is using Flixel, especially when it's far easier to make an ad-hoc fix for the project, like you just did. It's Flixel's role to improve the framework but it will always be the devs role to work within the limitations given. We should never fully put that responsibility on one or the other |
Related to: #3354 |
Once again, this was just an example illustrating the underlying issue, I did say we could replace coloring with anything that breaks batching. I also don't see why mentioning #3354, it is not an issue entirely related to coloring.
Maybe, but is it really a choice when a lot of other frameworks performs much better because they have things Flixel lacks? Even OpenFL attemps to resolves these issues by:
Not only that, but I did mention implementing these ad-hoc fixes is not very joyful during production because of how it either results in messy code, or is extremely complicated to do for more complex environments.
Some ideas I did find around (although this doesn't imply I know how they work):
|
This seems like an entirely separate feature, unrelated to the problem at hand
sure, but how?
This would affect the draw order of overlapping sprites, inadvertently, so I don't see it as a valid framework solution. If anything we could make some new container type that does this by default
Are you saying this is something OpenFL has fixed in the next minor release, or something they've planned to implement in the future? Do you have a plan for what we would need to do to utilize it? |
I feel like I'm still being misunderstood here. I'm down to discuss broad strokes and help find a plan of action, but if you would like me to actually implement these suggestions I need a concrete, low-level, nitty-gritty, proposal of exactly how I would do this, not an abstract idea, which is all I've seen in this thread. Even then I'll need plenty of spare time to implement it and I would probably need to learn a lot more about rendering. If you want these things done faster, the best way is to just dive in and try making those changes yourself and report back with the results. For instance, if you think multi-texture batching is possible, implement it yourself in a branch and prove it. I lack the knowledge to implement that myself, I also failed to implement multi-color batching. |
Maybe you're right, it's just an extra thing we could do as well.
I have 2 potential solutions for this, although it still needs verification as I'm not too experienced in the domain of rendering. First solution would be to just pack graphics automatically at runtime, although I wonder how we could achieve this with an efficient manner. Perhaps this could maybe done at compile-time for already known graphics. Second solution, which I think OpenFL actually uses for it's tilemap multitexturing last time I've been told, is having a shader hold multiple
Not really. I did mention sprites with the same visual "layer".
but when rendering, we could render the 2 black sprites together, then the 2 red sprites, as doing so wouldn't break the visual order. Of course, the framework has to ensure it wouldn't cause visual disordering.
Yes, it is an upcoming improvement for the next OpenFL minor version release as far as I know
I'm not too sure... I was just mentioning one of OpenFL's practice, I didn't think this API could be used in flixel, and my intention wasn't to make flixel use it either.
Of course! I opened this issue so we could collectively think of solutions before jumping into it. I'm down to integrate some of these to flixel. |
I'd love to see automatic rendering optimisations implemented into Flixel.
Many other game frameworks and/or engines often implements mechanisms such as multi-texture batching which greatly improves performance overall, and draw things with the least amount of draw calls possible.
Making things such as UI is often complicated with flixel due to the fact it doesn't have any of those. While it will be functional, it doesn't run great most of the time.
I've heard flixel has
FlxAtlas
to pack multiple graphics into a single one. Is it possible for this process to be automatic? This would be a great improvement to the frameworkThe text was updated successfully, but these errors were encountered: