Per object and/or per camera shaders? Thermal/hyper vision scopes...+blend

I think a gif would explain faster what i am doing:
http://i.imgur.com/4fY7axZ.gif
I would want to create stealth game where the enemy has real* vision.
Currently i am just counting the red colored pixels on the from 8x8 to 32x32 image the camera records.

The question:
How would I highlight a object(player) on the screen?

a) The color method = kinda stupid
I could initiate a stealth mode where everything in the game would be gray-scale except only the character would be colored. That would work, but it’s a workaround, not the goal.
(having gray ninja outfit would actually make sense there :smiley: )

b) Having some kind of shader working on a separate camera that could separate objects (by material or property?).
On that view everything is rendered black, except the pixels belonging to the character.
This way i would have a normal view camera and a scan camera that would not interfere with the viewing experience.

Note:
I have zero amount of idea how even shaders work.
So this is delusional dreaming.
http://i.imgur.com/W8szz0c.gif

The idea is cool. But I do not know if you can have separate shaders at videotexture.

Monster doesn’t know? Well, that’s encouraging.

Another question would be performance.
Is it more efficient to have all enemies share one camera that is moved between them, or would a fast moving camera be worse than having a camera on all enemies?
Probably a mix of both?

Naturally counting pixels is slow. Therefore it would be a good idea to do that only when necessary. So even with just one enemy it would be more efficient to avoid image processing all frames.

Keeping that in mind, yes it would be more efficient to share the camera ;).

have the plane in front of the player, and have copies of the enemies have a overlay scene, that is the heat image of them, so they “pop” right through the plane?

Attachments


When I was playing with this technique (2011), I got stuck with delays, due to lack of control on the refresh frame & AI process cycles - Multiple AI (multiple cameras).

Unmonitored (not on screen) cameras are using 8x8 for targeting. Small screen on the top right are the friendly AI cam.

@BluePrintRandom, that’s cheating. That’s xray vision. I could raycast if would want that…
I would want to be able to hide in foliage. Not Xray trough it.
[URL="/u/mziskandar
mziskandar
I plan on moving the camera to the alert enemy when their vision cone or xray returns possible sight.
That way i don’t have to always count the pixels.
“I got stuck with delays”
Maybe can you explain bit further possible problems and give tips. Maybe link to that project?

I duplicated all the objects in the game in another scene with new(neutral) material.
This seems the only way that this can be made.
Well, i know this is not very efficient but it works…
http://i.imgur.com/C6haZhF.gif
I visualize movement noise trough light.
http://i.imgur.com/X8uzqsw.gif
http://i.imgur.com/5AN1EgM.gif
Any suggestions?

Attachments

map (1).blend (673 KB)