- Home /
Lens flare not showing up
Why aren't lens flares working!?
My camera has a flare layer
My camera has the flare layer turned on
The lens flare is positioned in front of the camera, about 20 units away
The lens flare is NOT attached to a light, but rather is attached to an otherwise empty object
The lens flare has directional unchecked
The object is on default layer
The lens flare is set to ignore nothing
The camera's far plane is 1000, so the flare is in view
The flare is perfectly viewable in the scene view
There are no objects between it and the camera, let alone colliders
The flare has a texture, and it's bright enough
I've tried attaching the flare to a point light as well
The flare works fine in the scene view, but not in the game view. What's going wrong!?
EDIT: Another odd thing is that in older projects where the flares used to work, they don't anymore. This also happens with GUIText. This is a very strange problem.
Is its brightness high enough?
Is its color bright enough?
Are there any colliders placed between the camera and the flare?
The last of which is most likely your problem. Flares automatically fade off when covered up by a collider, unless that collider's layer is in the "ignore layers". So by adding all layers to the ignore layer you can easily test this case.
Beyond that I'm not quite sure. I have had a few issues with lens flares not showing, so it may be something else.
Hope this helps!
Even in an empty scene with nothing but a flare and the main camera, it doesn't work, so colliders aren't the problem As for your other two ideas, the flare is unedited. I give an object a flare (with a flare texture) and it doesn't work.
Answer by Orion_78 · May 28, 2015 at 07:06 AM
Ok, I fixed it :
simply think to add the lens layer on each Oculus camera.
Thanks Orion - your solution gave me a clue to my solution too - If you are using google VR for Cardboard or Daydream, you must add Flare layers to the cameras that are automatically produced to make the Stereoscopic effect (run your game and look at the Scene mode in the hierarchy, and you will see two new child object, one camera for each eye).
To fix this, I made a simple workaround -
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class addflares : $$anonymous$$onoBehaviour {
public GameObject rightEye;
public GameObject leftEye;
void Start (){
Invoke("addFlarez",1f);
}
public void addFlarez (){
rightEye = GameObject.Find ("GvrViewer$$anonymous$$ain Right");
rightEye.AddComponent<FlareLayer> ();
leftEye = GameObject.Find ("GvrViewer$$anonymous$$ain Left");
leftEye.AddComponent<FlareLayer> ();
}
}
Should help out other people who are not seeing flares while using the Google SD$$anonymous$$ for VR.
To those who come here confused by these two answers: A "Flare Layer" is a CO$$anonymous$$PONENT that you add to a game object NOT like a custom unity layer that you make.
Answer by Lukey_BlueNose · Nov 17, 2018 at 12:07 AM
Just wanted to add this for anyone who isn't adept at code.
Add component > Flare layer, to each of the three ovr cameras, 'Left eye anchor' right eye anchor' and 'centerEyeAnchor'.
Might be a bit basic for this thread but thought it might help someone.
Answer by Ronsu900 · Sep 24, 2015 at 02:28 AM
Perhaps they are fixed problem already, but possibly my answer helpful for somebody come from google.
I encountered same problem, but only few flares (e.g. "Sun(from space)" and "Laser" in standard assets) worked. common point on these is "Use Fog" property on .flare assets.
other few flares also be works when "Use Fog" property checked out. but still few flares (e.g. Subtle1,2,3) seems not work ever.
In my case, not showed both (scene view and game view) when use no showing flares. therefore may be not same cause for original poster, but few case on same problem, perhaps clue of cause is related fog properties?
Thanks mate! This really helped me, even if it's not the answer to the original problem, it was the answer to $$anonymous$$e :)
THAN$$anonymous$$ YOU!!!! We spent HOURS on this. You SOLVED it!
Answer by lancer · Aug 05, 2013 at 05:35 PM
Whenever I do flares I add a point light and select a flare form the flare menu.
Your answer
Follow this Question
Related Questions
Cannot change Lens Flare Ignore Layers list 1 Answer
Lens Flare disappears when far from camera 4 Answers
Dirty Lens effect like BF3 2 Answers
When are Lens Flares rendered? 1 Answer