Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Shader system improvements (redo) #2715

Closed

Conversation

EliteMasterEric
Copy link
Contributor

An update of #2577 which removes extraneous changes and updates the target branch to 9.4.0-Dev.

Provides the following changes:

  • Store the original values for the fragment/vertex header such that they can be accessed by child classes.
  • Store the original values for the fragment/vertex body such that they can be accessed by child classes.
  • Store the original values for the fragment/vertex source such that they can be accessed by child classes.
  • Added a configurable glVersion annotation (and corresponding variables) which can be used to modify the GLSL version directive. The default value has been set to 120, which should resolve an issue on some platforms where the uniform type is unavailable.
  • Added checks to __processGLData to ensure a variable exists before it is assigned via Reflection.
    • This resolves an issue caused by custom implementation of variables in child classes.
    • Added caching to the field check to reduce calls to Reflect.fields, improving performance.

These changes were performed to support fixes for FlxRuntimeShader, as part of pull requests HaxeFlixel/flixel-addons#368 and HaxeFlixel/flixel-addons#399. Making changes here prevents code duplication in FlxRuntimeShader, improving maintainability.

These changes have been tested with Friday Night Funkin', where it is used on Windows, MacOS, Linux, and HTML5 platforms.

@EliteMasterEric
Copy link
Contributor Author

@Geokureli Let me know if you have any other syntax changes to make, I implemented the ones you suggested.

@joshtynjala joshtynjala deleted the branch openfl:9.4.0-Dev July 22, 2024 17:02
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants