Multiple light problem, material iteration, light limit

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
User avatar
robert_sasu
Google Summer of Code Student
Google Summer of Code Student
Posts: 237
Joined: Mon Apr 02, 2012 11:07 am
x 42

Multiple light problem, material iteration, light limit

Post by robert_sasu »

Hi,

I am working on an air trafic simulator which uses Ogre 1.7.4 as a rendering engine.
Is there any light limit when using programmable shader ? I know there is a limit of the constant buffer and the calculations per shader type, so because of this I am using 16 lights and per-pixel-shading.
But I would want to see more than 16 lights on. I tried to set MaxLights to 128 (for instance) and use iteration 1 per_n_lights 16, but there are still just 16 visible lights on, even if there are 30 created on the scene.
After 16 lights if I set a next one to visible, one of the currently visible will go off.
I tried to use scene_blend add, but the result is the same.

Am I missing something ?

Thanks,
Robert
Google Summer of Code 2013 Student
Topic: "DirectX 11 & Tessellation samples"
Project links: Project thread, WIKI page, Code fork for the project
Mentor: Assaf Raman
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5539
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1399

Re: Multiple light problem, material iteration, light limit

Post by dark_sylinc »

Check OGRE_MAX_SIMULTANEOUS_LIGHTS in OgreConfig.h
The default is 8.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5539
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1399

Re: Multiple light problem, material iteration, light limit

Post by dark_sylinc »

Note that the complexity of checking lights becomes O( N*M ) where N is up to OGRE_MAX_SIMULTANEOUS_LIGHTS, and M the number of entities in the scene.