Labels

Tuesday 6 May 2014

Parallax Backgrounds

Originally we were going to have the backgrounds to our game as parallaxing 3D models, however due to their large size they would not lightmap correctly. Instead we decided to render the background in a modelling program as a flat image with and alpha channel and use. We still wanted to keep the parallax effect however so that was still implemented as planned. Below are screenshots of the backgrounds in game.




To achieve the parallax effect I used the cameras x position as a reference and for every 1 unit the camera moves the background move 0.2 units in the opposite direction. Also as part of the background scripting at each level transition I have also scripted the cameras background colour to change to match each level. The snippet of code below shows exactly how this was achieved.



No comments:

Post a Comment