I’m trying to write a custom RenderPass method which will allow me to render the same scene but with different materials. My method works, however there is a strange bug that is happening as a result of some shared state between multiple instances of the RenderPass.
My guess is that my instances of RenderPass are writing to the same buffer, which is getting overwritten on subsequent instances of the RenderPass.
I tried to change the RenderPass code where it sets the readBuffer for the renderTarget, but it seems by changing this just breaks the EffectsComposer chain entirely, and now I’m stumped!
Is there any way to make a custom RenderPass that renders to its own buffer, but which is still recognized by Effects Composer?
Here is my code:
https://gist.github.com/samhains/2a2816f289e45d5673e23c489aacb3a5