Skip to content

Simplify FlxGraphicShader #3327

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

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft

Conversation

Geokureli
Copy link
Member

@Geokureli Geokureli commented Dec 30, 2024

Addition to #3326

Another attempt at the other part of #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 Geokureli added this to the Next Patch milestone Dec 30, 2024
@Geokureli Geokureli changed the title Camera color Simplify FlxGraphicShader Dec 31, 2024
@Geokureli Geokureli marked this pull request as draft January 2, 2025 15:05
@Geokureli
Copy link
Member Author

Geokureli commented Jan 2, 2025

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

@Geokureli Geokureli modified the milestones: 6.1.0, 6.2.0 Apr 21, 2025
@Geokureli Geokureli modified the milestones: 6.2.0, 6.1.1 Apr 29, 2025
@Raltyro
Copy link

Raltyro commented May 4, 2025

Why change if statements to mix?

@Geokureli
Copy link
Member Author

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

@Raltyro
Copy link

Raltyro commented May 6, 2025

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

@Geokureli
Copy link
Member Author

Geokureli commented May 6, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants