Page 1 of 1

How to lighten screen when look to sun?

Posted: Tue Dec 26, 2006 9:11 pm
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%

Posted: Tue Dec 26, 2006 9:17 pm
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 ??

Posted: Tue Dec 26, 2006 9:36 pm
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...

Posted: Tue Dec 26, 2006 9:45 pm
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.

Posted: Tue Dec 26, 2006 10:42 pm
by Acki
Maybe setAmbienteLight(...) can help you ???

it works!

Posted: Wed Dec 27, 2006 5:04 pm
by dvh

Posted: Wed Dec 27, 2006 5:12 pm
by afecelis
whoa! nice trick! looks great. 8)

Posted: Wed Dec 27, 2006 5:15 pm
by Xharock
Are you sure Red is the right colour? Nice effect though :)