Category Archives: Tips

Low poly water shader

Edit: I’ve added a link to a downloadable version of the shader! Copying the code from this post does crazy stuff to the symbols..

The side tracking specialist strikes again.

I’ve been working on another project lately and ended up in need of low poly flat shaded animated water.

I tried editing the mesh at runtime by script. Using the method mentioned by joni.giuro here:

But when using the standard plane with this script, basically 200 triangles and when you’ve separeted all vertices (600), FPS drops down from 1500 without script to 190 with script applied. If you add more planes or models with more triangles you quickly get to a point where you get 1 FPS. So I needed something else.

That’s when I figured I’d try my luck with shaders.

Tried googling for solutions, but nothing was to be found so I needed to build my own. With no experience in shader programming this proved to be harder than I expected. But fast forward through some horrible looking results to today. Now I’ve gotten to a point where I can take any plane (not having to worry about splitting verts) applying my shader and getting this:

Almost no hit on FPS with fully animated low poly flat shaded water with specular color. And with this solution:

I can add looots of planes with this shader with almost no hit on FPS. Here I’ve added got 30 standard Unity planes with 200 tris each, all animating off into the distance.

Here’s a video of it in motion:

So how is this done, you say?

Code below.

It’s not perfect but it works! F.ex. I’ve left the UV coords in there but don’t need them for this. And I’m not entirely happy with the waves just yet.. But here you go.

Link to downloadable version

Windows Phone 8 support

I just got a Nokia Lumia 930, my first Windows Phone 8! My last Windows Phone was a Nokia Lumia 800, and I must say the difference is huge! After I got the new Phone, I wanted to try out how 3ounce would perform om the handset, so I built it for WP8 and what do you know, It played perfectly on the Phone! So I’ve decided to port 3ounce to WP8 before I continue work on Battlemaze. I’m also changing the game quite a bit before releasing.. Already done alot of work on the visuals/GUI.. Some screenshots below. The looks might change more..

wp_ss_20140818_0002 wp_ss_20140818_0003 wp_ss_20140818_0004 wp_ss_20140818_0005v

Unity Networking tutorials

Here’s a quick list of tutorials I have found interesting on Unity Networking.

Brent Farris – Unity Networking tutorials:

Tutorial Playlist

Createathings Unity networking tutorials:

Part 1/4

Part 2/4

Part 3/4

Part 4/4

Sky Arena  Photon tutorials:

These videos are referencing a tutorial asset, that can be bought at the Unity Asset store. I haven’t bought this so I can’t say anything about it. But found the videos interesting either way.

Part 1 – Lesson 1

Part 1 –  Lesson 2

Part 1 – Lesson 3

Part 1 – Lesson 4

Part 2 – Lesson 1

Part 2 – Lesson 2

Part 2 – Lesson 3

Part 2 – Lesson 4

Quill18Creates Multiplayer tutorial:

Part 1/2

Part 2/2

I haven’t decided yet if I wan’t to use PUN or built-in Unity Networking for BattleMaze. Both choices has it’s pros and cons as I see it at the moment, but I think PUN is a little bit ahead.

Do you have any experience with Unity networking? Or PUN? What do you think?

Thank you, Tube


A new beginning..

I’ve been too busy to actually do any gamemaking for a while, until a few days ago when i updated my old maze game “3ounce” for windows 8 to windows 8.1. I started doing some changes to the graphics ingame as well, and quickly found that I wanted to do more with it.. I wanted to add some form of multiplayer, and I wanted to do a total overhaul of the looks of the game.. Soon I realized that this was more than just an update.. It had to be a whole new game! And then the idea of “Battlemaze” was born..

I’m new to network gaming so I’ve been reading about Unity networking and also Photon Unity networking. I’ve been looking through some getting started tutorials. But I’ve realized that I need to get a clear idea of what kind of game I’m going to build this time, before I start coding and implementing features.

At the moment it’s all just a big pile of ideas floating around on postIts and in my head. This time I think I’ll try to narrow down all features and gameplay mechanics in some document before I go further.. But I always have to check up on some stuff on the way.. Like lately.. facebook integration, pathfinding algorithms and unity networking/photon.

pathfinding tutorial

How to create a multiplayer game with unity

Photon UN

Facebook for Unity

Do any of you make games? How do you go about planning your games?