How to lighten screen when look to sun?

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
dvh
Posts: 4
Joined: Mon Dec 25, 2006 3:25 pm

How to lighten screen when look to sun?

Post by dvh »

Hi

I'm working on lens flares effects. Everythink works fine, i've got lens flares, I know how to detect if sun is visible, but in addition of lans flares, I want to lighten screen when sun is too close to the center of screen, so:

How can I lighten whole screen? E.g by 10%
trooper
Posts: 85
Joined: Fri Nov 03, 2006 7:34 pm
Location: Maryland, USA
Contact:

Post by trooper »

hey,

Have you got lens flare working, I think I saw a thread on that somewhere.

What kind of sun do you have, is it a light source, or part of the skybox texture.

Not sure but first simple thing could be white/yellow texture, and change the alpha.

I read a similar thread where someone wanted to change the screen brightness and color, according to heath.
I think thats what they did, so screen would get darker and darker and turn red, the lower the health went.

Really depends on what your sun is really, light or texture ??
You scratch my back, I'll scratch yours.
arras
Posts: 1622
Joined: Mon Apr 05, 2004 8:35 am
Location: Slovakia
Contact:

Post by arras »

I dont think there is some method howe to increase brightenes in Irrlicht. If there is something like that, try looking somevhere in video namespace. Personaly I newer saw anything like that.

But since you want sun like blinding efect, I think you can get fine with plane object in front of camera with texture of your choosing (simple white or yelow color, one pixel texture would do just fine). Adjust transparenci according to howe close to sun camera look.

Might be posible also with 2d image pasted on screen...
Warren
Posts: 60
Joined: Fri Jul 07, 2006 11:41 pm
Location: Santiago De Compostela, Spain

Post by Warren »

hi,
if you got when the sun is close to the center of the screen, you just maked the work.
Just draw a rectangle with an alpha component that changes with sun´s position ===> s32 sun_var [0, 255]

Code: Select all

color= SColor(sun_var, 255, 255, 255) //for a clean white

draw2DRectangle  ( color,  
      pos,  // should be rect(0,0,screen_X, screen_Y)
      0
      ) ;

Something like that should work.
------------------------------------------------
Irrlicht Ussers Map
Join now!!
http://www.frappr.com/irrlichtusers
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

Maybe setAmbienteLight(...) can help you ???
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
dvh
Posts: 4
Joined: Mon Dec 25, 2006 3:25 pm

it works!

Post by dvh »

afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

whoa! nice trick! looks great. 8)
Xharock
Posts: 71
Joined: Wed May 10, 2006 3:50 pm

Post by Xharock »

Are you sure Red is the right colour? Nice effect though :)
Post Reply