Is there a way around the 8 lights limitation in processing 3.0?

edited February 2016 in GLSL / Shaders

Hi,

I am working on a 3D water fountain simulator which also uses spotlights to create different color effects on different fountains. What I want to ultimately be able to do is create a reasonable amount of fountains, each with its own spotlight, and create some sort of choreography. As of now, each particle fountain is an object and every time I create more than 8 a red error message pops up and stops my simulation. I tried switching the spotlights on and off so that the number of spotlights is never over 8, but the simulations runs too slow and it just doesn't look that good.

I am open to any suggestions so feel free to ask or recommend anything. I know that the problem is within Processing itself since it does not allow more than 8 lights at a time, but why is that? is there a way to change that limit or is it better to take a different approach for the fountain lighting?

Thanks for the help!

Answers

  • I just looked in the OpenGL Programmers Guide (The Red Book) and the number of lights depends on the OpenGL implementation so is beyond the control of Processing.

  • So then I should look into OpenGL? Any tips on solving this problem? maybe if I use another 3D graphics library? Please, anything is helpful. I'm new to Processing and do requiere some help. Thanks.

  • I am more familiar with using OpenGL from C++ but as far as I know there are 2 principal implementations of OpenGL for Java. All Java programs that use OpenGL as a renderer will use one of these implementations so changing from Processing to something else is unlikely to help.

    One of the reasons for limiting the number of light sources is to reduce the amount of computation since the effect of every light source must be taken into account for every vertex. Having a lot of light sources can seriously affect overall performance.

    I do not know what the solution is or even is there is one.

  • maybe you can give the particles itself a color each (different shades of red in fountain 1, greens in fountain 2...)

    and then use lights(); or use ambientLight to get an effect

    regarding speed :

    you could save the images and make a movie from that, so speed is not an issue

  • I did think about giving the particles themselves a color but that eliminates the "spotlight cone" effect and it's quite important for the simulator. I'm still stuck on this problem since this isn't my area of expertise... I'm going to post the same problem on an OpenGL forum and see if they can help.

    Thanks for the replies!

Sign In or Register to comment.