- Home /
How to hide anamorphic lens flare when out of camera view and occluded?
Hey everyone,
I noticed that with the introduction of Post Process Stack, some things have changed and anamorphic lens flare, which used to be a feature, is now gone. So I'm trying to setup something using a particle system and scaled anamorphic lens flare texture.
It works in that it renders in front of everything.
Now I'm trying to figure out two things.
First, how do I make it fade out when the sun gets occluded by an opaque mesh object. I don't want it to snap out of existence, but have a quick fade.
Second, how do I make it so when the camera turns and the sun (and flare) are out of sight, the flare itself fades? So in this case, the particle system is not occluded, but the camera no longer sees the sun/flare.
The image below shows the flare. The top has the sun in view, the bottom has the sun out of view (flare out of view as well), yet the flare is still visible and persisting.
The bottom half of the image, it's hard to see so I circled it in red, but the lens flare is still visible when it should have faded out by now.
I would love comprehensive solutions to these issues, and would also welcome any links to tutorials that cover this.
Thanks!
Answer by DawdleDev · Apr 30, 2018 at 07:39 PM
Does this happen to be in-game? It's hard to tell.... Anyway, why don't you just use the components for lens flares? There is a FlareRenderer component for a reason. You might want to try that. It performs quite well.
Hope this helps!
Thanks for the reply. I actually am using the Lens Flare component. In my scene I have a sphere called S$$anonymous$$_Sun and on that I attached the Lens Flare Component. But this lens flare effect is the kind that angles downwards and diagonal across the camera view (as seen below):
I'm trying to make an anamorphic lens flare, a cinematic type. Think JJ Abrams' lens flares in the Star Trek movie. I attached another image below with the skybox hidden and the sun (and lens flare component) also hidden so you can see the anamorphic lens flare:
Or are you saying there's a way to use the Lens Flare component to achieve the anamorphic lens flare look? I don't see any options there to scale the flare and make it long and stretched horizontally.
https://www.youtube.com/watch?v=4jIuW-uwXYo&t=233s This should help. This guy knows a lot more than I do about this, and this video shows how to do EVERYTHING.