Re: [osg-users] Fixed pipeline lighting to shaders

2019-09-09 Thread Franco Tang


gwaldron wrote:
> Here's some shader code you can use as a reference (not a complete solution 
> on its own). There are also some links in the code comments you can research.
> 
> https://github.com/gwaldron/osgearth/blob/master/src/osgEarth/PhongLighting.frag.glsl
>  
> (https://github.com/gwaldron/osgearth/blob/master/src/osgEarth/PhongLighting.frag.glsl)
> 
> 
> 
> 
> 
> On Sat, Aug 10, 2019, 1:49 AM Catalin < ()> wrote:
> 
> 
> > Hi,
> > 
> > 
> > Does OSG has some shaders that replicates the fixed pipeline of OpenGL 
> > (1.x) with the 8 lights?
> > 
> > 
> > Thank you,
> > Catalin
> > 
> > 
> > ___
> > osg-users mailing list
> >  ()
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
> > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > 
> 
> 
>  --
> Post generated by Mail2Forum


Thank you, gwaldron. I saw the post before. It added to my knowledge of OpenGL 
light. 

I am building osgEarth now. I would try to dig the source of osgEarth. Does 
osgEarth use shader to implement light effect rather than glLight?

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76660#76660





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


Re: [osg-users] Fixed pipeline lighting to shaders

2019-08-12 Thread Glenn Waldron
Here's some shader code you can use as a reference (not a complete solution
on its own). There are also some links in the code comments you can
research.

https://github.com/gwaldron/osgearth/blob/master/src/osgEarth/PhongLighting.frag.glsl


On Sat, Aug 10, 2019, 1:49 AM Catalin  wrote:

> Hi,
>
> Does OSG has some shaders that replicates the fixed pipeline of OpenGL
> (1.x) with the 8 lights?
>
> Thank you,
> Catalin
> ___
> 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] Fixed pipeline lighting to shaders

2019-08-11 Thread Chris Djali
Hi,

ShaderGen from 3D Labs is an old tool that can generate equivalent GLSL 1.2 
shaders for a fairly large subset of FFP state. I've used it a fair amount to 
sanity-check things. If you just want a basic shader as a start point to drop 
into an FFP application, it's pretty good, but there are definitely things it 
doesn't cover.

Cheers,
Chris

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=76576#76576





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


Re: [osg-users] Fixed pipeline lighting to shaders

2019-08-10 Thread Robert Osfield
Hi Catalin,

On Sat, 10 Aug 2019 at 06:49, Catalin  wrote:

> Does OSG has some shaders that replicates the fixed pipeline of OpenGL
> (1.x) with the 8 lights?
>

The osgUtil::ShaderGen can do a bit of this, it's not great but might help.

With shaders you have lots more possibilities than you do with the fixed
function pipeline so as well as moving to shaders you take the opportunity
to improve visual quality such as by introducing per pixel lighting rather
than per vertex lighting that fixed pipeline constrains you to.

I see that Nick has suggested OpenIG.  I did some work it a couple of years
ago and found performance issues that couldn't be resolved, so ended up
implement a different approach to implementing large number of light
sources that also ended up being simpler and better integrated into how the
OSG normally works.   Unfortunately this work isn't mine to share as it's
not open source.  I mention it as a word of caution and also encouragement,
as it's possible to build pretty sophisticated lighting schemes ontop of
the OSG, though it's not an entry user tasks.

An easier short term route is to get familiar with shaders.  There are some
in the OpenSceneGraph-Data/shaders set that include lighting.

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


Re: [osg-users] Fixed pipeline lighting to shaders

2019-08-10 Thread Trajce Nikolov NICK
Hi Catalin,

Lighting is very interesting topic in OpenGL (and OSG). Have a look at this
opensource project for inspiration about lighting with shaders (
http://openig.compro.net/ ). It is hosted on github where you can find the
sources including the shaders. https://github.com/CCSI-CSSI/MuseOpenIG ..
It has implementation of Forward+ where you can have hunderds of lights in
realtime. Here some video https://www.youtube.com/watch?v=l1EXIYBVH5g ..
This project is stopped but it is still interesting and I know few
companies is using it for simulation

On Sat, Aug 10, 2019 at 7:49 AM Catalin  wrote:

> Hi,
>
> Does OSG has some shaders that replicates the fixed pipeline of OpenGL
> (1.x) with the 8 lights?
>
> Thank you,
> Catalin
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


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


[osg-users] Fixed pipeline lighting to shaders

2019-08-09 Thread Catalin
Hi,

Does OSG has some shaders that replicates the fixed pipeline of OpenGL
(1.x) with the 8 lights?

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