fidget
fidget copied to clipboard
Multiple function outputs.
Currently my game engine requires multiple function outputs to correctly apply and blend between different materials. So far I have just done this my creating multiple functions for each output, and duplicating a bunch of code so that they all work together. While I don't understand fidgets internals, it makes sense intuitively to me that there could be multiple outputs for functions. This would reduce code duplication and also probably make things faster since there could be shared simplifications. On the other hand, you don't usually want all of the outputs to be calculated with the same inputs or the same number of times (I evaluate the distance function 216x more than the material id and blending functions), so you should be able to choose which outputs you want to actually evaluate code for...
I have no idea how you would go about implementing this, but you seem to be some sort of programming wizard capable of writing functions that optimize themselves at runtime so I wouldn't be surprised if you found a way. Anyhow I wouldn't prioritize it too much since I'm already emulating multiple function outputs without too much difficulty (and the speed improvements might even be negligible in my use case)