All posts by Ronnie

New/old project rises

Many game developers struggles with the continuous pull towards creating new more exciting projects, instead of finishing the one they are already working on. This is known as the “Shiny Object Syndrome” (Source) and it’s very common among game developers, and I have found that I’m no exception! I tend to love starting new projects, and have a hard time pulling a project through to the end, and finishing it.. I’m kind of aware of this problem, but it’s really hard to resist! But this time it’s different I keep telling myself! This time I’ve actually returned to a game I’ve worked on before.. Voila, battlemaze or codename bttlmz returns! A game I started working on after I released my last finished game.. This time maybe I’ll be able to finish it? Only time will tell..

Working on the arenas

I find 3D modelling in blender very fun, but it sure is time consuming. And it get even more time consuming when I all the time need to render out my scenes even though I only need the models for Unity.

Heres my latest render of Shackles Bay, Chuck’s home and arena. It’s in no way final, alot of it needs to change before it’s done, but it has about the right feel already.


What do you think?

Animating more characters

I’ve put alot of work into the characters of Wacky waves lately just to get a feel of the style of the game and to try to get some inspiration for the continued work on the game. These characters is what will make the game feel alive, so I believe they are very important to get right. But they are also very fun to do. Check out this GIF! What do you think?

Animating characters

The two last days I’ve been creating one of the characters for the Wacky Waves game,”Chuck Shackles” the ghost pirate. I’m creating the characters in Blender3D. My skills are limited, but I’m taking my time with the models, keeping the poly count low, and keeping everything flat shaded and polygons single colored! Here is an early render of the character: 

I also tried out Adobe’s mixamo autorigger and animations to take him for a spin!

Any thoughts on the style I’m going for? 

Wacky Waves

I’ve started focusing all my development energy on a game project named “Wacky Waves”. It’s going to be a fast paced action boating game with battles between players and the environment. I’ve put up a site www.wackywaves.com that will have some info on the game, and a twitter account @wackywavesgame that I’m sharing my progress on! I’ll be sharing my bigger progress posts on this blog mainly, to keep things in one place! Hopefully I’ll be able to share more regularly than I’ve been able to before! Here’s some very early screens from the game I’m working on!

Terrain generation

It’s been a while since my last update, but I’ve been working on terrain generation for some time now. I’ve built my own Marching tetrahedron implementation. Which has not been the simplest of tasks. But I’ve got it working OK for now. I’m going to keep working on it.., it still needs some tweaking. But I thought I wanted to share. Have a look!

I’ve also worked a little more on my poly water and movement along the waves, which isn’t perfect, but OK at the moment.

Screen Space Texture Shader: Part 2

Yesterday we started working on our Screen Space Texture Shader. We got the texture part working, but we also want an outline.

To get the outline rendered we will be adding vertex and fragment functions to our shader, and this needs to render underneath, or before, the surface function we did yesterday! What we are essentially going to do is scale our model up by the amount needed to get our outline width, and render that without any lighting applied, so it is all in the color we set our outline to be.

First we are going to take advantage of some of the functions Unity can provide us with, so we will include UnityCG.cginc in our shader. We add this just beneath our properties like this:

Then we need to add a new tag to our subshader that queues the rendering of our pass after other geometry, this is done with the “Queue” tag.  By setting queue Transparent-10 our shader is queued before Transparent shaders but after geometry.

Our vertex and fragment functions needs to be in it’s own pass, unlike the surface function. So we add a pass{ } and then we need to set up some parameters for this pass.

First you can set the Pass name. I name it “OUTLINE”, but this is not required. The pass has it’s own tags. The “LightMode” tag says if this should be rendered in Forward(Base or Add), Deffered or like we do Always. This pass isn’t affected by lighting so that’s ok in either.

Then we have Cull, which handles what parts of our mesh we want rendered, For my outline I’m going to not render the Front parts of the mesh with Cull Front. You could do Cull Off, then every part of the mesh is rendered, but it has some trade offs, but you can get the benefit of getting outline around intersecting meshes like in the example below.

Cull test

You can try out which you prefer for your self. If you Cull Back you will not render the rear facing triangles of your mesh this will not work for our outline. So steer away from that.

ZWrite Off means that we don’t want this pass to render to our DepthBuffer, which we wouldn’t want our outline to do. ZTest less means that this will render over objects furter away. ZTest Greater means that this will render over things in front of it. Then finally you have the pass blendmode: Blend SrcAlpha OneMinusSrcAlpha. This is actually the standard blendmode so you don’t need it. But you can experiment with different Blend paramterers and also you can do BlendOp Sub, or RevSub to get diffent effects. All about blending..

The we add the CGPROGRAM for this pass, we start with the compilation directives

#pragma vertex vert – our vertex function is called vert
#pragma fragment fra – fragment shader frag

Our vertex function needs something to process – the appdata structure, contains vertex positions and normals, the vertex fuction returns the v2f structure which is passed to our fragment function for final processing. v2f contains the POSITION in camera clip space and the color.

And we need our _Outline (width) and _OutlineColor.

Then we have our vertex function:

Return v2f , input is appdata v.
Declare “o”. “o.pos” is the vertex (position) multiplied with MVP (Model, View, Projection) Matrix. This brings our position from world position to clip space which our fragment function wants to work with.

Then we bring our normals from world space to eye space by multiplying with the UNITY_MATRIX_IT_MV. Then we normalize the resulting normal.

Our offset should be the projection space normal.x and y, this makes vertices that has normals that has high angle (90 deg max) with the “sight vector”/”eye line” move the furthest and vertices with normals pointing into or out of the screen won’t be offset.

Then we displace the position. Current position + offset multiplied with the z position ( to get wider outline for objects further away (consistency)) and our _Outline width.

Then we set our outline color in the o.color variable, and return “o”.

Next up is our fragment funtion which is the simplest kind of fragment function you can get. It’s self explanatory. Remember to end the CG program with ENDCG

That is actually the entire shader! We now have a complete shader!

ssts3

This  is the resulting output I get from this shader. If you messed up or just want to download the source for the shader. Here you go!

That is it for now! Good luck, shading your worlds!