Thermal Vision
by Andrew Edmonds · in Torque 3D Professional · 08/31/2010 (9:25 am) · 22 replies
Hi all,
I know this has been discussed before but I wanted to get a few thoughts on the subject of a thermal vision shader. I've been playing Arma 2: Operation Arrowhead a lot recently and love their implementation of thermal vision (I like the idea of laying down a lot of smoke and then using thermal vision to pick off the enemy).
I gave it a little bit of thought over the weekend and so far I think the best way to implement it would be using the material system combined with a shader (having a 'heat' value assigned per-material - it's not a true reflection but it might just work!)
For materials, I thought about adding a global 'heat' value (0 - 1) per material. This would work for 'static' materials such as a wall or a tree. For more complex materials I think it would be an idea to add a new 'heat map' which takes a greyscale texture map to represent heat values.
The whole thing would have to be tied together somehow with a shader (which is where I would get stuck).
Any thoughts on that? I've only given it a quick thought so any opinions / ideas would be most welcome!
Andy
I know this has been discussed before but I wanted to get a few thoughts on the subject of a thermal vision shader. I've been playing Arma 2: Operation Arrowhead a lot recently and love their implementation of thermal vision (I like the idea of laying down a lot of smoke and then using thermal vision to pick off the enemy).
I gave it a little bit of thought over the weekend and so far I think the best way to implement it would be using the material system combined with a shader (having a 'heat' value assigned per-material - it's not a true reflection but it might just work!)
For materials, I thought about adding a global 'heat' value (0 - 1) per material. This would work for 'static' materials such as a wall or a tree. For more complex materials I think it would be an idea to add a new 'heat map' which takes a greyscale texture map to represent heat values.
The whole thing would have to be tied together somehow with a shader (which is where I would get stuck).
Any thoughts on that? I've only given it a quick thought so any opinions / ideas would be most welcome!
Andy
About the author
Formed in 2005, EiKON Games is an indie games development project based in the UK working on the tactical first person shooter "Epoch: Incursion". See the Join Us or Contact Us pages at http://www.eikon-games.com/
#2
08/31/2010 (1:42 pm)
Just duplicate the Glow feature. It does everything you need: it writes a value (glow intensity) to a separate buffer, which can then be used in another post effect. In beta 2 it became much easier to create passes which override the materials of everything with a custom shader (in the source, of course).
#3
@Manoel - sounds like a good place to start. I think I'll still need a 'thermal map' added to the material system as I would want to represent heat in a lot of places where I wouldn't see glow (for example if a character had a dark texture).
Thanks for the replies - I'll keep looking into it.
08/31/2010 (1:49 pm)
@Steve - I remember an old resource for TSE (after TAT but before TGEA :)) that implemented some full screen shaders for night vision and heat vision. However (if I recall correctly) the heat vision didn't represent it realistically enough for my needs. I'll dig it up and have another look.@Manoel - sounds like a good place to start. I think I'll still need a 'thermal map' added to the material system as I would want to represent heat in a lot of places where I wouldn't see glow (for example if a character had a dark texture).
Thanks for the replies - I'll keep looking into it.
#4
08/31/2010 (2:28 pm)
The way arrowhead does it is that it has a separate texture set for players and vehicles that is colored in black (cool) to red (warm) and over this they apply some kind of fullscreen post processing
#5
08/31/2010 (2:39 pm)
Looks like I'm thinking along the right lines then! That's what I had in mind...
#6
08/31/2010 (3:38 pm)
When the game has a "glitch" and the fullscreen effect shut down you can see what it really look like :D
#7
Not had that happen to me (yet) - I'll keep an eye out for it!
08/31/2010 (3:40 pm)
<sarcasm>I glitch in Arma 2? Surely not! It's the most bug-free game I've ever played...</sarcasm>Not had that happen to me (yet) - I'll keep an eye out for it!
#8

Thermal Off

Thermal On
09/06/2010 (11:14 am)
Made a fairly positive start on this over the weekend. It still needs plenty of tweaking but it's getting there (click to enlarge):
Thermal Off

Thermal On
#9
09/06/2010 (12:13 pm)
This actually looks exellent. Are you planning to make a special texture set for the players when night vision is on?
#10
Edit: I'm not sure how to handle it just yet. I'm colouring each 'hot' item (controlled with a flag on the material) white at the moment and turning on glow (whilst applying a 'thermal' postfx to darken the scene and add the scanlines). That seems to work quite well.
09/06/2010 (12:31 pm)
Thanks Kyrah - it's not quite multiplayer compatible yet so that's my next hurdle.Edit: I'm not sure how to handle it just yet. I'm colouring each 'hot' item (controlled with a flag on the material) white at the moment and turning on glow (whilst applying a 'thermal' postfx to darken the scene and add the scanlines). That seems to work quite well.
#11
09/06/2010 (2:07 pm)
you should probably turn it off on the guns held by the players, and maybe deactivate the shine on the weapons... i don't know...
#12
hey Andy, what you think of these 3?
night vision

infra red (thermal) vision

heat vision

had these working since T3D 1.0
09/06/2010 (3:33 pm)
hey Andy, what you think of these 3?
night vision

infra red (thermal) vision

heat vision

had these working since T3D 1.0
#13
Andy
09/06/2010 (3:38 pm)
@Deepscratch: Wow! They are just *gorgeous*! Are you able to share your methods? (It would be hugely appreciated and you'd most certainly get credit in the game!)Andy
#14
09/06/2010 (4:20 pm)
I love the blue one
#15
AIs must be rendered again (at least),before that you have to process an appropriate shader.
Here are the infrared (heat) color values:

It is a bit tricky,but not impossible.
09/06/2010 (5:22 pm)
Sounds like you have to do one or two 1D maps - one for the AIs,and a separate one for the environment.AIs must be rendered again (at least),before that you have to process an appropriate shader.
Here are the infrared (heat) color values:

It is a bit tricky,but not impossible.
#16
I'm sure we can work something out.
you got mns messenger?
and Ivan, you got mns messenger? I got some shader questions for you.
cheers
09/07/2010 (5:03 pm)
hey Andy,I'm sure we can work something out.
you got mns messenger?
and Ivan, you got mns messenger? I got some shader questions for you.
cheers
#18
09/07/2010 (5:29 pm)
sent
#19
I don't know how much work it represents and how confidential you want to keep those shaders, but that will be very instructive if you can share your shaders as a resource.
Do you think it's possible?
It always instructive to read some resource to get how things work and what type of result you can achieve.
09/07/2010 (6:03 pm)
@Deepscratch,I don't know how much work it represents and how confidential you want to keep those shaders, but that will be very instructive if you can share your shaders as a resource.
Do you think it's possible?
It always instructive to read some resource to get how things work and what type of result you can achieve.
#20
I'd like to keep some stuff "private" for now,
but,
I kinda believe in "quid pro quo",
and,
I'd be more than happy to help as much as I can,
so,
you on messenger?
09/07/2010 (7:20 pm)
@elvince,I'd like to keep some stuff "private" for now,
but,
I kinda believe in "quid pro quo",
and,
I'd be more than happy to help as much as I can,
so,
you on messenger?
Associate Steve Acaster
[YorkshireRifles.com]