top of page
Writer's pictureKane Adams

Adding Water and Colour Gradients

A common feedback I got from course mates was to add a visual representation of water, more than just changing the water region blue. So in response to this I added a plane at the point where I want the sea to begin and then added a blue reflective material.

Water v1

I liked the look of this water and when asking course mates they say it works with how the mountains colouring works, but I wanted to experiment more with colours within the whole game.


Colour gradients

I found a Brackey's video about using colour gradients on terrains that focused on using the Unity editor to change the colours to create a pre-set colour gradient.

This got me wondering if I could use colour gradient to alter the colours through a script and after looking at the Unity documentation, I discovered that this can be done by setting up 2 gradient keys, one that controls the colours and one that controls the alpha value. With these keys you tell it what colour you want and at what "time" that colour is used, with the value between 0 and 1. The use values 0 and 1 was perfect as noise maps can only be between 0 and 1, meaning I only had to use the "colourGradient.Evaluate()" method to determine the colour instead of an if statement.


I added the initial creation of the colour gradient as a modular script that can be called when it is needed. For my project this is called by the start method and whenever the user changes a colour within the Perlin noise demo.


Colour Gradient on Perlin Noise Demo

Now that the colour gradient was added, people said the water didn't work with the new style and so I experimented to get the water to some transparency so that you can see the ground below.


Updated Water with Colour Gradient

I still had the feature to customise the colour of the terrain so I wanted to see how the use of colour gradient impacted that and how water is impacted. I feel the new gradient system is a huge improvement as the change of colours isn't so sudden as the colours would blend.

Changing Colour Gradient

Customised Colour Gradient

This is the final week of the assignment and so instead of adding any new features into the game, I decided to focus on code management, value changes and minor bug fixes.

This is the final blog post showcasing changes to the project before I evaluate my work and discuss ways to improve it.

Final Version of Project


16 views0 comments

Recent Posts

See All

Comments


bottom of page