Geek Culture
Published in

Geek Culture

Improve Background Realism and Immersion with a Parallax Effect

Objective: put a parallax effect for the farther tilemaps

We painted on tilemaps that should represent layers of landscapes at given distances from the camera or point of view. Bu all appears flat, 2D-ish. That is because we lack the parallax effect: in other words, if we move the camera, everything stays in place instead of shifting of a quantity dependent on the depth.

To achieve this effect, a few simple steps are needed.

First, you have to change the projection option in the main camera, from Orthographic to Perspective. You can then play with the camera z position and FOV to get the zoom level you like the most.

The next step would be to push the tilemaps farther along the z-axis. The farther the landscape should be, the higher the z value —compared to the others. There is no need to use huge numbers, I put 1 and 2, but maybe even smaller numbers will do the trick. In this way, being the tilemaps effectively pushed back, the parallax effect will be amplified.

This is the result. You can notice how the waterfall and the caves shift while moving the camera… think of how cool it could be with a large enough painted level!

If you liked it, clap to it! Check out my games or buy me a coffee: every kind of support is appreciated!!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Daniele Quero, PhD

Daniele Quero, PhD

719 Followers

A professional developer with passion for game developing and skill-growing. A former Nuclear Physics Researcher who changed his life to pursue his dreams