Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

voodoo_john

OpenGL Thermal / Night Vision in OpenGL using Shaders

This topic is 5606 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I''m an old man trying to learn new tricks. Recently I''ve began the process of introducing shaders to my engine using GL_ARB_VERTEX_SHADER. I don''t use CG at the moment because I''m doing a x-platform engine that must run on OS X. My questions is: using shader assembly, what would be the best way of doing a thermal or night vision viewing mode like in AVP2 say? I''m currently working on a Zombie game called ZOMBIE ISLAND an would like a night vision stylee mode, and infra-red/thermal one as well. Any help appreciated, John

Share this post


Link to post
Share on other sites
Advertisement

Well, I guess you need alpha/temperature maps to use as textures - the values in these maps are then used to index into a palette texture. The palette texture would contain smooth gradations of colour.

Now, I''m interested in this myself because, ugh, I work for a Thermal Imaging company and we are planning on moving over to pixel shaders for our temperature map palettization.

If anyone knows what the resulting ps program would look like - well, feel free to plant it here first

Share this post


Link to post
Share on other sites
I had thought along those lines, but that technique requires artists to have pre assigned temperature data to _every_ object in the scene. Surely this can be faked algorithmically? Does anyone know how they did it in AVP2 which has three separate vision modes?

Share this post


Link to post
Share on other sites
well, i dont know much about pixel shaders, but if you could calculate the depth of the object at each pixel you could set the color to something corresponding with that value multiplied with the temperature of the object, i think that should work out pretty nice.

Share this post


Link to post
Share on other sites
Aye, but again that would require artist intervention :-O I ain''t no artist....I''m sure there must be a way to fake it. Let''s forget characters just now, how would you have thermal vision for a world. You obviously wouldn''t want to assign temperature data to all objects in the world....

Anyone got any ideas about night-vision? In the recent thread on comemrcial source code, the source for Commanche Hookum seens to just blend a green quad over the screen...might give that a go :D


cheers !

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
An easy way to fake it.. "Light" the model with a light source at the camera''s location, and then map different light levels to a 1d color scale texture (where "dark" is dark blue and "bright" is red/orange) in a pixel shader. This way the center of the model will have a hot color that fades out toward the edges. Scale the brightness based on the temperature of the object, so eg. a stone object looks colder than a human. This is basically a variation of the "iridescent" rendering demo you can find at the NVidia site.

Now that I think about it, you could probably just do this with a spherical environment map with a red dot in the middle fading to blue towards the edges. Doesn''t even require shaders.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
In spherical environment mapping, you generate texture coordinates based on the vertex normals. To put it simply, if a vertex (ie faces it connects to) is facing left you set the UV coordinates of the vertex to the left side of the texture, and if the vertex is facing the camera, the texture coordinates are somewhere in the middle. If the environment map texture is red in the middle and fades to dark blue on the edges, this will look a bit like "heat vision" especially if you blur the end result. (render to texture)

Share this post


Link to post
Share on other sites

Well, I''m thinking you need temperature maps if you want to do this correctly (they would just be luminance maps) - speaking as someone who works for an infrared thermography company!

I''m not sure how they did things in splinter cell however, which is a pretty nice representation in my opinion. Don''t forget that luminance maps for things like walls/floors will be more or less background noise, with a some features - its the hot things, like people, lights etc. that need the maps.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!