Re: [osg-users] More lights in scene!

2016-10-27 Thread Nickolai Medvedev
Hi, all.

This is very good site about lighting and another graphic effects:

http://sunandblackcat.com/other.php

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





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


Re: [osg-users] More lights in scene!

2016-10-24 Thread Terry Welsh
Neat. I did the same thing for a game I wrote, but I used custom
shader-based lights instead of OpenGL lights, and I used 4 lights
instead of 8. The most interesting takeaway was that applying  shaders
for 0, 1, 2, 3, or 4 lights (5 different shaders) was very slow due to
shader swapping. The fastest combination I found was to only compile
shaders for 0 or 4 lights, and if I only needed to apply 1, 2, or 3
lights I could set some of their color uniforms to black.
--
Terry Welsh
http://www.reallyslick.com


>
> Hi,
>
> Check out my solution - no shaders needed: 
> http://forum.openscenegraph.org/viewtopic.php?t=15339
>
> Cheers,
> Jannik
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69123#69123
>
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] More lights in scene!

2016-10-24 Thread Trajce Nikolov NICK
Nickolai,

here is good link I have started with, with code samples

http://www.ozone3d.net/tutorials/glsl_lighting_phong.php

On Mon, Oct 24, 2016 at 5:37 PM, Robert Osfield 
wrote:

> On 24 October 2016 at 16:20, Nickolai Medvedev 
> wrote:
> > I need colour of the surface geometry of objects in the scene.
>
> gl_Color with GL2, or osg_Color if you have enabled the vertex to
> vertex attrib aliasing.  This aliasing is on by default for GLcore or
> GLES2 profiles.
>
> Go look at the shaders in the OpenSceneGraph-Data/shader examples.
>
> Robert.
> ___
> 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


Re: [osg-users] More lights in scene!

2016-10-24 Thread Robert Osfield
On 24 October 2016 at 16:20, Nickolai Medvedev  wrote:
> I need colour of the surface geometry of objects in the scene.

gl_Color with GL2, or osg_Color if you have enabled the vertex to
vertex attrib aliasing.  This aliasing is on by default for GLcore or
GLES2 profiles.

Go look at the shaders in the OpenSceneGraph-Data/shader examples.

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


Re: [osg-users] More lights in scene!

2016-10-24 Thread Nickolai Medvedev
I need colour of the surface geometry of objects in the scene.
I experiment with shaders and trying to create light sources with their help.
And, Robert, thank you for your patience.

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





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


Re: [osg-users] More lights in scene!

2016-10-24 Thread Robert Osfield
HI Nickolai,

On 24 October 2016 at 11:37, Nickolai Medvedev  wrote:
> If we need diffuse lighting, we need get color of the scene, send him into 
> shader as uniform, then, for example, if we need point light, add color with 
> radius.
>
> So, question is: how to get our scene color? Need create light shader for 
> each light?

I really don't know what exactly you mean.  Are you already using
shaders for lighting?  Using old OpenGL fixed function for lighting?

What you mean by colour of the scene?  The colour of the light source?
 The colour of the surface geometry of objects in the scene?

I really can't provide answers to open ended questions.

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


Re: [osg-users] More lights in scene!

2016-10-24 Thread Nickolai Medvedev
Hi, Robert.

If we need diffuse lighting, we need get color of the scene, send him into 
shader as uniform, then, for example, if we need point light, add color with 
radius.


So, question is: how to get our scene color? Need create light shader for each 
light?

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





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


Re: [osg-users] More lights in scene!

2016-10-24 Thread Robert Osfield
HI Nickolai,

The limit to 8 lights is part of the GL fixed function pipeline so if
you uses shaders you can address this.

By co-incidence I've started some experiments with extending the
#pragma(tic) shader composition framework to blurr the line between
fixed function and shaders which may provide a possible route to
adding more than 8 lights.  If this goes well then I'll be introducing
this work to the community.  It's bleeding edge work though, I really
don't know yet whether I can make it all work.

Robert.

On 23 October 2016 at 20:12, Nickolai Medvedev  wrote:
> Hi, community!
>
> I have a question: how i can create more than 8 lights in scene. Need new 
> shader-based light system? If so, how i can make these?
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69119#69119
>
>
>
>
>
> ___
> 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] More lights in scene!

2016-10-23 Thread Nickolai Medvedev
Hi, Jannik.

Thanks! OpenMW - amazing project! Good luck to you and your team!

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





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


Re: [osg-users] More lights in scene!

2016-10-23 Thread Jannik Heller
Hi,

Check out my solution - no shaders needed: 
http://forum.openscenegraph.org/viewtopic.php?t=15339

Cheers,
Jannik

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





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


Re: [osg-users] More lights in scene!

2016-10-23 Thread Trajce Nikolov NICK
yes ! .. That is very nice project. Here is the video

https://www.youtube.com/watch?v=HIrq4sF5QO8

On Sun, Oct 23, 2016 at 9:52 PM, Nickolai Medvedev 
wrote:

> Hi, Trajce!
>
> Here i found:
>
> https://github.com/bcrusco/Forward-Plus-Renderer
>
> Well, deferred renderer is more suitable for a large number of light
> sources.
> And it is necessary to create also new materials system...
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69121#69121
>
>
>
>
>
> ___
> 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


Re: [osg-users] More lights in scene!

2016-10-23 Thread Nickolai Medvedev
Hi, Trajce!

Here i found:

https://github.com/bcrusco/Forward-Plus-Renderer

Well, deferred renderer is more suitable for a large number of light sources.
And it is necessary to create also new materials system...

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





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


Re: [osg-users] More lights in scene!

2016-10-23 Thread Trajce Nikolov NICK
Hi Nickolai,

this is the topic that I am still learning ... Do a search for Forward+.
Here is some opensource OSG implementation: http://openig.compro.net 
the source is here: https://github.com/CCSI-CSSI/MuseOpenIG .. Look there
for the ForwardPlus plugin.

Short story, without digging into the details of F+ itself, you encode your
light attributes (color, direction, range ..) into float texture (or
TextureBufferObject) and in your shaders you unpack the light attributes
from these and perform your lighting. This way you are not limited to the
OpenGL constructs for lights.

It is really advanced topic but interesting as well indeed ...

Cheers,
Nick

On Sun, Oct 23, 2016 at 9:12 PM, Nickolai Medvedev 
wrote:

> Hi, community!
>
> I have a question: how i can create more than 8 lights in scene. Need new
> shader-based light system? If so, how i can make these?
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=69119#69119
>
>
>
>
>
> ___
> 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