max number of lights

ok is the max number of lights 256???

coz i have these lights (heaps of them) and because i am modeling a city its on a tiny scale. (yep a whole bloody city with detail up to about window size)

anyway i had some lights and everything was fine.

then i added some more (by duplicating)
still everything was fine

then i duplicated all of them again

but after i did that suddenly the picture was all dark, and screwed up!!!

and yep there were more than 256 lamps.

but as soon as i deleted the extra lamps it went back to normal!!!

arrrrrrrggggggghhhhh and BTW don’t try to sugest i look to see if i i changed the layers or anything for the render because i have tested everything. all combinations etc…

and i have concluded that its the LAMPS fault.

anyway i can’t show you the renders/problem becasue it is TOP SECRET and i have been working on it for ages, for the exodus project!!!

Arrrrrrggggggghhhhhh this will seriously ruin my dreams of the MOST COMPLICATED BLENDER SCENES EVER.

i wanted 5 million+ polygons and about 10,000 lamps with about 3/4 of them shadow casting.

oh well can anyone help???

THANKS
Alltaken

Everything’s got limits. You just have to learn to live with them.

Two ideas off the top of my head:

  • Render the scene in multiple parts or passes (using, no doubt, several different .blends, each hitting the 256 lamp limit) and composite the parts together.

  • For buildings that are never going to be featured (ie: ones that are always in the background), make them simpler using texture-maps and materials with an emit value to simulate lamps. Save your lamps for your ‘hero’ buildings.

It’s a bit hard to give you specific ideas because you’re keeping your details under wraps, but in general just take a step back, realize that getting upset about a limit isn’t going to change it and let your mind attack the problem from a new angle.

Good luck,
-Iain

dunno why, but i used to use an icosphere, subdivision of 5, and use dupliverted lamps on it. That’s about 500 lamps, and it rendered fine for me. Maybe if you use dupliverts instead?

hey banana sock how did you get all the lamps to to be on the points of the icosphere???

or is it just a single lamp dupliverted??

but still how did you manage to parent the lamp without doing it with every individual vertex??

I got interested in this post and tried a little experiment.

I started with one 32x32 mesh sphere, 1 lamp and 1 camera. Then I started doubling the lamps. The copying got a noticably slower at about 1200 lamps, but rendering did not seem to change that much. At 28,00 lamps I quit but did not crash or have any other issues.

Blender seems to have an object buffer that only wants about 600 lamps at a time.

The machine I did this on is modern but not massive.

That said, without criticizing a project that I have not seen…let me gently say “never model when you can paint”…dig?

I would be willing to bet tho that if you really need all of that stuff in this model that you can manage a lot of it it by adding some RAM.

hey DOOR3

2.4Ghz P4
1Gb of ram (of which i have only ever managed to use 600Mb at any one time when rendering SO RAM AIN’T THE PROBLEM)

it is blender and blender alone!!!

i can add more than 256 lamps but renders once have more start to NOT use furter away lamps.

it ain’t my computer that is causing this!!!

and i havn’t modeled ANYTHING that i can paint LOL

infact i model rather LOW poly models, but this jsut required more.

imagine a LARGE city and if i want to make it full size it will be 2 Billion polygons YEP 2,000,000,000

ha ha ha

i have worked around this small flaw though!!!

Alltaken

The maximum number of lights IS 256. I had problems with that myself two years ago when I created my first (HDRIBL) script, I needed more lamps too, but quickly found it was only 256 max, and that has not changed. Just try rendering with 256 lamps, then add another, you will get a ‘lamp overflow’ error in the console.
In the Blender source code there is a define of MAXLAMP which is 256 (blendef.h and DNA_lamp_types.h).

The exact number used as vertex limit is 65000 per mesh. Blender can however render meshes with more vertices, but these are only used internally, like for subsurf meshes for instance, which can easily exceed that number.

Eeshlo:

I think you are wrong, try my experiment.

ok door3 try my experiment

add a LONG TUBE to a scene and position the camera at one end so that the tube goes from one corner to the top oposite corner.

now position a WHITE light that casts shadows a long way away and then correctly set up the clip start and clip end of the lamp.

now using a different colour e.g. red lamps (about 0.2 intensity)

add a ring of 8 lamps going around the tube ALL aiming at the tube (spot lamps for ALL lights)

now if you render you should see a tube with a white reflection from the far away lamp and a red ring around the tube.

now duplicate this ring going down it and render again at about 129 lamps total!!!

you should still see the white reflection, and the tube should have MANY MANY red ring son it.

now duplicate ALL these red lights then put them somewhere out of direct view of the tube e.g behind the camera!!!

NOW YOU HAVE 257 LAMPS

render it and compare it to the render at 129 lamps.

even though the lamps cannot see the object there is still a MEGA MUCK UP SOMEWHERE.

p.s. your experiment only proves you can HAVE more than 256 lamps in a blend file.

i have had more than 256 lamps as well.

BUT YOU CAN’T RENDER THAT MANY.

i have proof and i think eeshlo is VERY qualified to back me up on that.

you can physically have more but they don’t work right!!!

Alltaken

Door3: I think I am quite sure of this. Look at the console output when you try your experiment, you should get a stream of ‘lamp overflow’ errors, unless you use some Blender version I don’t know of.
Blender simply does not include more than the first 256 lights it encounters in the scene when doing preparations for rendering, all others are ignored.