Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Dark lights realtime lighting

Author
Message
Sardines Lover
17
Years of Service
User Offline
Joined: 8th Mar 2009
Location:
Posted: 29th Apr 2011 18:23
I plan to make a sci fi. It takes place on a dark ship with aliens. I hope to recreate the appearance of night vision like you see on most haunted or ghost hunters.

Would dark lights help me to achieve this?
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 29th Apr 2011 20:54
You would likely be better off using a shader for that.

chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 29th Apr 2011 22:33
Darklights use lightmaping, and therefore static lights, but you could combine with some lights or a shader as KISTech said.
Cheers

I'm not a grumpy grandpa
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 29th Apr 2011 22:47
It's not ideal, but Dark Lights can be used for dynamic lighting.

It has a feature to generate the lightmaps in a separate thread. You can check to see if the thread is done, and when it is, update the lightmap textures on your object. If you don't do it very often, and don't make drastic changes to the position of the lights it works pretty well.

TheComet
18
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 30th Apr 2011 01:46
I've come to thinking... Would it be possible to create real-time lighting by just editing the diffuse colour of the vertices? I wouldn't imagine it to be too processor-hungry, only difficulty would be to calculate what color you would perceive at a given distance from each light...

TheComet

KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 30th Apr 2011 03:52
That would best be done by a shader.

Randomness 128
19
Years of Service
User Offline
Joined: 13th Feb 2007
Location:
Posted: 30th Apr 2011 10:53 Edited at: 30th Apr 2011 10:56
I went ahead and made a night vision shader.

It's a post process effect, so it'll work with any type of lighting you wish to use. It works by making everything darker (increases the contrast in the process so that bright things stay bright) when night vision is off, so things that are dark yet still lit will appear pitch black. When night vision is turned on, the scene will lighten up, making these dark areas visible. You just need to make your lighting brighter to compensate. It also uses bloom to make bright areas appear washed out and quite blinding when night vision is on. It also makes the image green and adds noise (fuzz).

Source is attached. Here are some screen shots:













Edit: Also, it's 4 AM here. So if you find any dumb, tiredness induced mistakes that I may have made, let me know and I'll take a look at them tomorrow (or, rather, later today when I wake up).
chafari
Valued Member
20
Years of Service
User Offline
Joined: 2nd May 2006
Location: Canary Islands
Posted: 30th Apr 2011 12:43
@Randomness 128

I have to say I really love it. Good job


Cheers.

I'm not a grumpy grandpa
Sardines Lover
17
Years of Service
User Offline
Joined: 8th Mar 2009
Location:
Posted: 30th Apr 2011 13:17 Edited at: 30th Apr 2011 13:20
Randomness 128 = awesome!!! I'll check it out. Thank you.

I appreciate the replies. It seems shaders is the way to go for me then.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 30th Apr 2011 17:20
That's a nice effect. Well done.

Login to post a reply

Server time is: 2026-07-11 12:20:16
Your offset time is: 2026-07-11 12:20:16