Search Unity

Thermal Vision

Discussion in 'Scripting' started by morgansaysthis, Mar 7, 2007.

Thread Status:
Not open for further replies.
  1. morgansaysthis

    morgansaysthis

    Joined:
    Jan 12, 2007
    Posts:
    245
    im trying to think of a good way to implement thermal/x-ray vision so you can see people threw walls for my "reedemer" type weapon in my game




    i have no idea where to start, usally i have at least a basic idea of a way to achieve somthing


    but i got nothing
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    How about you put the people on a custom layer, and have another camera that's parented to the main camera render only that layer, and which has a higher depth than the main camera (so it renders on top) and has the clear flag set to depth only?

    --Eric
     
  3. Omar Rojo

    Omar Rojo

    Joined:
    Jan 4, 2007
    Posts:
    494
    Yeah, the best approach i think is to have a secondary camera activated when x-ray vision and:

    - draw after the main camera
    - change the material of the objects to something like solid red to see the shape and not the texture
    - add an effect like noise + grayscale (red) to see as with glasses

    Good luck

    Omar Rojo
     
  4. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Does thermal vision actually see through the walls? I'm under the impression that it shouldn't; it just displays color-coded infrared ray coming to you.

    If you want stuff like that, then you don't need two cameras. Write some sort of "thermal vision shader", apply it to the materials in your scene, and there you go. I guess in games thermal vision is often faked: walls and other cold objects just display nothing; and humans and similar things output color based on the angle between viewing direction and surface normal.
     
  5. Omar Rojo

    Omar Rojo

    Joined:
    Jan 4, 2007
    Posts:
    494
    :O i miss understood the effect xD

    Well the expert spoke..

    Omar Rojo
     
  6. pete

    pete

    Joined:
    Jul 21, 2005
    Posts:
    1,647
  7. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    Well.... kindasorta. If someone is near a thin wall and doesn't move around too much, you can see their heat impression on the other side.
     
  8. morgansaysthis

    morgansaysthis

    Joined:
    Jan 12, 2007
    Posts:
    245
    thank you all very much, i guess i will give the two camera thing a shot

    i know that in real life you cant acually see threw things with thermal vision,even glass because it will just show its own temp. but for my game im just going to throw it out there and not explain it haha


    how could i have a split screen showing both at once?? like in the bottom corner have what the thermal cam is seeing. and have the rest of the screen show normally.


    thanks again for your help, you guys rock
     
  9. AaronC

    AaronC

    Joined:
    Mar 6, 2006
    Posts:
    3,552
    Use the same Input to Change Materials?

    The same input as switching Cameras: Then have a second set of heavily saturared heat colours and far out shaders? Toggle Materials and Camera?
    AC
     
  10. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    I was going to explain this, but it was almost as fast just to do it. Plus it was a bit o' fun, so here's a cheesy web player (standard FPS controls, not that there's actually anything to do really), and I attached the project. Basically: three cameras, some fiddling with layers, each "live" object has a duplicate (different materials for each), and a slightly modified alpha diffuse shader (not necessary, but I thought it looked a little better for this purpose).

    --Eric

    (Edit: fixed broken link....)
     

    Attached Files:

  11. morgansaysthis

    morgansaysthis

    Joined:
    Jan 12, 2007
    Posts:
    245
    it never ceases to amaze me how much this forum and this communtiy rocks



    thanks alot, i appreciate it it works great
    and thank you all for your help and input



    and any one who has tried torques forum, can appreciate how good this one is
     
  12. smidling

    smidling

    Joined:
    Mar 13, 2014
    Posts:
    4
    You man, are a GOD!

    Thank you sooo much!
     
  13. Max-Bot

    Max-Bot

    Joined:
    Sep 25, 2013
    Posts:
    83
Thread Status:
Not open for further replies.