About graphics buffer and attaching a camera to it

Thanks but i am still fairly confused,

I wanted a main window which has 2 outputs from 2 cams(in 2 different display region) also i wanted a ram copy of one of the image from one of the cams, you told me i could not extract the texture of just 1 display region, so i decided to create 1 more cam(now total 3) of which 2 point to the same location so that i can associate one of the cams to a display region and the other to the buffer so that i can get the ram copy from the buffer and at the same time get the output in the display region too.

Also my confusion arises partly from the documentation
the c++ documentation http://www.panda3d.org/manual/index.php/Low-Level_Render_to_Texture says that :

PT(GraphicsOutput) mybuffer;
PT(Texture) mytexture;
PT(Camera) mycamera;
NodePath mycameraNP;
NodePath myscene;
 
mybuffer = window->get_graphics_output()->make_texture_buffer("My Buffer", 512, 512);
mytexture = mybuffer->get_texture();
mybuffer->set_sort(-100);
mycamera = new Camera("my camera");
mycameraNP = window->get_render().attach_new_node(mycamera);
myscene = NodePath("My Scene");
mycamera->set_scene(myscene);

while the same in python is

mybuffer = base.win.makeTextureBuffer("My Buffer", 512, 512)
mytexture = mybuffer.getTexture()
mybuffer.setSort(-100)
mycamera = base.makeCamera(mybuffer)
myscene = NodePath("My Scene")
mycamera.node().setScene(myscene)

the python documentation has the line
mycamera = base.makeCamera(mybuffer)
So that i can see that we have a new camera which renders its output into the buffer, but the c++ has no such reference we create a buffer, create a camera but never tell the cam to render into the buffer, also i could not find a line corr. to base.makeCamera(mybuffer) in c++.
So how do i go about it??
Also do i incur a big time penalty if i add another camera to render into the buffer, is there a way such that the same camera (camera2 in this case) can render its image into both the buffer and the displayregion??
Thanks again will work on checking the ram images.

1 Like