[osg-users] Repeatable rendering of subgraphs, ideas?

Paulo Silva paulo.jnkml at gmail.com
Thu Nov 12 09:37:42 PST 2009


can I add something here?
What about a simple multipass (unknown until the draw stage), with rendering done by a glsl shader, and shader variable update in function of the pass, like:

void render() {
    setGlslProg(prog); //which uses uniform_x

    for(i(0); i != num_of_passes; ++i) {
        //change the same uniform in function of the pass i
        uniform_x->set(i / num_of_passes);
        render(node); //actually render pass i!

This is somewhat similar to what is being discussed here, and also conceptually incredibly simple, but apparently very complicated to implement with osg. Apparently you cannot change the uniform in your own implementation of the cull_draw traversal, as suggested early, because in the end all passes will be rendered with the same uniform value!?
As if the cull_draw did not actually submit the geometry to GL between passes. (still have to check it out in the code).


Thank you!


Read this topic online here:

More information about the osg-users mailing list