rendering geometry individually

Hi, Guys.

assume there are several geometries in the scene, instead of rendering them all together, can I just render some of them individually and put the result back? if so, what is the matrices?

for example, I am try to render a table with a lamp on it. can I just perspective project the table first, and perspective project the scaled lamp( for performance/ render effect purpose), then orthogonal project the lamp image back to the table image?


Render to texture.


I knew render to texture a little bit.
Here, the part which is really puzzling me is: how can I preserve the rendering result such as it is exactly same as regular projection? in another words, how to “paste” the rendered texture back correctly?

any detail will be appreciated.


You could render to a framebuffer object, with textures for both the color buffer and depth buffer. Then you could render these things together as full screen quads and blend them based upon a depth comparison between the different textures.

so something like…

if (tex0Depth <= tex1Depth)
Alpha = 1.0;
Alpha = 0.0;

Result = mix(tex0Color, tex1Color, Alpha);

And of course, some transformation tricks will be needed to be able to move the camera while reusing the impostors as billboards, without re-redering everything at every frame.

Is that your intention ?

Thanks for the info!

I just want to render several geometries all together like usual.
But one of them is a volume geometry, So I want to render this one by using some volume rendering technique. All the others are regular surface rendering.

thank you very much.