[osg-users] multipass & calculating with shaders

OSG@dvp.co.il osg at dvp.co.il
Mon Sep 17 06:38:04 PDT 2007

 first I would like to reask the question I sent few days ago since it might have been overlooked so here it is:

 in the osg examples there are several examples of how to use RTT.
I would like to concatenate several renderings. I mean, render the scene to texture1, then use texture1 to create texture2, then use texture1 & texture2 to create texture3 and so on.

I don't understand how to control the order of the rendering. I tried to change the rendering order number of the camera's I used in PRE_RENDER and it didn't seem to have any effect. The results seems fine, but I don't know if it used the data in the texture from the current frame or the previous.

(in the example I made to check this ability, I render the cow to texture, then using PRE_REND
ER & shader I remove the red plane and later I remove the green plane, changing the order should result in different images)

this brings me to the next question. I tried to clear the texture used to render the Scene to. I tried setting the texture image to new allocated image, dirty the texture parameters and dirty the texture object and nothing seems to have the required result. dirty the texture object results as blank screen, the other operation doesn't seem to clear the texture since changing the order in the multipass didn't change the results.

another problem I had was to render in different passes to the same texture. (Even if it was in the POST_RENDER sub tree). is there a way to reuse the same texture in different passes?

the last problem I encountered is that I rendered the resulting textures, using several cameras NESTED_RENDER each drawing a square with different texture attached 2 it and each camera has different viewport. The problem is the is the cameras viewport intersected, I couldn't change the order they are rendered (to make one of them on top of the other). I tried setting the RenderDetaill with higher and lower numbers, both for the Camera and for the Geodes, with no success.

any ideas concerning any of the problems would be appriciated.


second, I want to render single or several (4 - 8) values which represnt some calculation. So I use render to texture. The texture is 1D and to render to it I use orthographic projection, and the viewport fits to the texture dimension. The geometry I render is points. One point per calculation, and each point should result as one pixel. Is this the right way? I has to set the point size to 1.5 to see anything, any ideas why?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20070917/ed4dde43/attachment-0002.htm>

More information about the osg-users mailing list