Hi, About the openGL limitation of 8 lights: I recently coded a small and simple light sources manager. Its goal is to simply switch on the "most important" light sources of the current RenderStage. By "most important", I mean that each source has a priority you can define (depending on the intensity, the distance to the camera, etc.). It's NOT a way to have more than 8 lights per RenderStage, but it simplifies some uses. It's included in PVLE (my small game engine - http://pvle.sourceforge.net/ ) and used in a tiny game (Paratrooper - http://sukender.free.fr/paratrooper/index_en.php ). The code is rather independant of the engine ; so feel free to use the LightSourceManager from the code. Just also feel free to send back improvements and potential fixes!...
Sincerely, Sukender PS: for example, in the game, there are 2 "global" lights (always on) and explosions and flares. When "explosions + flares >6", the manager switches off the less intense lights. Browse for PVLE sources : http://pvle.svn.sourceforge.net/viewvc/pvle/ Last LightSourceManager header : http://pvle.svn.sourceforge.net/viewvc/pvle/trunk/Include/PVLE/3D/LightSourceManager.h?view=markup Le Fri, 24 Oct 2008 10:33:53 +0200, Robert Osfield <[EMAIL PROTECTED]> a écrit: > HI Kevin, > > RIght now the way to do multiple lights is to use the OpenGL hardware > lights GL_LIGHT0... GL_LIGHT7, must this is limited just one entry per > light per RenderStage. To scale up to more lights than 8 then you > have use tricks with multiple RenderStage. This topics is rather > complex and has been discussed on osg-users alot previously so please > search the archives for info on it. > > Robert. > > On Fri, Oct 24, 2008 at 8:59 AM, Kévin FAURE <[EMAIL PROTECTED]> wrote: >> Hi everyone, >> >> I have a problem with light. Later, my scene should be consist of a >> multitude of planetary system each lit by a light, and for this reason that >> I would have several light0. >> I have also seen the project "osgmanylights" but this method doesn't suit >> me. >> >> For now, I have done a very simple osg file which display four spheres, >> two on the left side of the scene and two on the right side. My two lights >> are also located on both sides of the scene, each in a sphere. >> I would like use many light0 in my scene but osg display only the last. >> Here is a screenshot with two light0 : >> >> <a href="http://imageshack.us"><img >> src="http://img185.imageshack.us/img185/4232/light0sj6.png" border="0" >> alt="Image Hosted by ImageShack.us"/></a><br/><a >> href="http://g.imageshack.us/img185/light0sj6.png/1/"><img >> src="http://img185.imageshack.us/img185/light0sj6.png/1/w652.png" >> border="0"></a> >> >> Only the last light0 (one the right) is displayed. >> >> I have tried to understand the RenderStage and RenderBin class but for now, >> still nothing... >> >> Regards. >> >> >> >> _______________________________________________ >> osg-users mailing list >> [email protected] >> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org >> >> > _______________________________________________ > osg-users mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org _______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

