PDA

View Full Version : rendering geometry individually



kewuwsi
08-20-2008, 06:21 AM
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?

tks

ZbuffeR
08-20-2008, 07:01 AM
Render to texture.

kewuwsi
08-20-2008, 10:33 AM
tks.

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.

tks

Keith Z. Leonard
08-20-2008, 03:59 PM
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;
else
Alpha = 0.0;

Result = mix(tex0Color, tex1Color, Alpha);

ZbuffeR
08-20-2008, 06:08 PM
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 ?

kewuwsi
08-20-2008, 08:33 PM
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.