Sign in to follow this  

infrared scene creation

This topic is 2658 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

Should be easy enough to do with a post-process shader.


float4 PixelShader(float2 texCoords) : COLOR0
{
float3 inputColor = tex2D(Sampler,texCoords).rgb;
float lum = pow(.333 * (inputColor.r + inputColor.g + inputColor.b),.5);
return float4(0,saturate(lum),0,1);
}



Take the brightness of each pixel (r + g + b)/3, raise it to a power less than one (to give it that overexposed effect that ir cameras have when looking at really bright sources), then map that value to the green channel and set both r and b to 0.

Share this post


Link to post
Share on other sites
The shader above would be a night-vision effect, I guess.

Night vision

Do you want a heat image?
If so, you'd render the scene using heat textures (hot things white, cold things black). This gives an effect similar to the one in CoD:MW, in the scene involving the gunship.

You can then also map the resulting black-white image to a color-mapped heat image, using a 1D texture for example. This results in something like this:

Heat map

Share this post


Link to post
Share on other sites
XeonT, the color cones in the eye are not equally sensitive, so just taking an average of the RGB channels is not a correct conversion to greyscale. Actual brightness is closer to dot(inColor, vec3(0.3, 0.59, 0.11)). When it's dark, rod cells (monochrome) predominate in the response and they peak between blue and green, so the transform vector would be different. For night vision, the sensitivity of the apparatus extends to twice the wavelength of red cells, so RGB doesn't make sense. Brightness is not what he really needs, because until you exceed 800*C there's no correlation between visible brightness and infrared brightness. What he should really do is store temperature either per object or as an additional texture channel, as Konfusius mentioned.

Share this post


Link to post
Share on other sites
Quote:
Original post by Prune
XeonT, the color cones in the eye are not equally sensitive, so just taking an average of the RGB channels is not a correct conversion to greyscale. Actual brightness is closer to dot(inColor, vec3(0.3, 0.59, 0.11)). When it's dark, rod cells (monochrome) predominate in the response and they peak between blue and green, so the transform vector would be different. For night vision, the sensitivity of the apparatus extends to twice the wavelength of red cells, so RGB doesn't make sense. Brightness is not what he really needs, because until you exceed 800*C there's no correlation between visible brightness and infrared brightness. What he should really do is store temperature either per object or as an additional texture channel, as Konfusius mentioned.

Of course of course, if you want physical accuracy. That's a handy little dot product to know, so thanks for that.

However, being a graphics programmer, I'm much more inclined to do as Promit says and use simple methods that produce good-looking results. And I must say - it often works with a lot less hassle than the whitepapers induce!

Still, I feel like this is a bit of a pointless discussion since the OP has still not indicated what he wants.

Share this post


Link to post
Share on other sites
Quote:
Original post by Promit
Sure, all that is true. But this is computer graphics, and simply making shit up works great as long as it gets the look you want.

Promit, I submit that in most cases the look that is best to most is the look that is most plausibly realistic, with perhaps some visual enhancements. Of course, the obvious exception is NPR.
I'm using the term plausibly realistic as opposed to physically realistic but the two are closely related; the former simply implies a psychological/physiological-dependent weighting of the factors of whatever metric one is using to measure realism. So I think my comment was appropriate, even if I'm just expressing my opinion.

Quote:
Still, I feel like this is a bit of a pointless discussion since the OP has still not indicated what he wants.

A discussion that goes on a tangent can still be worthwhile, even if the OP has been answered or has pulled a Houdini. Surely this is the reason for the "Please do not mark threads as 'solved'" sticky.

Share this post


Link to post
Share on other sites

This topic is 2658 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this