Is it possible to define a function and call the same function from several passes?
My problem is as follows:
I have a specialized shader, blending a big series of textures together, according to some rules and calculations. As a single pass is limitted to 16 texture interpolators, I have to distribute stuff over several passes. However, underlying calculations are always the same, only dependent on uv and uniforms and could be extracted to a function. Now I want to avoid to copy-paste the same code fragment over and over to keep things maintainable.
Sounds wierd, but it’s a research project… ![]()