[Solved kind of] Sun Glare

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
empirepro
Posts: 71
Joined: Thu Dec 27, 2007 5:41 am

[Solved kind of] Sun Glare

Post by empirepro »

How would I go about producing sun glare? You would be flying around in 3D space so the sun's location wouldn't always be in the same location like it is in some land based games. I am guessing you would use billboards with a alpha texture but how about the location problem? Thanks for any help you can provide!

Edit: I found a lens flare scene node however I am having problems getting it to work.
Last edited by empirepro on Fri Jul 18, 2008 11:48 am, edited 1 time in total.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

sun glare as in a lens flare? or a halo around the sun?

someone did a lens flare scene node before so you can probably search for it, i don't know if source was provided but they may have explained it.

a halo would be done with a glow shader perhaps.

what do you mean about the location problem? what is the problem, can you explain a bit better?
Image Image Image
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

That technique is commonly (by which I mean always) called "lens flare". Here's your free search result; if that doesn't do what you want, then the search function will provide alternatives.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Oh, you've already found it. It's customary to re-title your posts with [solved] once you've figured something out, so that people don't waste their time helping you. It's not a bottomless well.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
torleif
Posts: 188
Joined: Mon Jun 30, 2008 4:53 am

Post by torleif »

I just fixed up LensFlareSceneNode for irrlicht 1.4.1 and put it in a zip to make it easier to use. Copy it to your code and read readme.txt


You can download the camera flare for irrlicht here (ZIP, 11.4 KB)
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

Nice one, maybe this can go in IrrExt!
Image Image Image
kornwaretm
Competition winner
Posts: 189
Joined: Tue Oct 16, 2007 3:53 am
Location: Indonesia
Contact:

Post by kornwaretm »

lens flare != sun glare
when sun light hit clouds, some of the light energy will be absorb by the cloud.
It makes the clouds looks brighter, and the sun looks so glaring.

I think its about making post processing shader effect.
pera
Posts: 460
Joined: Wed May 14, 2008 1:05 pm
Location: Novi Sad, Serbia
Contact:

Post by pera »

my friend was always frustrated by lens flare effect in games, he said it was caused by imperfection of camera lenses, you dont see it when you look around with your eyes, and when you play the game, your character generally dont go around with camera on his face. so how about that? :)
torleif
Posts: 188
Joined: Mon Jun 30, 2008 4:53 am

Post by torleif »

You're right pera.

However, it depends if your game is in first person perspective. If the character is looking using eyes, you shouldn't use camera flare. There are exceptions, such as air craft simulators where sun blindness is a real factor. It can be used as a tactic and thus is a feature, not an annoying piece of eye candy.

If the game is a third person you would expect there to be a camera. Mario 64 took this one step further by actually having a character floating on a cloud with a camera, so flare would be expected

But when it all boils down to it, you really need to ask yourself does camera flare do my game any good?. If it enhances the theme (ie, outside in the wilderness, sun flare would be a great spit shine) or in the middle of a smoggy Chernobyl reactor where there's too many clouds.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

you're right pera, i get annoyed at lens flare being used when a camera clearly isn't present due to a first person perspective being used and clearly no camera, but hey, it's a cool looking feature if done properly so i guess devs want to stick it to go oh hay ahm kewl.
Image Image Image
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Remember that every AAA FPS has to feature a protagonist who is a space ninja vampire cyborg pirate marine, and who therefore has built-in optics capable of experiencing lens flare.
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply