"Too many layers used...Up to 4 layers can be used to exclude lights..."

WTF?

I wanted to add some rim light to an object, and I selected the layer mask on the light to light that object only… and Unity flat out says it won’t do it?

I think this is my first ever real WFT moment with Unity and UT (or OTEE) in my 3+ years.

What analogy of lighting is being used in 3.2?

I’m trying to set up lights for light mapping, so I don’t care what happens at run-time. We’ve got Beast to lightmap our static objects. Why can’t we isolate the lights on them?

Do we need a lightmapping mode in the editor?

Am I missing something obvious?

I hope so.

Well, and it seems that Beast doesn’t respect the layer mask when rendering anyway:

In a quick test scene, I’m trying to rim light the chests to make them stand out from the background, but not light the floor or central pedestal.

Simple test:

Scene in editor (not lightmaps) that needs work on the chests… they disappear into the BG.

Then mapped:

The chest need a rimlight to make them visible:

But when you try to add a rimlight…

Light maps off (note first try at rim lighting the chests, but no light on floor or pedestal)

Light maps on (note huge light spill on floor)

How are you supposed to control your lights in this situation?

What it the expected pipeline? Beast was designed to work with Unity, so someone MUST have put some thought into the lighting and rendering pipeline. There are some nice architectural renderings of Beast in Unity…

SO -

For GAMES (not ARCHITECTURE - no setting texel to world units to 500), how are we supposed to set up complex lighting? If I want control over what I’m lighting and baking in my game, mixing interior and exterior lighting in the same scene (large room with hole in the roof? big windows?), want to use basic bone-headed “lighting-101” 3-point (key, fill, rim) lighting while controlling spill?

What was the plan? It’s in none of the docs.

Baked rim lighting doesn’t work for moving scenes, so I’m assuming the camera in test image you’re doing wont change position, right? Otherwise what you’re doing will look wrong as soon as it moves if you’re trying to bake rim lighting into it.

If the camera does move, use a shader with rim lighting (there’s at least one on the wiki that I know about), that’ll quickly solve your problem.

If it doesn’t move, bake the scene, rename the lightmap, bake the chests with the 3 point setup, put the two lightmaps together in Photoshop. Or draw the lighting in by hand, whatever works best for you.

I ran into this the other day. I had a scene where you were indoors (one set of lighting) looking through a window outdoors (another set of lighting) and I wanted to bake the two sets of lighting separately with Beast. Since you can only have one set of lightmaps per scene, I wanted to exclude internal objects from outside lights and visa versa. Apparently you can’t do that with Beast. :expressionless:

The 4 exclusion layer issue has nothing to do with beast that I know of, but to do with Deferred Rendering. Deferred can only exclude up to 4 layers overall in an entire scene from any lights. Are you using Deferred rendering or Forward?

So what happens when someone additively loads another scene into a scene (like for moving seamlessly into new area’s without load screens). I’m sure Unity doesn’t just replace the previous lightmaps with the new scenes maps, or that would suddenly make a whole bunch of usefulness, useless, and a hundred Unity MMO “developers” would have all screamed at once, surely?

You are correct, and perhaps this particular scene was a bad example. If I were to use Classic/Classic studio lighting, then anything or everything “off camera” would be hard to view. A classic rim-light would leave a super-hot burned-out ‘backside’ to the object.

In this particular case it is a static camera that I’m using to: 1) Test lighting and lightmapping. 2) Will be used in a demo for a system for the assets store…

But… my bad example aside…

(And I really appreciate your feedback…)

… Am I really expected to hand draw lighting on my lightmap in photoshop? Even combining two passes by hand seems like a work-around for a seriously flawed system. I might as well pre-bake in Blender or some other 3rd party application. I was hoping to assemble, light and bake within Unity.

There has to be a better pipe-line than this!

I use a modified version of 3-point lighting (which in-case readers are unclear what this is: Three-point lighting - Wikipedia) which I use to keep character and shape on my objects and my rooms. Often I find that I need to fake my own bounce or spread within a large space, which is fine. Beast is too unpredictable for me when trying to use few lights and let the bounces and fills work during baking.

But I was surprised to find that when doing “closeup work” for the first time, that layer masking has essentially been abandoned by Unity (4 layers?) and is completely ignored by Beast.

I find that cookies work sometimes and not others. This thread implies that it’s based on text density: Lightmap question, Cookie and IES lights - Unity Engine - Unity Discussions but my experimentation shows it is not texel density. I’ve created working cookies that work from 1 texel per world unit up to 500, but at other times when I’m actually lighting I can’t get cookies to work, and I can’t figure out why.

Does anyone know when cookies work and when they don’t? I have seen nothing official on this.

Clearly layer masks are ignored. I have yet to see this documented.

But I’d really like to hear what people are using for pipelines, and what the actual rules are, so I’m not spending my day just shooting in the dark and guessing.

Was your reply directed at me or little angel? I’m using deferred and will ultimately use 1 active light for real time shadows in my scene when it gets finished (but I’m using a half dozen lights to separately light my outdoor and indoor areas). I simply wanted to bake two separately lit areas in a single scene using Beast as it affords me the best means to see what the entire scene will look like before I bake it. Since I can’t do it that way, I’ll have to re-import all the pieces into Blender and bake it there. This was my first attempt at building a new project in 3.x and first attempt at using Beast so I’m learning as I go along. I was initially very impressed with how nicely Beast rendered the lightmaps, but this limitation basically puts it back on the shelf and unusable for this particular project (unless there’s another way to do it that I’ve not tried).

As I understand it, that’s exactly how it would work. New scene = new lightmap. I remember seeing a thread about sharing lightmaps between scenes, but don’t recall if there’s a workaround or not. Again, I’m still learning this feature and would gladly learn that I’m completely wrong. :wink:

My reply was directed at anyone seeing the 4 layer exclusion limit and was point out that THAT specific issue is a Deferred rendering path issue.

As to the layers not being recognised by beast… that’s a whole other issue :frowning:

You also have the ability at runtime via scripting to control the lightmap settings so you can bake multiple sets of LM for your scene and swap them out via script at runtime when a player walks inside or outside.

Sorry. I cross-posted. I was writing while others were replying.

I assume each level points to it’s own lightmap… as they seem to be named the same as the level name. I would assume that it would additively load the light maps as it loaded the level, which means Big Kahuna would have to do both environments as a different scene and load them together. Mmmm…

You seem to be correct. I hadn’t noticed that. I’ve read up on the lighting paths a couple of times, and they are not yet under my skin. I don’t really need all the bells and whistle of deferred rendering and dual lightmapping. I just want a nice baked light map.

Maybe I wasn’t that far off the mark when I was suggesting a new render setting: “Lightmapping”, or a mode for “lighting lab” or “studio” where the lights are baked… Dunno.

I’d still like to see some tutorials or pipeline models with real-world examples of lightmapping.

[edit]

And yes, Seon, you are still correct in that regardless of what mode of lighting, Beast does ignore the layer mask.

[/edit]

I need to go through the docs again, I don’t recall reading anything about how to bake multiple sets of LM’s. Now that I know that’s possible, I’ll have to go back and look for more info on it.

It’s not in the docs… here are the steps.

  1. Bake your initial lightmap(s).
  2. Duplicate them all and name them appropriately.
  3. Bake new set with new lighting
  4. Repeat steps 2-3 as needed…

Then you can put them all in the Resources folder (or link to them via a level manager script) and set the correct texture per lightmap via script as needed.

It’s not uber neat… but works a treat. I swap lightmaps out often and try to keep my scenes to 1 map when I can to make it easier.

That was my reaction as well. I may be missing the whole concept of how Beast and deferred lighting should be used, but what I’m trying to do is to replace my old workflow which was:

Build 3D parts in Blender.
Assemble 3D scene in Blender.
Bake 3D scene in Blender.
Import into Unity.

With this workflow:

Build 3D parts in Blender.
Assemble 3D scene in Unity.
Bake 3D scene in Unity.

Ok just tested it with the first scene loading in the contents of a second scene, and PHEW, doesn’t remove the other lightmap (though did notice a slight jump in the map, not sure whats causing that).

But because of this appearing to work ok, wouldn’t it mean then that you guys could actually do the specialized lighting with fewer problems by simply splitting the scenes apart and just loading them all in when the game is run, so the end user sees a complete level. I know it’s not a perfect solution by any means, but it would work, and wouldn’t be too much of an issue to setup (just annoying to make changes later on).

I think I follow you (and thanks for explaining this) but how would I be able to use this for a scene where I’m indoors (one set of lighting) looking outdoors through a window (another set of lighting)? I can see where this method might be useful if I’m walking from outdoors (brightly lit) into the entrance to a cave (dimly lit, no sunlight). But I’m having a hard time understanding how I might use this same method to combine two separate lightmaps.

Big Kahuna: IIRC, the theory is that you can find the value or property that is set with the light map and you can repoint it, as it’s just a setting. Then you’d have to bake your level, rename the maps so they didn’t get over-written, bake again (and perhaps rename again just to be safe… not a bad habit), but in your case, I’m not sure how much that would help, as you are trying to bake two different things. If you have the same objects on when the light map is baked, then the object’s uv’s are properly accounted for and pointed to the light map/atlas. But if you did half of your objects inone scene and then the other half of your objects… you’d have to experiment to see if you can point objects or sets of objects to a particular map, rather than replacing the map for an entire scene.

http://answers.unity3d.com/questions/22926/how-to-add-new-baked-lightmaps-to-lightmap-array

Perhaps this is what Seon is suggesting? Make my indoor lighting one scene, the outdoor lighting a second scene and append the second scene to the first? That’s an interesting idea if it works.

In that instance I really don’t see why you cant bake then entire scene at once? I have many scenes with indoors, outdoors, underground etc all in one scene and all bakes in one hit. I have 1 directional light used for sunlight and all other lighting is done via point and spot lights (plus some self illuminated shaders) and it works a treat.

Why does your scene need to be broken down into multiple bakes? Is it that massive and complex?