Unity - Camera Shake / Object Shake (Random Offset vs. Perlin Noise Offset)

Subscribers:
2,090
Published on ● Video Link: https://www.youtube.com/watch?v=SxOI6b3Itu0



Duration: 0:27
564 views
6


Left = random offset (framerate dependent; 30Hz at 60fps, 72Hz at 144Hz, etc.)
Right = Perlin noise offset (framerate independent 15Hz at all fps)

Hanging with N163LPH03N1X (http://youtube.com/N163LPH03N1X) and talking about how to shake cameras or game objects.

The problem with random offsets, such as using Random.insideUnitSphere, is 1) they shake more with higher framerates and 2) they are not realistic. They tend to work with 60fps predefined framerate 2D games, however fail with multi-framerate 3D games. One reason is the framerate dependence, but I believe another reason is 3D objects are perceived to be more realistic and have more mass/weight and are not perceived to be able to shake -- compared to a 2D game which is more like a cartoon and the laws of physics can be broken easier without breaking the suspension of disbelief.

Unity's Perlin Noise:

Unity's implementation of Perlin noise appears to be a common naive implementation that is mostly likely VALUE NOISE. Perlin noise is actually a form of GRADIENT NOISE which is the interpolation of GRADIENTS (first derivative angles also measured as normals), whereas VALUE NOISE is the interpolation of VALUES (end values). Unity's implementation is a common misstep. It has strong (poor randomization detectable by human) artifacts, such as lots of zeroed out locations. In other words, it does not look good and is a misrepresentation of the quality of real Perlin noise!
- https://en.wikipedia.org/wiki/Perlin_noise
- https://mrl.nyu.edu/~perlin/noise/

--
Matthew Doucette (Xonatron)
http://matthewdoucette.com/