Camera Flares, are they worth it?

Blitz3D Forums/Blitz3D Programming/Camera Flares, are they worth it?

Lilprog(Posted 2004) [#1]
Ok, I just got done implimenting Swifts shadow system and it looks nice. I cant wait to finish my stadium editor so I can see everything full tilt. Im considering putting a camera flare in to add to the realism, but my question is, are there good algorythms out there for camera flares and are they worth it? Or do they just bog down the fps.

Rob


Rob Farley(Posted 2004) [#2]
Lens flare is good if you're pretending your view is from a TV camera, if you're first person then it looks odd as eyes don't suffer from lens flare.


Picklesworth(Posted 2004) [#3]
However, a glare from the light using bloom filter or something, and the view getting brighter when you stare directly at a light is quite attractive. Also, farcry has an effect for flashbangs that could be used for any light source; if you stare at an intense light for a while, the view is obstructed temporarily by a bunch of distracting light coloured shapes.


Warren(Posted 2004) [#4]
If it makes your game look cooler, go for it. Don't bother yourself about camera lenses and what human eyes do in real life regarding light. Do what looks good.


Tom(Posted 2004) [#5]
Sun flares could be used as a tactical advantage depending on the game, blind the enemy e.t.c

No need for realtime bloom effects, just get yourself a quad or sprite and fade it in/out as necessary.

Cya!
Tom


jfk EO-11110(Posted 2004) [#6]
I dropped lightbulb corona fx cause they were so slow due to multiple linepicks (bulb visibility).


Rob(Posted 2004) [#7]
eyes don't suffer from lens flare
drop a tab of acid and try walking home from your mates house late at night and then say that...


Barliesque(Posted 2004) [#8]
If you wear glasses, then you can see lens flares pretty naturally. Mind you, with all the new coatings they have these days, mine don't give me too much trouble.

Lens flare is good if you're pretending your view is from a TV camera, if you're first person then it looks odd as eyes don't suffer from lens flare.

Well, really, looking at a computer monitor is a lot more like looking through a camera than seeing the environment directly with your own eyes. An intensely bright glare from the sun is impossible to recreate, so lens flares can add a great sense of realism.

Coincidentally, I've *just* finished putting the final touches on my lens flare system. ...Looking up at the sun through a red stained-glass ceiling...



I think I've managed to produce the most realistic lens flare I've ever seen in a realtime environment---you do have to see it in motion for the full effect. It's taken a lot of doing, but I think it was worth it. The performance hit is not bad either. I'll post the code for this soon.


Rob Farley(Posted 2004) [#9]
I think I've managed to produce the most realistic lens flare I've ever seen in a realtime environment.
I don't mean to sound rude, but it looks like many other lens flare effects... Don't get me wrong, it's very good, and very pretty. Maybe it needs to be seen in action to be appreciated.


aCiD2(Posted 2004) [#10]
Avi! Avi! ;)

Im personally a fan of lens flares. Because of the fact that computers only have a limited shades of light and the human eye has thousands, they really can add realism. If i look directly at the sun, i dont see a big yellow ball. I squint, and see a lot of 'brightness' :P


Barliesque(Posted 2004) [#11]
What you don't see in this still image are these features:
- The flare images are tinted by the colour of the light source
- Flares change size and intensity depending on how directly you look into the source

I'll put together a demo as soon as I get a chance.


Rob Farley(Posted 2004) [#12]
Cool, I'd like to see it. I like lens flare effects. If there's not much frame rate hit it's certainly something I'll be adding to my Carrier Command remake.


aCiD2(Posted 2004) [#13]
Wheres the demo :P


Barliesque(Posted 2004) [#14]
...coming soon! Sorry, been hectic with too many other things. :)


*(Posted 2004) [#15]
Ive whacked a lens flare effect into Fury Squadron (may add it to Hunted seeing as its a include :) ). IMHO Lens flares are eye candy but they do add a lot to a game :)


Barliesque(Posted 2004) [#16]
Okay! Demo now available from the code archives...

http://www.blitzbasic.com/codearcs/codearcs.php?code=1107

...I've still got some tweaks to make to it. Please let me know how you find the performance. The flare tinting feature does slow things down a bit, I must admit. So far, I find it quite acceptable. Although, I find that looking at the sun through the leaves of the tree in the demo couses a severe slowdown--possibly because the leaf texture uses masking, rather than an alpha channel. I'm still experimenting! :)


AntonyWells(Posted 2004) [#17]
Definitely worth adding.

In full metal conflict, I went flare crazy. Build a engine that let me tag 'em anyway. And believe, the day you fire a rocket in your game and the engine casts a sparkling bloomed lens flare...is the day you're..well, happy? i was..;)


Barliesque(Posted 2004) [#18]
...No problems now. ...Looking at the sun through the tree was only going slow because I'd compiled in debug mode. It's very fast. So visit the code archives, and download the demo!

http://www.blitzbasic.com/codearcs/codearcs.php?code=1107




VIP3R(Posted 2004) [#19]
@Barliesque

Very nice flare effect :)

Maybe you should post it in the Blitz Showcase thread too, you may get a lot more feedback.


Banshee(Posted 2004) [#20]
"Im considering putting a camera flare in to add to the realism"

I've never known any other special effect to look less real than a lense flare, or to have it's presence justified as a realism element quite as often.

They where cool when I first saw them running on a PowerVR card because it was something new and funky. Now they are more heavily used than the M25 London Orbital, and no more realistic.


JoshK(Posted 2004) [#21]
A lot of people here don't like good graphics because it reminds them of what losers they are. Camera flares are a great-looking effect, and easy to implement. Here are some tips to keep the speed up.


-Only update flares before the RenderWorld()

-Have a distance fade so you don't have to check visibility past a certain range.

-You can skip updates so that you only check visiblity every other time, or every 20th time.

-Keep separate copies of the objects that make up your map for collision/occlusion. Do not merge these collision objects.

-For staticmesh-type geometry, run a check on the bounding box of the mesh, then run a check on the complex mesh if the bounding box intersects.


Warren(Posted 2004) [#22]
A lot of people here don't like good graphics because it reminds them of what losers they are.

Your contribution is valued.


Banshee(Posted 2004) [#23]
"A lot of people here don't like good graphics because it reminds them of what losers they are"

Gee thanks.

Actually I just really dont like lenseflare. I do like good graphics but dont understand how lenseflare comes into that.

I wear glasses and even my old set without a coating never, ever, had lenseflare. The original question was asked in the context of, "Im considering putting a camera flare in to add to the realism"

My response to that is, it isn't realistic.

It's nothing to do with me being a looser. All that has to do with anything is why I dont get the girls....

Doh, didn't meen to admit that.


scribbla(Posted 2004) [#24]
seeing stuff like this only reminds me im no good at coding..:(...keep it, it looks cool


Barliesque(Posted 2004) [#25]
@Andy Igoe:
I do understand what you're saying. :) And, I partly agree.

If you spend a lot of time looking through a movie camera, then you'll certainly see lens flares as a natural and realistic element. But you're right-- lens flares generally don't happen with the naked eye. Certainly not the type that I've demonstrated here---however, I've been noticing lately that a certain kind of glare *does* occur naturally: if you squint at a light source you'll see a cross spread. If you wear glasses, this is even more pronounced. Even if you don't wear glasses or squint, you can see a glow around the light source. In any case, there are more subtle kinds of flares that do add to realism, even if this type is a bit strong for your liking.

My hope is that girls like big flares. ;) But if you think they'd prefer little ones (*snicker*) ...then have a go with my demo at making a more subtle type of flare. And be sure to post your settings and flare image!

Something else to remember: As long as your game is seen through a monitor, it will *never* be the same as viewing the virtual world directly with the naked eye. So I think that using the conventions of a video camera do lend a sense of realism. I've found that most attempts at the extravagant kind of flare I've demonstrated are lacking in realism as seen through a camera. I think my demo gets a good deal closer than I've seen before... but it can still go further.

@VIP3R:
Maybe you should post it in the Blitz Showcase thread too, you may get a lot more feedback.

Good idea! I'm working on adding several new features to handle all your flares automatically and to allow a greater variety of flare styles. So, I think I'll post to the showcase when that's ready.


Warren(Posted 2004) [#26]
The glows are not the same as lens flares. Different phenomenon.

Having said that, lens flares look cool and are easy to code. Keep 'em.


Barliesque(Posted 2004) [#27]
The glows are not the same as lens flares. Different phenomenon.

True. Coding-wise, they get handled the same though.

Having said that, lens flares look cool and are easy to code. Keep 'em.

The bit that wasn't so easy was finding a way to get the colour of the lightsource for when there's a stained glass between you and the sun. I'm rather proud of that little trick --and amazed it didn't gobble up more performance.

Actually I think realism is overrated. I want my projects to look like works of art! ...I absolutely *love* the look of that "Black Light" demo by Big&. Perfect example of how realism comes a distant second place to sheer beauty.


podperson(Posted 2004) [#28]
Lens flares and bloom effects are a good way of faking the appearance of a bright light. (True, eyeballs don't get lens flares -- which are caused by internal reflections in multi-element lenses.)

If you really wanted to handle lighting properly, (1) you'd make the scene DARKER when you're staring at a bright object though, (2) after someone looks at a bright scene it should get inverted and stamped onto a translucent overlay, which then fades gradually. (This would be a seriously cool effect. Filax? :) )

One thing we haven't seen in graphics pipelines yet is good (any?) support for open-ended lighting (we have floating point RGB values, but they don't deal with brightness beyond 1.0). Maybe this is because John Carmarck only does dimly lit game engines... An example of this is when you emerge from a torchlit cave into bright sunlight, the outdoor scene ought to be blindingly bright until your eyes adjust. When you look into the torchlit cave from outside it should look utterly dark.

Edit: oh yeah, lens flares should be ON TOP OF THE PICTURE. Distant objects partially obscuring a bright object will either completely eliminate the lens flare, split it into multiple lens flares, or reduce its size. The lens flare isn't part of the bright object -- it's a bunch of reflections inside your lens, and your lens is closer to you than the object.

Barliesque's examples look right, but I'm constantly amazed by lens flares that are obscured by background objects.

Edit2: oh -- the number of different elements in a lens flare should be determined by the number of lens elements, which tends to be higher for complex lens (e.g. zoom lens). Also, if a zoom lens zooms, the elements should move around and change size in some vaguely consistent manner (if you want to be really cool ;) ).


JoshK(Posted 2004) [#29]
I see lense flares all the time.


Warren(Posted 2004) [#30]
One thing we haven't seen in graphics pipelines yet is good (any?) support for open-ended lighting (we have floating point RGB values, but they don't deal with brightness beyond 1.0). Maybe this is because John Carmarck only does dimly lit game engines... An example of this is when you emerge from a torchlit cave into bright sunlight, the outdoor scene ought to be blindingly bright until your eyes adjust. When you look into the torchlit cave from outside it should look utterly dark.

We've experimented with that at Epic, but it just isn't fun. I think we've implemented it twice now in various engines for various game ideas and it just doesn't feel good. It always comes off as an annoying hinderence rather than any kind of "oh neat!" optical effect.