Post news RSS DevLog: 3D graphics for mobile devices part 2

Project Trains: Traffic Control DevLog: 3D graphics for mobile devices part 2.

Posted by on

Hi! This is the second dev log for Project Trains. We're talking about how we did our 3D graphics in Project Trains to make it as beautiful as possible and keep the reasonable amount of FPS on mobile devices.


Well... This one is pretty obvious. On mobiles we don't want to use realtime shadows on all objects on the scene. Project Trains : Traffic Control levels have many static objects that should cast shadows. It's natural to use Unity lightmapping feature.

Project Trains Dev 2

Lightmapping has one serious drawback. When used with realtime shadows you can easily see the difference between these two. Lightmapping shadows look more realistic because these are more blurry as the distance between caster and the ground is further. Still it's better than nothing :-)

Yes, we're using realtime shadows! Mainly for trains and trains loaders/unloaders like cranes. Unity allows to customize these shadows to choose between quality and performance. Because there aren't so many objects with a shadow, we've decided to stay somewhere in between.

Traction lines

Some levels have traction lines. Usually cables in games are rendered using simple thick lines (like GL_LINES). We're not different, but we decided to make it a little more eye-candy.

For most of the time player observes the game from the isometric-like point of view. It's not really isometric and the camera Matrix is set something in between orthographic and perspective. Yet. the fact is, that you see the scene from the top and all the objects are rather small.

On some displays one-pixel thick cable can be too wide, so we did a little trick. We check how big is the screen size and based on that information, we make the cables more transparent. In the end it looks like cables are equally thick like on bigger devices.

Project Trains Dev 2

Project Trains Dev 2 1

Flat geometry

Not everything is in 3D, but train tracks are! The reason why we kept those in 3D is that... it would be totally visible if we would just flatten them out. Train tracks look very different from different angles.

Project Trains Dev 2 1png

What about wooden connectors? Yep, these are flat! Do you see the shadows? It is painted on texture. Just like that!

Project Trains Dev 2 2

Bump mapping and specular

Two things that really improved the looks of our 3D graphics are bump mapping and specular. Here's a comparison:

Project Trains Dev 2 5

Project Trains Dev 2 6

Specular made our metal objects look like real. Both effects are fairy cheap for today's mobile graphics cards even on older devices.


We wanted wheat to look realistic. The problem with plants is the volume. Plants can be deadly for GPUs if not prepared with caution.

Project Trains Dev 2 7

Our wheat block is a single object with 168 vertices and soft edge cutout shader. Thanks to that the rendering is cheap and the visual effect is more than acceptable.

Project Trains Dev 2 8

Here's the close-up:

Project Trains Dev 2 9

Of course the player won't see these holes :-) Yet leaving it as is, allowed us to make a great effect without making the GPU to overheat.

That's all for today's dev log. Follow us to get notified about further Project Trains development! You can follow us on Facebook, Twitter or here on IndieDB!

panic-mode-games - - 3 comments

"Simplicity is Beauty and beauty is simplicity, nothing more, nothing less". Congratulations, guys. The mainly concern of a mobile developer, in my opnion, is to maintain performance on different devices. Other developers need to understand that, just like me. Thanks for sharing.

Reply Good karma Bad karma+1 vote
Guest - - 693,011 comments

This comment is currently awaiting admin approval, join now to view.

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.