Simplify FlxGraphicShader
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
gonna shelf this until I learn why hasTransform is being set to false, in renaine
Why change if statements to mix?
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
Any plan to do this the same to openfl GraphicsShader too?
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