[osg-users] Multipass shading, black texture coming out of the first pass

Christian Heine Hellhound at binary-revolution.org
Wed Oct 17 08:48:08 PDT 2007


Hello Swen,

in the last few days i've figured out, that i have a bug in my multipass
soluiton.
For this bug, i've actually no idea how i could solve the problem....

The problem occurs with the execution of the passes. Each pass holds an
osg::StateSet
where the Shaders and textures are bound for execution. Actually this
StateSet must
be an element of the SceneGraph for execution. This is not the problem,
if the Shader
is an object refered shader like a dot3 Shader.

But the dilemma is, that you don't have allways object refered shaders,
sometimes
the shader is not part of an object (Blur, HDR ect.), which will
actually not be
executed. The other problem of the dilemma occurs, if you got more
shaders which are
object refered (p.e. dot3, phong lighting). If you bind more than one
state to the
object, only the last state will be executed ...

One Solution may be a render quad for each pass, which is executed
(rendered)
explicit outside the graph, to force the execution. But i  don't have a
solution how this
could be realized...

I think this could be a part of your issue. Are you sure, that your
first shader is executed?

Best regards,
Christian



Swen Walkowski wrote:
> Hello all,
>
> first I am sorry that I start a new thread, but I do not have the old
> mail here that I can answer it. That thread refer to: [osg-users]
> Multipassshading in OSG v1.2
>
> I done a look in the source code from Christian, with that code I
> tried to extend my shader for a static 2 pass shader.
>
> That is the shader class is in the attachmend (Shader.cpp).
> In the attachmend you will see the output (2Pass.JPG).
> You just will see the the point (right upper corner) but not the live
> video stream from the camera and the output from the discard shader.
>
> I try to use osgart. The first texture, who the constructor gets and
> put it to the first shader pass is the live picture. What I get out of
> that pass I try to put in the second pass and than display it.
>
> So maybe someone can help me!
>
> Thanks Swen
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>   




More information about the osg-users mailing list