FlxHotReloadShader?
Now that #399 was added, how hard would it be tie a shader to its original .frag asset, and check for changes to create a new shader instance and update utilizing sprites?
This would only exist on debug
That would be a kinda hard task to do. I am not a pro at how shaders works in OpenFL, but that would require to reload and recompile the shader program frequently.
I'd recommend just letting the developers doing their own way on reloading shaders, by having 2 variables that should be set to both fragment/vertex source file path, and a reload function that reloads and recompile the shader program.
That would be a kinda hard task to do. I am not a pro at how shaders works in OpenFL, but that would require to reload and recompile the shader program frequently.
the bulk of that work is done due to FlxRuntimeShader, also:
- the frequency to me is not an issue, it's whenever you save the .frag file, not everytime you type into whatever editor you're using
- My intended purpose for this is debugging, where any performance issues of switching shaders constantly is traded off for the convenience of rapid prototyping.
I do think there's plenty of ways to approach this, I plan on making my own, and if it seems generic and useful enough than its worth considering adding it to flixel-addons. otherwise it can be listed in External Tools
Lime has a FileWatcher class (https://github.com/openfl/lime/blob/develop/src/lime/system/FileWatcher.hx), which could be of use for this