woensdag 27 januari 2016

Animated Seaweed and finished level

For the animated seaweed I used the Terrain tool in Unity. In the grass section I could add my own grass texture, adjust the sizes and paint it on the ground.

The grass was automatically affected by the default wind settings.


To finish off the scene I added a custom Skybox to make the level appear under water, a mist and particle system simulated the density near the bottom and a few buildings in the background made the scene more interesting and colourful.

Runed Platform Shader

The level I was going to create was the environment for my character creation scene. In the middle of the screen would be a platform where the customisable character stood/floated on.

For the shader project I choose to make a shader that could control the runes on the platform. In the material properties of the platform the texture could be changed, the rune pattern, the rune colors and the strength of the rune glow.

The platform had its own texture. In this texture the "off" rune pattern was already painted. So when the pattern wasn't disabled in the shader you could still see where they belonged.

The pattern was done by adding a Alpha Map or a black and white image to the Emission input of the shader. A Multiply would combine the color, pattern and intensity of the runes before sending it to Emission.

The red channel of the Alpha image (or green or blue) told the Multiply to only change the area where there was "red" information (white is a combination of all colors maxed out while black holds no color information)

The color Input told Multiply which color the pattern should have.

The Glow Strenght slider held the numbers 0 to 4. 0 would turn the Emission "off" while 4 increased the brightness of the color.


Shader Forge

Shader Forged worked perfectly. The layout was very similar to Strumpy Shader and most of the information I learned from Strumpy Shader tutorials could be applied to Shader Forge.

Unfortunatly animating the vertex, through vertex paint wasn't so easy. Through a shader I wanted to animate the seaweed. In the editor I could get the shader to gather the vertex paint information from the FBX by linking the vertex color (in this case red) to the Vertex Offset input of the shader. It then could be animated by adding a Sinus and Time input. But after fiddling around I couldn't get any control over the shader, as soon as I added the Time input the mesh stretched out of proportion.

I choose a less complex shader project to start with.

Non compatible, non compatible, non compatible

As soon as I opened up Strumpy Shader, the console window was overrun with errors. Recurring errors were the file CgBatchOutput.shader could not be found and that the 'vert' output parameter 'o' wasn't completely initialized. 
Some forums recommended a quick fix for the initialisation error but other errors remained and even the most basic shader didn't work. 

It took me a while to figure out the problem. While scrolling through the comments on the Strumpy Shader asset store I figured out that Strumpy Shader wasn't compatible with Unity 5.3.

It was compatible with Unity 3, but Unity 3 wasn't compatible with Windows 8. So to complete this assignment with Strumpy Shader I would have to install Windows 7 or earlier versions on my pc.

My teacher recommended I use Shader Forge instead.

donderdag 14 januari 2016

Strumpy Shader basics

The previously mentioned tutorial turned out to be a bit more complex then I expected, so I went to look for a tutorial that could teach me the basics of the Strumpy Shader.
This tutorial by Hired GunGames on youtube explains the navigation of the editor:

https://www.youtube.com/watch?v=o4yptRImuTI