Need help with sun and light flare / lens flare
I'm having a hard time understanding how flares work in Unity and looking for some help. I have a space scene where a directional light travels around an asteroid (in this reality, Copernicus was wrong!). This creates the illusion that the asteroid is rotating and provides a day/night cycle. Of course, the asteroid is static, and it is the "sun" that is orbiting.
So we have a directional light that orbits the asteroid (which is our main game object world), and the light is always pointed toward the center of the asteroid. So far, so good.
The problem is introduced when I try to get the sun to have a flare. Initially, the way I was doing this, was by not showing a visible sun... because when I added a flare, it looked like the sun itself.
See, great looking sun, right? But the truth is, this is part of the lens flare. And it's almost okay to leave as is, except, because it is a lens flare it fades out sometimes and is no longer visible. And, it creates confusion because our game uses a solar charging features... and you see the sun high in the sky, and wonder why you aren't charging, when in reality, that isn't the sun.
When I enable the mesh renderer on the Sun object (which contains the directional light), you can see further problems:
So now you can see where the sun actually is... but it looks less like a sun than the lens flare. So I guess my questions are:
1) How do I get the lens flare to center on the light source itself? So it is a light flare?
2) It it simply a matter of making a texture on the light that billboards to the camera? Right now the sun has a sphere mesh renderer on it. Is this the best approach?
3) How do I find out what the different elements in a lens flare sprite do? If there are 5 sprites in the spritesheet for a lens flare, how are they distributed in relation to the light source?
Your answer
![](https://koobas.hobune.stream/wayback/20220612205516im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Unity Lens Flare Disappears at distance 1 Answer
LENSFLARE PROBLEMS 0 Answers
Sun flare occlusion not working properly 1 Answer
Controlling Lens Flare rotation 0 Answers
Distance lens flare jittering everywhere 0 Answers