Combined camera offscreen buffer?

Hi, I got two cameras rendering the same scene, one renders objects texture colored and the other renders vertex colored object. Applying the automated bloom shader produced weird results, since it works with only one camera it seems. I might need to use a custom bloom shader.

How should I proceed to have a offscreen buffer which renders the view of the two cameras, so I can apply the bloom filter to that buffer?

Thanks for any help

Are these on the same window?

If they are side by side in the same window you might be able to get away with using a different camera on a different display region.

DisplayRegions are like viewports in OpenGL. You can have side by side cameras of the same scene easily. Check out the display region and graphics buffers part of the manual.

Thanks for the help, but I need not side by side windows, what is happening in my game is which there are three cameras, each with different custom shaders, these cameras resultant images are on top of each other, if you used GIMP or Photoshop, the situation is equal, with one camera resultant image being like a layer, and I got “3 layers”, one on top of the other.

I need a way to get the resultant image of the 3 cameras together into a single displayarea or texture, so I can get this and apply the bloom filter on it, because applying bloom filter to each of the cameras was not good.

Thanks for any help!

You could apply the three buffer textures onto a quad then render this quad in front of the main camera.
Then you can mix the buffer textures however you like (using Panda’s stuff, or a custom shader).

How can i apply the texture buffers to a quad? Also what is and how a quad works? If you want you can direct me to one or more links about this. I will search about this on my own when I can

Thanks for the tip!

I mean a quad as in a simple 4 sided polygon, also called a “card” or “texture card”. The idea is you put this polygon in front of a camera and then apply the buffers onto it. For each off-screen buffer you create you can get the texture with buffer.getTexture(), then apply it onto this polygon for example using setTexture, or setShaderInput functions. You can look at the “Teapot On TV” demo included with Panda for an example of how this works.

Sorry for the delay. I didn´t knew which texture cards and quads were the same thing, thanks for the explanation; also none of the 3 cameras is an offscreen buffer, so I couldn´t get their textures with getTexture(). I tried instead:

bloomBuffer = base.win.makeTextureBuffer("bloomBuffer", 0, 0)
bloomBuffer.setClearColor(Vec4(0,0,0,1))
bloomCamera = base.makeCamera(bloomBuffer, scene = self.crender, lens = camera.node().getLens(), displayRegion = (0,0.5,0,1) )

crender is the entire scene which will receive toon shader, but by itself it don´t have the special lighting which is applied to each of the 3 cameras, and the result is messed up, as vertex colors are together with texture colors into a single camera with one single shader(which doesn´t recognize what is vertex colors).

Thanks for the help, I will keep trying to solve this, I will take a look at panda sample you suggested.

EDIT:
Strangely i already had part of the solution in the code above: I just had to:

bloomCamera = base.makeCamera(bloomBuffer, scene = self.crender, lens = camera.node().getLens(), displayRegion = (0,0.5,0,1), useCamera = sourcecamera )

now I got the output of the camera into a texture card, I just need to assemble the 3 texture cards into another card as you suggested, but how can i do this?