Gamedev

VR Screen Shake - The art of not throwing up

Screen shake is an effect that, when used tastefully in games, can really push immersion. To my knowledge, nobody has implemented screen shake in any VR title, because it would be moronic to. Shaking the player’s view is a surefire way to make them motion sick.

That’s why you have to get creative with it. I tried shaking the camera’s position, but that just felt horrible. Shaking the rotation was even worse somehow. I decided to experiment with a less intrusive way of shaking the screen.

Instead of shaking the whole view by moving the camera, I use a post effect to be able to have more control over the shaking. I only shake the margins of the screen, to let your peripheral vision pick up on it without obscuring whatever you are focusing on. If you watch the clips below, you can see that the center of your view doesn’t move at all. I also shake the screen inwards and outwards only, rather than any positional or rotational shaking. This means your view never really changes, the effective fov just changes slightly on the edges. All of this together provides a fairly non-intrusive screen shake effect that makes concussions much more punchy.

This effect works best when aligned with particularly hard-hitting gun shots, taking damage, and of course explosions.

For me, this effect is perfectly comfortable and mostly subconscious outside extreme scenarios like the multiple explosions above. This might be different for other people, so I’d love to get some feedback on it.

This is also a valid screen shake effect for pancake games, come to think of it.

Anyway, here’s a build where you can try the shake effect out.

And here’s the source code and shader. Everything is self explanatory and should be very easy to use!

This effect is made for unity, but the technique can easily be ported. You can freely use/modify the code.