Labels

Tuesday, 29 October 2013

Movement and Shader Scripting

As it stands I have been focusing on scripting a character movement system and some basic toon shaders for our game. So far I have a basic working movement prototype and our first shader finished.

Character Movement


The above screenshot shows the test scene that I have set up to test the character movement scripts. As it stands the current features of this script are as follows;


  • Basic 2D movement along the X axis.
    • This includes running and walking functionality.
  • Basic jumping.
    • Jumping heights vary depending on the current speed of the character.
    • The ability to control the character while jumping against the characters current speed.
  • Directional Rotation.
    • The character rotates towards the camera in 3D space to face the direction in which it is moving.
While there are currently not very many features to this script over time I intend to expand upon it to incorporate the use of;
  • Momentum and sliding.
  • The ability to jump off from a wall.
  • Movement acceleration.
  • Other physics interactions.
Toon Shader

While having scripted this I have also been working on a fairly basic toon shader for our game. While this is usually something that would be done much later in development I decided to do it early on in case any issues arose that could potentially result in us having to change the games visual style. Below is a screenshot of the unity scene that I have been using to test the toon shader.


The toon shader has a few editable properties that can be used to change its appearance;
  • The amount of shading bands can be changed to alter the "blockiness" of the shading.
  • There is a property that allows you to limit the amount of colours used by the shader's base texture.
  • It is also possible to change the size of the models outline.
Currently the shader gives a really nice visual style to the 3D assets that I have tested it with, there are however a large amount of changes that I would like to make. The first is that due to the way in which it has been written, when the 3D assets are set to receive shadows its causes some visual artifacts where the toon shading and the received shadows overlap.

I would also like to change the way in which the outline is created. Currently it is done by using rim lighting that is set as solid black, this creates a nice affect but is often predictable and can create strangely shaped outlines with some assets.

No comments:

Post a Comment