Re: [osg-users] How to Keep model color aven if shaders are applied

2013-01-30 Thread Andrea Martini
Hi all, thank for your suggestions. Now 3d model keeps its color and material also afeter shader applying. thank again Cheers, Andrea -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52283#52283 __

Re: [osg-users] How to Keep model color aven if shaders are applied

2013-01-30 Thread Sergey Polischuk
Hi material colors are available in gl_FrontMaterial struct in fragment shader there are vec4's gl_FrontMaterial.diffuse, .specular, .ambient, .emission, and float .shininess there are also material params premultiplied with lightsource params in gl_FrontLightProduct struct (.diffuse = materialD

Re: [osg-users] How to Keep model color aven if shaders are applied

2013-01-30 Thread Andrea Martini
Hi Glenn, thank you for your suggestions. Can i do the same thing also with materials? Thank you! Cheers, Andrea -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52281#52281 ___ osg-users mailing list

Re: [osg-users] How to Keep model color aven if shaders are applied

2013-01-30 Thread Glenn Waldron
Andrea, The vertex color is available in the vertex shader as gl_Color. Pass this to your fragment shader in a varying and apply it there. Glenn Waldron / @glennwaldron On Wed, Jan 30, 2013 at 5:23 AM, Andrea Martini wrote: > Hi, > > i'm wondering if it is possible to keep original materials an

Re: [osg-users] How to Keep model color aven if shaders are applied

2013-01-30 Thread Andrea Martini
Hi Robert, thank you for your replay. I'm going to check how to reproduce the same materials and colors on 3d model with shaders. Thank you! Cheers, Andrea -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=52278#52278 _

Re: [osg-users] How to Keep model color aven if shaders are applied

2013-01-30 Thread Robert Osfield
Hi Andrea, Your shaders will need to apply the colour as you can't mix and match fixed function and shaders in OpenGL. Robert. On 30 January 2013 10:23, Andrea Martini wrote: > Hi, > > i'm wondering if it is possible to keep original materials and colors of a 3D > model, even if we want to app