I am trying to code a new feature in my engine but I can't find a way to implement my idea, which is the next one. I am trying to get multi pass rendering with more than two passes.
I know how to do a two pass rendering pipeline for effects like blurring and shadow mapping, but my problem is that now I want to make an undefined number of passes without having to have that number of different functions (a different one for every pass).
Do you have any ideas about what could I do here? I have thought about doing some kind of function pointer that is called x amount of times, each time calling to a different function, but again, I don't know what is the best (or the easiest) approach. Would love to hear your ideas and comments. Thanks!
PS, I am using openGL if that is useful information.