Skip to main content
Up and Coming
January 19, 2014

Individual lens flares

I don't expect any answer, honestly.

The quesiton is, how do I select individual lens flare textures for individual cameras? My main two cameras are the character so they have "standard" retina overbright flares, but some other cameras are sort of security cameras, and I want them to have these notorious camera lens flares. From the same light sources, of course. My first idea was to keep track of flare-emitting light sources to change the flare texture right before rendering, but that seems like an overkill.
    This topic has been closed for replies.

    24 replies

    Up and Coming
    January 29, 2014
    "racoon1211" wrote:
    Maybe you get dazzled by the bright lights, but you'll never see lens flares.


    How would you create the dazzling effect in Unity?
    Brevis / DevBlog Twitter
    Participant
    January 29, 2014
    "Lane" wrote:
    "racoon1211" wrote:
    Maybe you get dazzled by the bright lights, but you'll never see lens flares.


    How would you create the dazzling effect in Unity?


    That's a complete another topic - Unity IS artificial.
    What I'm trying to say is: Maybe it's better to not use those "effects" at all?

    Of course they look great in a classic PC Game, but the whole sense behind VR is to keep it as natural as it can be and not to add artificial effects (if possible). Of couse, I don't say "you're not allowed to do that" - it's up to you.
    Up and Coming
    January 29, 2014
    "racoon1211" wrote:
    "Lane" wrote:
    "racoon1211" wrote:
    Maybe you get dazzled by the bright lights, but you'll never see lens flares.


    How would you create the dazzling effect in Unity?


    That's a complete another topic


    Bingo.
    Brevis / DevBlog Twitter
    raidho36Author
    Up and Coming
    January 29, 2014
    Look dude, I'm spending quite a big while testing out different things IN THE RIFT, so I know what I'm doing. I've already figured that light bloom works great to emphatize overbright (since you can't overbright the retina with Rift's panel). I've also figured that I need my own dynamic gamma correction shader since in my game the light levels will vary wildly from even a simple head turn, dynamic range would be extreme.

    I need this lens flare effect to emulate overbright from looking directly at the light source. The bloom is a post-effect so it won't show anything. Using light-emitting objects is out of question since you can't adjust the intensity, only the color. So in LDR it works, but in HDR it's a change between "black" and "pale grey" - nowhere even close to "brilliant white", let alone "sunlight white". Maybe I'll reconsider it to writing my own self-luminance shader that allows intensity adjustment. And besides, not only my protagonist could have cameras instead of real eyes, but there's also a whole bunch of other cameras scattered around e.g. security cameras, and since they have different optics I want them to have different flares.
    sh0v0r
    Up and Coming
    January 31, 2014
    There's a distinct difference between a light flare and a lens flare.

    Regarding looking at headlights or street lights your eyes can see a 'flare' type effect, particularly when you squint, but we don't see the concentric rings typical of camera lens flares.

    Despite this I would argue that unless you are making a strictly simulation/realism focused production then using lens flares in VR is fine because people are so used to seeing them in games and they can look pretty.

    I use lens flares subtly in Lunar Flight as well as the Sun Shafts which give the Sun a nice overall effect when it casts into the cockpit. I also use Light Flares on some of the internal lights which gives them a nice glow.
    Up and Coming
    January 31, 2014
    "sh0v0r" wrote:
    There's a distinct difference between a light flare and a lens flare.

    Regarding looking at headlights or street lights your eyes can see a 'flare' type effect, particularly when you squint, but we don't see the concentric rings typical of camera lens flares.

    Despite this I would argue that unless you are making a strictly simulation/realism focused production then using lens flares in VR is fine because people are so used to seeing them in games and they can look pretty.

    I use lens flares subtly in Lunar Flight as well as the Sun Shafts which give the Sun a nice overall effect when it casts into the cockpit. I also use Light Flares on some of the internal lights which gives them a nice glow.


    Nobody is saying they're the same, only the point that you would use Lens Flare components to create most optical effects regardless of whether or not its actually a lens flare.

    Heck, some modern FPS games even use dirt effects on the screen when the character isn't even wearing any kind of glasses/screen over their eyes. It's effects, games use them. If they didn't improve aesthetics then there wouldn't be post effects.
    Brevis / DevBlog Twitter
    sh0v0r
    Up and Coming
    January 31, 2014
    "Lane" wrote:
    "sh0v0r" wrote:
    There's a distinct difference between a light flare and a lens flare.

    Regarding looking at headlights or street lights your eyes can see a 'flare' type effect, particularly when you squint, but we don't see the concentric rings typical of camera lens flares.

    Despite this I would argue that unless you are making a strictly simulation/realism focused production then using lens flares in VR is fine because people are so used to seeing them in games and they can look pretty.

    I use lens flares subtly in Lunar Flight as well as the Sun Shafts which give the Sun a nice overall effect when it casts into the cockpit. I also use Light Flares on some of the internal lights which gives them a nice glow.


    Nobody is saying they're the same, only the point that you would use Lens Flare components to create most optical effects regardless of whether or not its actually a lens flare.

    Heck, some modern FPS games even use dirt effects on the screen when the character isn't even wearing any kind of glasses/screen over their eyes. It's effects, games use them. If they didn't improve aesthetics then there wouldn't be post effects.


    Well you sort of indirectly argued that a 'Lens Flare' is the same as looking at a headlight rather than pointing out the difference between a 'flare' and a 'lens flare' which in the context of games is usually a camera lens.
    raidho36Author
    Up and Coming
    January 31, 2014
    First off, I'm only going to implement Rift-cameras lens flares IF the character actually has lens system in their eyes. However, even with single-lens natural eyes, you still need to visualise a light source somehow - nothing to do with "looks pretty". And in game engines you do this with flares. This is what they called. We're not discussing scientific terms' meaning here, thank you very much.
    Participant
    January 31, 2014
    I'm sorry if someone feels offended by my last posts here, I just wanted to tell you guys my thoughts.
    Lens flares really can look very pretty.

    The other effect that was mentioned here, was the "dirt" effect which was a rather bad example in my opinion.
    It's a totally different thing if you have dirt effects on your monitor screen or in the rift (directly in your face, because the screen doesn't exist in the rift).

    Again, sorry if someone feels offended - I really didn't mean it that way.
    Up and Coming
    May 13, 2014
    It seems there is some confusion about how to use lens flares in VR, or in games in general. This is understandable as there is nearly an endless stream of information available about how to render the effect a light has on a surface. But there is very little information available about how the light source should look like itself. Which is interesting. Not sure why that is.

    Anyway, I did a bit of research into this subject and this is what I found.

    There are a few different type of lens flares.

    Multiple elements lens flare:

    I think everyone agrees (and this is probably what racoon1211 is referring to) that you can't see a multiple elements lens flare with the naked eye. They are caused by refractions within a multiple lens setup. We have only once lens per eye and so you are not going to see this with the naked eye.

    Single lens fare:

    Single lens flares however, are visible to the naked eye. They do not tend to be very big though and the effect in games is often exaggerated. But if you stare into a bright light through glass, the lens flare increases in size significantly. So large lens flares can still be a realistic effect in VR if you are in a car, cockpit, or in a house staring through a window. The other single lens flares should be kept small.

    Streak:

    Streaks only seem to be visible if you view them through glass which has miniscule scratches in the same direction, such glass slightly scratched by windshield wipers. One other way to view them is if you squint your eyes. So this again, can be a valid effect in VR if you do it right.

    Bloom / glare:

    Bloom or glare is often visible together with other lens flares. Like other lens flares, it is caused by scattering of light inside a lens and can definitely be visible to the naked eye, although a light has to be fairly bright in order for this effect to show up. Another situation when bloom is very pronounced is on a foggy day. In this case it is not a lens flare technically as the light is not scattered by a lens but by the fog instead. The effect is the same though and when done right, it does look very nice and realistic in VR.

    Lens dirt:

    Lens dirt is not visible to the naked eye but can be very visible when viewing through a window of some kind. To a lesser extend it can be visible with prescription glasses as well. The most pronounced effect of lens dirt can be seen when viewing through glass on a rainy day. In this case the flare effect is caused by water but the effect is the same. If lens dirt on a window is simulated, the dirt or water droplet texture should be attached to the actual window in 3D, not to the screen. This is to allow for physically correct depth perception and should look awesome if positional tracking is used as well.

    One thing you have to watch out for is not making a lens flare look like a cardboard sprite. They should have proper 3d depth look to it. Bloom is a special case because it shouldn't have any cutoff or threshold so you can't use textures for that, not if you want to make it look realistic that is.

    All in all, lens flares and bloom can be used to create an HDR experience on a LDR monitor, and if done right, it can look perfectly realistic as well. Here is a demo you can use to experiment with bloom effects in VR:
    viewtopic.php?f=42&t=8423
    As you can see, it has a proper 3d look to it and it greatly enhances the apparent brightness of the lights.

    Edit:
    Lens dirt added.