In this part, I add Ocean depth shader to distinguish different depth of the ocean. To make this happen, I need to add a new parameter in colorsettings.cs script to determine the gradient color of the ocean. And in the previous code, we start to calculate the elevation from the ocean to the max elevation. Right now, we need to…
Leave a CommentMonth: December 2018
Add Biomes Effect
The biome effect will give different color on different height in the planet. Like picture below, I can put three different color to make 3 different biomes. To make this happen we need to create different color generator. In previous color generator, we only focus on gradient color, right now we put tint color to set the biome color. public float…
Leave a CommentAdd Shader to The Planet
This part will add color to the planet. To have different color on the continent, I need to calculate the elevation of continent. The elevation will lead to the maximum and minimum value of the elevation. This script below will get value the maximum and minimum value of the elevation. for (int i = 0; i < noiseFilters.Length; i++) { if…
Leave a CommentAdd More Noise Filter
In this part, I would like to add another noise filter so this project will have multiple filters to use. The filter we use called ridge noise filter. The function of this filter to add the mountainous effect in the continent. The filter has a similar definition with the picture below. This filter takes the absolute value from the noise. Similar to above…
Leave a CommentNoise Filter to Build Continent in Planet
The continent can be build using noise filter. The noise filter will give random value to the mesh position and will affect the altitude in the sphere. This function will help to build a continent in the sphere. To generate the noise, there is a script called noise.cs Noise.cs /* This file is part of libnoise-dotnet. libnoise-dotnet is free software: you can…
Leave a CommentControl Sphere Size and Color
There are 3 main points in this part. First to control the size of the sphere, second determine the color of the sphere, and third randomly set the color and size of the planet. To control the size we need to get the position of the mesh and change the position based on the radius. The mesh position variable is…
Leave a Comment