I wrote a simple shader for Unity to make a stylized fog like Fire Watch's fog. The idea is to get a pixel on the texture depending on the pixel depth, if the fog is near, a pixel on the left on the texture uv will be picked, if the fog is far, a pixel on the right on the texture uv will be picked.
FeaturesChoose between a linear fog and an exponential fogChoose between a simple color or a texture
Source Code Image Effect Version (Unity 2017 and older if not using Stack) [+] Shader
Today, I'll show you a good exercise I made to manipulate quaternions. In extra you got a 3C structure for a flight game.
I chose to make a flight behavior because of rotation complexity. Today we always use physics to drive vehicles in video games, but this exercise is focused on quaternions manipulations, so all the behavior is driven by quaternions.
- Smooth TPS camera
- Camera switch (FPS / TPS)
- Auto replace character rotation: 3 different ways to smoothly reset character rotation (All Axis, Per Axis, None)
- Z/S: pitch
- Q/D: roll
- Shift: boost
- Left click / Right click: dodge left / right (lateral movement with roll as in some Star Wars video games)
- Classic: the classic game mode, you begin with an empty grid.
- Prefilled: you begin with a grid randomly filled with blocks.
- Gravity: when you remove a line, all block upper that line fall until they reached a block (or the grid bottom limit).