- Home /
Lens Flare 'Ignore Layers' Not Functioning
Well, the title says it all, but I'll add some details.
I have two cameras for lens flares, flare 1 and flare 2. Depth is 90 and 91 respectively.
Just for organization's sake, I place these cameras in layers 'flare 1' and 'flare 2' which are at layer indices (indexes?) 25 and 26.
In the camera options I have the culling mask for each camera set to 'flare 1' and 'flare 2.'
Near and far ranges for both cameras are 0.1 to 5000.
The camera type is perspective and orthographic. I needed to have two types of cameras for flares because flares would not align properly in perspective mode except for a few objects.
Now, my main problem is that I just want to have some flares to show in only one layer, while the other flares show for the other.
I created a test GAMEOBJECT (important) and Ignore Layers works when done this way, however ignoring layers did not work when my flare was on a light of any kind.
I was hoping I could just duplicate this functional flare to the object that needs the flare which is situated within a few parent objects, but Ignore Layers just goes back to not responding to my selection once the object's moved within the gameobject's hierarchy.
The main parent and everything below it, minus the objects with flares on them, are in a 'Ship Intro' layer whereas the objects containing the flares are in the 'flare 1' layer so I was wondering if children inherited the parent object's layer. This didn't seem to be the case when I changed the entire object, including parents, over to 'flare 1.' The flare was still duplicated onto the other flare camera.
The flares work, but they are being duplicated onto both cameras regardless of what I do.
I could do a dirty workaround where I only enable the 'flare 2' camera when it's needed, which is like for five seconds at a time, but I feel it's just a little too messy for my taste and I usually like to cut down on how many things are being enabled/disabled through the game.
Well, as usual I'll probably fix this problem (hopefully) before y'all respond because that's how my luck works lol, so thanks in advance just in case that happens.
Answer by Brian-FJ · Oct 31, 2017 at 03:29 PM
Old post but Exsecratus answered this in another old post incase people are still looking for an answer.
http://answers.unity3d.com/questions/1278405/lens-flares-are-rendered-regardless-of-culling-mas.html