Am 07.11.2013 12:55, schrieb michael kapelko:
Hi, Sebastian.

So you compose one shader per object?
No, one program per define-set (e.g. #define NORMAL_MAPPING,#define PARALLAX_MAPPING, ...) The idea is not to compose the shader from functional blocks, but to write one shader containing all paths which are activated based upon the defines. It is still complicated to get all the paths correctly in the ubershader, but i found it a good transition from uniform based de/activation.

So you will end up with N different programs with N being the number of define-combinations used.


Thanks.


2013/11/7 Sebastian Messerschmidt <[email protected] <mailto:[email protected]>>

    Hi Michael,

    I solved a similar problem by overriding osg::Program which
    composes a shader from an Ubershader. This is not done via
    uniforms but defines.
    It seems to work somehow and improved the performance over
    branching based on uniforms.


    Hi.

    I decided to go with single pipeline that provides big shaders
    and objects using own uniforms and textures to change the
    pipeline behaviour.
    I started to design a simple material format so that it resembles
    the one of EffectCompositor.

    Thanks.


    2013/10/31 michael kapelko <[email protected]
    <mailto:[email protected]>>

        Hi, Wang.

        I've just checked if I can use some uber shader and control
        its behaviour per object by setting the object's uniforms.
        And it works.
        I wonder if that's ok to do that to make different objects
        rendered differently in the same scene.
        Thanks.


        2013/10/31 Wang Rui <[email protected]
        <mailto:[email protected]>>

            Hi Michael,

            Effect compositor in fact adds the child scene graph to a
            camera binding to a FBO, and then uses RTT cameras to
            perform the post processing work. The last step is always
            to show the final image on an HUD quad so all other scene
            nodes will be occluded. The only way to make the effect
            compositor work with other fixed pipeline nodes is to
            write to the depth values in the shader code of the last
            step, which cannot be automated.

            The dof.xml does such work so you may try
            ./osgeffectcompositor --normal-scene cessna.osg --effect
            dof.xml to see how normal and deferred shaded objects are
            merged. At present I haven't had a better idea about this
            problem. :-)

            Wang Rui



            2013/10/30 michael kapelko <[email protected]
            <mailto:[email protected]>>

                Hi.
                I've recently implemented deferred shading with
                normal mapping and shadow mapping using
                EffectCompositor, but it has effect on the whole
                scene, not a single object.
                Is it possible to use EffectCompositor to apply
                effects per object?
                Thanks.

                _______________________________________________
                osg-users mailing list
                [email protected]
                <mailto:[email protected]>
                
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org



            _______________________________________________
            osg-users mailing list
            [email protected]
            <mailto:[email protected]>
            
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org





    _______________________________________________
    osg-users mailing list
    [email protected]  
<mailto:[email protected]>
    http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


    _______________________________________________
    osg-users mailing list
    [email protected]
    <mailto:[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

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to