Hi Anders,

apart from long term plans I managed to get the appropriate behaviour by writing a FixedFunctionVisitor. It uses a modified ShaderComposition (based on Ubershaders with #defines) and injects the appropriate uniforms for osg::Material. Lights are managed a bit differently but also with a combination of uniforms and callbacks, effectively removing the orignal lights and replacing them with uniforms. The catch here is, that materials are no longer coupled with the existing states. They are transformed once and changing the osg::Material state attributes will no longer affect the scene.

P.S. I needed to remove the fixed function light management from the graph anyways to transform the lightsource nodes to geometry in a deferred pipeline.


Hi Anders,

On 20 December 2013 10:56, Anders Backman <[email protected] <mailto:[email protected]>> wrote:

    I was trying to catch up a bit on the newer stuff on OpenGL.
    What is the status of dropping all gl_material, gl_light stuff in
    shaders (using uniforms only)?


OpenGL ES 2.0 onwards does not support any of the gl_ built ins.

OpenGL 3.0 core profile like ES 2.0 does dot support any of the gl_ builtins.

osg::State is able to remap shaders that contain the main gl_ModelViewMatrix etc. builtins and provides osg_ equivilants. However, this doesn't extend to individual bits of the fixed function pipeline like gl_Materail/gl_Light etc, for these you will have to provide your own Uniforms.

    Is that part of any released version of OSG, or is it part of the
    ShaderComposition work still in trunk?


The ShaderComposer is part of OSG-3.2 and is able to compose shaders that you provide in the appropriate shader composer friendly way, see the osgshadercomposition example. My long term plan is for the fixed function pipeline state like osg::Light etc. to provide the necessary shader components - both the uniforms and the shaders to enable scene graphs with fixed function usage to work on ES 2.0 and GL 3.0 core profiles.

Robert.


_______________________________________________
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