UFO:Alien Invasion

General => Discussion => Topic started by: Andrew.Smart on August 25, 2010, 08:06:10 am

Title: Discuss 'night vision' effect using GL Shading Language
Post by: Andrew.Smart on August 25, 2010, 08:06:10 am
On activating the IR goggles I could apply a 'night vision' shader for that turn.  I want to get some feedback.  I don't see any other proposals like this:
http://ufoai.ninex.info/wiki/index.php/Proposals

My motivation is I can't see much in the night maps, even after tweaking lots of settings.  I know I'm not alone.  I like that the darkness is for realism but it is too strenuous on the eyes.

I'm interpreting the IR goggles as a device that magnifies the amount of received photons:
    http://upload.wikimedia.org/wikipedia/commons/5/52/Nightvision.jpg
    http://upload.wikimedia.org/wikipedia/commons/thumb/8/83/PEO_ANAVS-6_NVG.jpg/800px-PEO_ANAVS-6_NVG.jpg
Not thermal imaging:
    http://en.wikipedia.org/wiki/Infrared
Are the IR goggles intended as a thermal imaging devices?  If so, I could make a different piece of headgear for my night vision purpose.

I noticed that clicking the IR goggles takes up 12 TU. When exactly does the improved visibility for that unit end?  (I apologize I could look in the code and see what really happens, but I'd rather ask)

I have not submitted a patch as things aren't perfect yet.  I'll do this all myself but I'd appreciate any tips & directions from those more intimate with this project.  For example I see I may need to write some code in ./src/client/renderer/r_program.c, and all my GLSL will be in ./base/shaders/world_fs.glsl

This is a screenshot without the UI with my night vision (dated Aug 23rd) applied:
    http://i558.photobucket.com/albums/ss30/andrewusu/ufoai/Screenshot-UFOAI.jpg

I plan to:
Title: Re: Discuss 'night vision' effect using GL Shading Language
Post by: Mattn on August 25, 2010, 08:31:46 am
i like that effect. the ideas are good and the positions in the code you found are the correct ones, too. you are working on trunk? because we have a renderer_branch going on with a lot of changes regarding lighting and shadows already (heavy use of glsl, too) - it might be a good idea to base your work on this branch.

btw. if you are familiar with glsl shaders a trillion people would kiss your feets if you could have a look at the ati related shader bugs in trunk.

https://sourceforge.net/tracker/?func=detail&aid=2994183&group_id=157793&atid=805242
https://sourceforge.net/tracker/?func=detail&aid=2997073&group_id=157793&atid=805242
https://sourceforge.net/tracker/?func=detail&aid=3029867&group_id=157793&atid=805242
https://sourceforge.net/tracker/?func=detail&aid=3015331&group_id=157793&atid=805242
https://sourceforge.net/tracker/?func=detail&aid=3031936&group_id=157793&atid=805242

as you can see - there are a lot of rendering bugs - and we currently have nobody that is able to fix them (arisian is on holidays)
Title: Re: Discuss 'night vision' effect using GL Shading Language
Post by: Andrew.Smart on August 25, 2010, 09:21:56 am
i like that effect. the ideas are good and the positions in the code you found are the correct ones, too. you are working on trunk? because we have a renderer_branch going on with a lot of changes regarding lighting and shadows already (heavy use of glsl, too) - it might be a good idea to base your work on this branch.
Thanks.  I'll base my work on that branch then.

Oh, and after looking in the UFOpedia, it looks like the IR goggles really are thermal imaging devices (that can see heat through thin walls I assume).  I assume it would be best to make a different piece of headgear for the device that magnifies the amount of received photons.  It is possible to write some GLSL code for the thermal imaging as well; but it would take more work.

btw. if you are familiar with glsl shaders a trillion people would kiss your feets if you could have a look at the ati related shader bugs in trunk.

as you can see - there are a lot of rendering bugs - and we currently have nobody that is able to fix them (arisian is on holidays)
I'm not that familiar with GLSL, but it seems quite intuitive.  I'll work on those bugs.
Title: Re: Discuss 'night vision' effect using GL Shading Language
Post by: Mattn on August 25, 2010, 09:53:56 am
Quote
I'm not that familiar with GLSL, but it seems quite intuitive.  I'll work on those bugs.

great!! fixing those damn ati bugs would be really nice.