There are different visions used by Yautja (Predators).
In my Yautja Cosplay, I listed vision modes in Bio-Mask but for purpose of game, I decided to change them:
-
Normal (Human) Vision
with some post-processing effects -
Thermal Vision
to see heat (of humans) -
UV Vision
to see lights (like flashlights on weapons) -
Metal Vision
to see Xenomorphs (and most weapons)
Final Product:
Normal vision, Thermal Vision, UV Vision, Metal Vision
You may also want to add Audio Visualization on right side of the screen (as seen in Predator (1987) movie).
Normal (Human) Vision
I have created small testing scene which I will for all the visions here (it will make comparing them easier).The model of Xenomorph is from Free3D.com. M41-A Pulse Rifle is also from Free3D.com and the soldier is from Free3D.com too.
Rest of models are made by me with textures are from OpenGameArt.org (including some models).
I also had to modify those textures for purpose of this article.
Now when we have the scene, let's play with Post-processing (and other) effects.
Because we do not want
playersto use this vision, we need to do is
uncomfortable.
Focus Blur
First we will useFocus Blurwhich will blur the render based on distance of pixel from center.
Noise
Second we will add some noise to artificially lower quality.The noise will be done by a noise texture.
We can use different approaches:
-
Static noise
Just lower quality but no visible effect. -
Moving noise
We can use tall texture and move it in a direction.
The texture needs to be tileable on the moving axis. -
3D texture
Possibly best because its 3rd axis gives us different noise for every value (texel).
...
Display Lines
...Thermal Vision
There are different palettes used for real thermal cameras like this or this.In Alien vs. Predator (game, 2010), they used (Arctic) Blue to Red, Orange and White.
In films, they used almost same palette but with Green between Blue and Red.
Black to White
White to Black
[000,000,127] to [191,255,255]
[000,000,127] to [255,000,000]
[000,000,127] to [255,000,000] (HSV clockwise hue)
You can write those palettes into shader yourself or use those images (with 1 texture height).
UV Vision
If you already have a cone from your light sources, you are done with preparations.UV vision is grayscale (from blue to white) showing only shadows and lightsources.
Red & Green & Blue = 0 - 255
Red & Green = 0 - 255, Blue = 255
Red & Green = 0 - 255, Blue = 191 - 255 (64)
Red & Green = 0 - 255, Blue = 127 - 255 (128)
Red & Green = 0 - 255, Blue = 63 - 255 (192)
Blue = 0 - 255 for 1st 50%, Red & Green = 0 - 255 for 2nd 50% (Blue = 255)
Blue = 0 - 255
You can write those palettes into shader yourself or use those images (with 1 texture height).
First we need to use solid white for all 3D objects. I recommend you to always use normal map (if you have none, you can generate it online here or use normal map generated from noise) because it will make it feel more 3D.
The render should contain all light and shadows in grayscale (even colored lights).
Then we add the cones of light fading into transparency (only adding value, probably starting with some transparency).
If you are not casting light on everything (sometimes you can use same lightness for whole objects like players or weapons).
Because in this we were using only grayscale, we can use 1 float for transfer between.
Before post-processing, we have same output as on 1st palette above but we will want to color it by any of the palettes above.
Metal Vision
Metal Vision works almost like UV Vision because we will use monochromatic / grayscale render.This mode should be gray with only Xenomorphs being toxic green.
Humans should me gray but some weapons / equipment may be greenish.
Grayscale from 0 to 127 for lightness.
Green from 0 to 127 for metal. Darker (more to left) means more dependent on previous palette (and lightness)
Mixed previous 2 palettes. Grayscale from 0 to 127 fading into Light Green (127, 255, 127) in down direction.
On image below, you can see how our scene looks with and without highlighted metal objects.
Switching Effect
In films, you can see sliding effect of a vertical line from left to right switching between vision modes.Vertical Line
...Post-processing
We can use 2 Framebuffers (one for each mode) and then merge them.This will require us to create 2nd Framebuffer for one of the vision modes and render the scene twice.
Scissor Test
Scissor Test allows you to select rectangle which will select the area of render (other fragments (outside) are discarded).This will require us to render the scene twice but into same Framebuffer.