P0-P-172: Part 58: SEE: Multiple Terrain Textures with blending
I have had to abandon the idea of using the existing colour-based rendering/texturing system. I can’t find a way to send the data that I need per pixel, only per terrain chunk, which wouldn’t work (I could render each chunk with a different texture, but not each individual pixel, which would look terrible).
I will therefore need to use the strategy that I used before with my previous terrain (P-152). Thankfully, I can send the min and max values of the terrain easily using the SEE, and the world position can be obtained from the shader in unity. I also need to send the center position of the terrain.
I am concerned with using these values however, since the world position and center position of the planet are very large floating point numbers, and I may have precision issues when working with them. For now, I have actually decided to use doubles, not floats, in the shader (doubles being 64-bit, rather than 32-bit) but doubles are only supported, I believe, in shader model 5 (Some of the 4.* updates may also support doubles, I am not sure).
Shader model 5 is the newest shader model, and as such, would not be supported by the majority of hardware yet. This causes a significant compatibility problem. I will need to create some kind of “fallback” option in the future, but for now, this option works, and I can evenly subdivide the terrain based on height.
I am also concerned with how this solution with work for very distance planets, or multiple planets, I haven’t had a chance to test this yet. I am confident that I will be able to solve these issues if and when I run into them though.
I now need to blend each layer, which should be fairly simple, since I can refer back to the shaders I wrote in P-152.

29/11/2016 , 08:21:28 PM
Unity Personal (64bit) – P0Main.unity – New Unity Project – PC, Mac & Linux Standalone*

29/11/2016 , 08:22:16 PM
Unity Personal (64bit) – P0Main.unity – New Unity Project – PC, Mac & Linux Standalone*

29/11/2016 , 08:25:51 PM
Unity Personal (64bit) – P0Main.unity – New Unity Project – PC, Mac & Linux Standalone*

30/11/2016 , 01:06:36 AM
Unity Personal (64bit) – P0Main.unity – New Unity Project – PC, Mac & Linux Standalone

01/12/2016 , 10:31:02 PM
Unity Personal (64bit) – P0Main.unity – New Unity Project – PC, Mac & Linux Standalone*
