Hello Swen, i will take a look at your code when i am back from office. Before i have an additional information for you:
Yesterday i've played a little bit arround with my solution and try to solve the problem in a first dirty solution. For that i've created two HUD surfaces. The first where i bind the 2nd Pass shader (set glFragColor to red to check if it is executed) and a second where i bind the texture of the second pass RTT. This 2nd RTT shows me the same result as the first rtt and not the red colored result of the 2nd pass. First i thought this was an other bug, but i've thought a little bit about it and now i think it's correct... I think the failure could be in the binding of the cameras of the rrt's! The RTT camera of the second pass points to the same object like the first RTT camera. The result of the second pass is shown to the hud, so it's impossilbe that the second RTT shows a red colored object ... Perhaps it help's you to find a solution. Best regards, Chrsitian Swen Walkowski wrote: > Hello Christian, > > thanks for your answerer. I modified my code the last days a lot. Now > I am sure that my shaders are executed. > Now I still have the same problem like you. I always get the last > shader displayed. > > To add the shaders to the graph I use that code: > Shader* invertShader = new Shader(Shader::INVERT, false, NULL, 0); > videoBackground->addChild(invertShader->getCamera()); > > Shader* discardShader = new Shader(Shader::DISCARD, true, > invertShader->getTexture(), 1); > videoBackground->addChild(discardShader->getCamera()); > > videoBackground.get()->setStateSet(discardShader->getStateSet()); > videoBackground.get()->init(); > > I add my new code if you want take a look in. > Hope we will find a way to solve that problem. I am still on it. > > Please let me know when you found out something. > > Best, > Swen > ------------------------------------------------------------------------ > > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

