flixel icon indicating copy to clipboard operation
flixel copied to clipboard

Simplify FlxGraphicShader

Open Geokureli opened this issue 11 months ago • 5 comments

Addition to https://github.com/HaxeFlixel/flixel/pull/3326

Another attempt at the other part of https://github.com/HaxeFlixel/flixel/pull/3321

Simplifies FlxGraphicsShader and removes ifs for mix calls. Let's hope that's a good thing

To Dos

  • [ ] See if thats a good thing
  • [ ] Figure out how to profile shaders
  • [ ] Learn more about shader attributes and flixel's batch rendering

Geokureli avatar Dec 30 '24 15:12 Geokureli

gonna shelf this until I learn why hasTransform is being set to false, in renaine

Geokureli avatar Jan 02 '25 15:01 Geokureli

Why change if statements to mix?

Raltyro avatar May 04 '25 02:05 Raltyro

Why change if statements to mix?

If statements should be avoided in GPUs, wherever possible. Here's an explanation: https://stackoverflow.com/questions/37827216/do-conditional-statements-slow-down-shaders/37837060#37837060

Geokureli avatar May 06 '25 12:05 Geokureli

Any plan to do this the same to openfl GraphicsShader too?

Raltyro avatar May 06 '25 14:05 Raltyro

Any plan to do this the same to openfl GraphicsShader too?

None of this will happen if I don't find a good way to profile these changes. As for openfl, I dunno, the gains here are pretty small, and changing it wont impact us all that much as we already overwrite theirs in the extended class

Geokureli avatar May 06 '25 17:05 Geokureli