I have two passes, set up with FilterManager and TextureBuffers.
I have a manual mainloop calling taskMgr.step().
In this loop, I have a variable increasing every frame.
That variable I use to set the texture buffer to False in the first loop, to stop the first pass shader from shading.
I get a performance increase as expected, but!
When I deactivate BOTH passes the image STILL renders. It renders faster, but it shouldn’t render at all?
When I change the vec3 Camera in python and pass it to the shaders, the Camera moves as if the shaders were still running. I would expect that, when I deactivate the shaders, the viewport can’t change due to the shaders not drawing anymore.
After some more testing I believe this isn’t actually working at all.
When I put all calculations into the first shader and then deactivate it using setActive, then having the second shader outputting the texture shouldn’t take any more time at all. Yet, while there’s some gain, it seems the first shader is actually still running.
And as mentioned above, even if I setActive(False) to BOTH shaders, while there is some performance gain, both shaders definitely are still active.
How do I fix this mess?
How do I learn how to do it right?
I think some code would be helpful, else it’s hard to say what’s going on.
Setting the config variable ‘show-buffers true’ will show you the content of the buffers on screen, maybe that will help debugging?
I don’t have a module named ‘FSMP’ and google only point me to “Food for Special Medical Purpose” and somehow I don’t think that’s it. I suppose the functions makeBuffer, makeTexture, makeNewQuad and makeFinalQuad are in there.
I’ve never used a setup where you run taskMgr.step() manually, but at a glance I don’t see anything obviously wrong with your code
Can it be that you’re turning off the buffers you get the textures from (?) and the buffers created by the FilterManager when you call renderSceneInto is still working and rendering?
I don’t think there’s a convenient way to to get the right buffer from the FilterManager so after calling
quad = ShaderManager.renderQuadInto(colortex=texture) get the buffer like this buffer=ShaderManager.buffers[-1]