2D Tilemap using shaders

Update: an updated version can be found here

Recently I had been wondering if I could create an easy way of rendering a 2D tilemap with a low amount of verts and drawcalls. My solution was to create a custom shader that will select the correct tile and draw it. This means I can draw a complete tilemap with just 1 quad/2 triangles. For the input I generate an extra texture that has the tilemap information. Currently there is space for animation in the texture but atm I haven’t programmed that yet.

Continue reading

Graphic updates for tower defense game.

One part of the tower defense game that really needed updating were the tower models. Yesterday I made a fairly simple replacement for the laser turret.Laser Turret

It has 153 vertices and 262 triangles. So it is quite low poly, but that doesn’t matter because ingame the models are small anyway. It is still untextured and I will have to see how it looks ingame to decide if I will keep this model or replace it with another.

As a bonus, I found out how to add an armature to a model in blender and how to animate it. I also encountered multiple errors in unity while trying things, including error related to how unity uses fbx import prefabs. The biggest annoyance is that unity replaces parts of the prefab in the scene but not all of it. For example, it replaced the animations, but not the mesh and bones itself which led to multiple errors.