More than 2 lights

hi,

i’m new to unity, searched on the forum but didn’t find a solution to my problem.

i want to make a simple room with several spotlights in it. this is an art gallery and every art object has to be lit by a spotlight.

as soon as i add more than 2 lights, i have some weird results. i discovered that due to my rendering path set to Forward, if i add more than two lights the other ones will be vertex-lit instead of pixel. so i tried to set all of my spotlights to important instead of automatic but still no good result.

what’s the best approach to solve this ?

here’s 3 screenshots of my scene :

1 overall to see the complete scene
1 with two lights on
1 with three lights on

Increase the number of pixel lights in the quality settings.

–Eric

1 Like

“Important” should have the same effect, though. :face_with_spiral_eyes:

No it won’t have that effect.
Important only marks them as pixel lights so in the end it makes it ‘worse’ cause you hit pixel light count even faster :slight_smile:

Don’t forget that the quality setting there is for ‘pixel light affecting an object’ not for ‘pixel lights in the scene’ so if you hit it too regularly with a 4 pixel light count, you should stop making so large meshes cause the whole mesh is redrawn with a transparent shader for each light that hits it → fillrate bomb if you turn the count up and up instead of fixing basic art problems.

i tried to increase pixel light value count for every quality but it didn’t help out. always the same result : my three spotlights in important mode but only 2 lite correcly.

i’m not sure to understand the “standard/good” way to do those kind of work with multiple lights ? could someone explain me how to manage multiple lights ?

Since you specify every art object has to be lit, why not lightmap?

sure, can you explain me cause i tried lightmapping but since i’m new, i’m not sure to master the concept.

here’s what i get once i bake the lightmap :
before lightmap

and with lightmap

go to the mesh import screen and select ‘generate 2nd uv channel’
you pretty surely have an inbuilt uv channel that is totally incorrect for lightmap usage and if you force Beast to use it, the lightmap will end this messed up (as it is the same on every cube its not recaculating the 2nd uv basing on the position in the scene)

sooo,

i’ve no internet at home for the moment therefore i reply from a post where i can’t access my unity scene.

anyway, i’ll explain it without pictures :

when i created the uv’s inside unity, it changed me some of the textures assigned to my cubes. i have 3 different textures for the cubes : mud, rock, mudRock the uv’s are made inside my modeling package (modo 501) but that screwed up my textures when baking lightmaping

as you suggested, i used the generate uv’s from unity but some blocks with mud texture were replaced by rock texture ???

plus, it didn’t solve my problem of having 3 or more spot lights in my scene… only 2 of them are showing up correctly, the third screw up the scene even when changing the amount of pixel lights in the quality settings.

so there are my questions :

  1. what’s a proper uv layout because i made a uv layout in my 3d editor (modo) but apparently it wasn’t the good way for unity ? (i’d like to coninue making my uv’s in the 3d package instead of unity)

  2. how can i have more than 2 spotlights (lightmapped or not) in a scene ?

  3. what’s the overall approach for the lightning of a scene in a game environment ?

thanks,

dreamora : too bad you’re not living just a tiny but closer :wink:

Creating UVs in your 3d app is of course the way to go. For secondary UVs (used for lightmapping) you can create them in your 3d app or have Unity create them. The texture swapping you’re seeing makes me think that you need to select Swap UVs in the import settings.

As far as the pixel lights goes, make sure you’re changing the quality settings for the Editor. Editor’s default quality setting is Good.

so if i got you, to lightmap a scene, the objects have their own uv and i have to add another one for the lightmap ?

what’s the way to create the lightmap uvs in my modeling package ?

for the quality settings, i put them all to 10 (good, editors…) but nothing changed :frowning:

Just use unity import settings to generate the lightmap uvs.

  1. click the model in Project Window
  2. tick Generate Lightmap UVs
    3…READ MANUAL

Seriously, read the manual. Find out everything unity can do. It can do a LOT.

I have a question about beast uv settings tangentially related:

I imported a bunch of models out of zbrush that were decimated and uv mapped using uvmaster just to get something quickly.

When I brought them into unity I did not select generate light map uvs on import.

When I baked using beast, the lightmaps display great… is beast generating uvs at bake time… or did I somehow have uvs for light maps already?

If Unity finds a set of non-overlapping UVs in the 0-1 range in the primary UV set then it will simply use that for the lightmap UVs as well.

yeah thanks,

i’m actually reading the manual top to bottom and left to right but as i have to learn everything about this software, i sometimes shuffled my feet and lose the thread…

i’ve already generated the lightmap uv’s and that’s when the problem came up. i read that there are several things to check for the uv to be “readable” by unity (non-overlaping, coordinates…) and my uvs were made this way (see screenshot below) so i don’t understand why unity gave me the weird result (see screenshots above). that’s why i’m asking how to generate lightmap uv because maybe i forgot something.

my uv map for the cubes :
768044--28082--$cube_uv.jpg

but thanks hippocoder, now i know i was checking the right checkbox at least :slight_smile: i thought there was maybe another option i missed…

this lead me to another question :

when i import my mesh into unity, it is converted as tris (instead of 4 points polys). does unity convert the uv’s accordingly ?

thanks !

PS the pixel light number now works