Re: [osg-users] Status of beyond OpenGL 1 materials

2013-12-20 Thread Anders Backman
Yeah, so you would still have to parse the scenegraph and create your own
Uniform structure for all possible stuff found in the osg::Material's
created by various file readers.

Are there any plans for moving this over to uniform too?

Regarding Deferred Shading, are there any OpenSource projects based on
OpenSceneGraph with a framework for this?

/A


On Fri, Dec 20, 2013 at 3:11 PM, Sebastian Messerschmidt <
sebastian.messerschm...@gmx.de> wrote:

>  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  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 
> listosg-users@lists.openscenegraph.orghttp://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>


-- 
__
Anders Backman, HPC2N
90187 Umeå University, Sweden
and...@cs.umu.se http://www.hpc2n.umu.se
Cell: +46-70-392 64 67
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Status of beyond OpenGL 1 materials

2013-12-20 Thread Sebastian Messerschmidt

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 > 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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Status of beyond OpenGL 1 materials

2013-12-20 Thread Robert Osfield
Hi Anders,

On 20 December 2013 10:56, Anders Backman  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
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Status of beyond OpenGL 1 materials

2013-12-20 Thread Anders Backman
Hi all.

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)?

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

/Anders


-- 
__
Anders Backman, HPC2N
90187 Umeå University, Sweden
and...@cs.umu.se http://www.hpc2n.umu.se
Cell: +46-70-392 64 67
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org