View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
---|---|---|---|---|---|---|---|---|---|
0006418 | Spring engine | General | public | 2020-08-20 22:19 | 2021-01-01 20:25 | ||||
Reporter | MaDDoX | ||||||||
Assigned To | |||||||||
Priority | high | Severity | feature | Reproducibility | always | ||||
Status | closed | Resolution | open | ||||||
Product Version | 104.0 +git | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0006418: Ability to replace CEG's texture and shader in run-time | ||||||||
Description | We need the ability to replace the CEG's texture and shader in run-time, so it's possible to do advanced spritesheet-based particle effects like this: https://opengameart.org/content/explosion Right now you can only replace the texture before Spring is launched. | ||||||||
Steps To Reproduce | 1. Spawn a CEG 2. Try to replace its texture and/or shader along time 3. No API support for that | ||||||||
Tags | No tags attached. | ||||||||
Checked infolog.txt for Errors | Irrelevant | ||||||||
Attached Files |
|
![]() |
|
IceXuick (reporter) 2020-08-20 22:34 |
Yes, this could be game-changer for effects and also can result in less needed particles/cegs for same effect. Though this will only work well if random rotation/positioning would be added as well. Like the CBitmapMuzzleFlame can be, only with the extra movement parameters of the CSimpleParticleSystem. Actually BOTH should get rotation params. |
MaDDoX (reporter) 2020-08-21 00:24 |
@IceXuick Exactly, I've described that other need here to keep it separate: https://springrts.com/mantis/view.php?id=6419 |
Google_Frog (reporter) 2020-08-21 15:11 |
This ticket seems to be much more general than your application. It looks like you would be happy with a spritesheet animation ceg tag or type. |
MaDDoX (reporter) 2020-08-21 23:03 |
@Google_Frog That would work, but would also be more work on the engine side I'd say. Having to set the amount of frames in the spritesheet, horizontally and vertically, plus padding if applicable - all of that is easy to do through lua and would make it way more flexible. |
Google_Frog (reporter) 2020-08-22 06:52 |
As far as I know lua cannot see individual ceg particles. What you're suggesting seems like it would require a lot of extra lua callins and callouts to manage ceg particles, and managing an animation from frame-to-frame with lua sounds terrible for performance. |
MaDDoX (reporter) 2020-08-25 09:24 |
@Google_Frog Doubtful, since it's a simple UV offset operation, which can be carried out through a shader. Ivand did something just like that for TAP's mex spot highlighter, and even with a large number of those quads there's no measurable performance loss (by disabling/re-enabling the widget). |
Google_Frog (reporter) 2020-08-28 14:35 |
Specifying a shader to run on a ceg sounds reasonable. However, why does it need to be changeable at runtime? If you want to do anything with changing cegs at runtime then I expect you to need a lot of extra lua callins to manage this, because as far as I know lua has basically no interaction with cegs at the moment (besides being able to spawn them). |
MaDDoX (reporter) 2020-08-30 03:12 |
@Google_Frog You're most probably right that a shader running on a CEG would fill in that gap, since like I mentioned the actual texture replacement we're using now is done through a shader. What do you think @ivand? |
lhog (reporter) 2020-08-30 04:44 |
Adding animated sprites is more complicated than just adding support for the shader: CEG textures are tiled in a big atlas upon the engine initialization, so even with recently extended atlas size, it(atlas) is going to fill up very quickly by the animated subtextures, so at the very least atlas should be reworked into a texture array. Secondly, only a very simple shader can run without setting some external shader defined state (called uniforms), that often change within or across draw frame. Making CEGs support shaders probably requires high performance framework to define and update such uniforms. Finally and most importantly, we first need to get devs a blessing to include such functionality into the maintenance. Last time I tried much much smaller patch to soften particle edges, it was rejected. |
abma (administrator) 2021-01-01 20:25 |
105.0 released: the maintenance branch is discontinued/obsolete. |
![]() |
|||
Date Modified | Username | Field | Change |
---|---|---|---|
2020-08-20 22:19 | MaDDoX | New Issue | |
2020-08-20 22:34 | IceXuick | Note Added: 0020517 | |
2020-08-21 00:24 | MaDDoX | Note Added: 0020519 | |
2020-08-21 15:11 | Google_Frog | Note Added: 0020520 | |
2020-08-21 23:03 | MaDDoX | Note Added: 0020522 | |
2020-08-22 06:52 | Google_Frog | Note Added: 0020523 | |
2020-08-25 09:24 | MaDDoX | Note Added: 0020524 | |
2020-08-28 14:35 | Google_Frog | Note Added: 0020526 | |
2020-08-30 03:12 | MaDDoX | Note Added: 0020528 | |
2020-08-30 04:44 | lhog | Note Added: 0020529 | |
2021-01-01 20:25 | abma | Note Added: 0020554 | |
2021-01-01 20:25 | abma | Status | new => closed |