This week has been interesting! I’ve been working hard to get a gooey metaball effect for the bullets that come from the gun to make it look like an awesome goo effect. After many hours of work and research I have implemented the effect into the game. I won’t go into much detail into how I did it, I’m going to save that for another blog post.
This week has been filled with understanding and learning the Unity3D graphics pipeline. The biggest problem that I had with implementing this feature was that I didn’t not know how I would actually go about doing this in Unity. I know how I would do it in another language from scratch, but when it came down to the implementation and using separate rendertargets within unity, I was lost. I began using a sample from the Unity Asset Store, Shader Replacement, to assist me in getting familiar with what I wanted to do. I was having a problem where when I rendered my metaballs layer they would show up as white squares rather than the faded gradient I was hoping for. This is where I began to research everything about Unity shaders and what options were available to me get it working. It turns out that properties used in certain shaders (such as _Color, and _MainTex) are available in the same frame in other shaders that operate the same (by use of Tags, like RenderType=”Opaque”). After finding this diamond (in the rough) I was able to pull the feature together.
Check it out: