[osg-users] Fixed pipeline lighting to shaders

Robert Osfield robert.osfield at gmail.com
Sat Aug 10 03:58:40 PDT 2019


Hi Catalin,

On Sat, 10 Aug 2019 at 06:49, Catalin <inbox.icf at gmail.com> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20190810/892aa02a/attachment.html>


More information about the osg-users mailing list