[osg-users] Multipass shading/rendering
stud_info2 at yahoo.de
Wed Sep 12 07:21:09 PDT 2007
I have already implemented the things your are
speaking about. I am calling it osgPPUG: stands for
osg post processing unit graph. There I can build up a
graph of post processing units (rtt quads) which can
do single/multipass, single or multiple rendering
targets for inputs and outputs and other cool things.
The osgPPUG is designed to be extendable, so that new
ppus could be written as plugins.
I have presented an overview about them on the osg BOF
at Siggraph last month. I promised to make a node kit
of them so that it could be used by everyone. However
I still do not get enough time to prepare the code to
put it online.
The code still use some parts of my application, which
can be safely removed, but the code has to be
rewritten. If you like to help me in preparing the
node kit, so I would be very appreciated ;-) Otherwise
you have either to wait until I publish this as a node
kit, or write it on your own.
Of course for more question about this, just contact
To answer your question: More code is required to see
what happens. It could be that you do not properly
connected shaders with input and output textures. But
I have to take a look into the code.
--- hellhound at binary-revolution.org schrieb:
> I need to implement some post processing shader
> effect, based on multipass
> shading/rendering processes. In thiss multipass
> process each shader could have one or more RTT
> targets as input and output of the pass.
> To realize this i've implemented a render to texture
> class based on the
> osgprerender and osgtexturerectangle examples. This
> class creates for each
> instance a texture rectangle and a FBO POST-Process
> camera by this way:
> void createCamera(osg::ref_ptr<osg::Node> subGraph,
> unsigned int passPos)
> m_camera = new osg::Camera;
> // define orthogonal projection
> // bind camera as POST-Process Camera with the
> position value of the pass
> // add subcene to camera to render
> The initialized camera is a member of type
> osg::ref_ptr<osg::Camera> and the
> passPos Parameter defines the pass of the shader.
> Each pass is handled as single
> osg::ref_ptr<osg::StateSet> in a specialised
> pass class. For each pass i define the referenced
> shader and textures which
> depends on. So that i have the following object tree
> osg::Texture2D "Decal"
> osg::Texture2D "Normal"
> RTT next (my RTTclass)
> Camera (PRE)
> RTT prev(my RTTclass)
> osg::CameraNode (PRE)
> Pass1 "Dot3" (Main)
> <-- Decal (in)
> <-- Normal (in)
> --> Next (out)
> <-- Next (in)
> --> Prev (out to screen (texturized
> This works fine, if i use only a single pass shader.
> In this case the RTT
> Texture is rendered to a texturized quad in front of
> the view. If i use this
> RTT as input for the second path, and try to render
> the output of the second
> rtt on the textured quad nothing is shown where the
> textured quad should be...
> I have no idea what could be wrong or what i've
> overseen... Perhaps i made
> somthing conceptionally wrong. Has anyone
> implemented a multipass shadering
> with osg and could me push to the correct sollution?
> If you required more code, i will append if i am
> back from work...
> Thanks in advance,
> best regards
> osg-users mailing list
> osg-users at lists.openscenegraph.org
Wissenswertes für Bastler und Hobby Handwerker. BE A BETTER HEIMWERKER! www.yahoo.de/clever
More information about the osg-users