P0-P-172: Part 100: Procedural Content: Foliage System
I have mostly finished my foliage system, for the moment.
I have removed the 4 texture limit, and added the ability to add new textures or texture combinations by height, and vary their density.
I was making a stupid mistake with the shader, which cost me some time. I was using the camera position instead of the vertex position, and I was wondering why all of my foliage types were changing at once.
I believe there are still some memory leaks in the shader, and I still have new features to add, such as new texture types and values, and a “paging” texture system. This would allow me to swap out textures as the player moves around the world, so that I would only need to have a small number of textures loaded at once.
Overall I am quite satisfied with how this worked out, I think it will dramatically improve the look of the terrain. Something that I really like about it is that I can render a LOT of foliage without any major performance problems (and I am running the game through the Unity editor!) this is exactly the result I was trying to achieve.
The next goal is to add a similar system for trees, rocks, and other larger objects. The problem here though is that they will need to be in the same place for all clients. I intend to research various procedural content generation techniques in an attempt to generate the trees on each client using seeded random numbers. I have decided to move more towards procedural content generation on the client rather than the server, due to the issues that I experienced recently. The game will still be multiplayer, and I will still have a single game world which is explorable and modifyable by all players, but instead of doing most of the work on the server, I will simple be creating seeds and property values on the server, and sending those to the client for rendering.
I now need to figure out how to create an entire forest based on a single seed, while also only processing the tree objects close to the player. IE, I can’t just generate all of the trees at once from the same seed, there would be far too many.

29/01/2017 , 01:43:08 AM
Unity Personal (64bit) – P0Main.unity – New Unity Project – PC, Mac & Linux Standalone

27/01/2017 , 07:02:14 PM
Unity Personal (64bit) – P0Main.unity – New Unity Project – PC, Mac & Linux Standalone

27/01/2017 , 07:01:57 PM
Unity Personal (64bit) – P0Main.unity – New Unity Project – PC, Mac & Linux Standalone

27/01/2017 , 07:01:21 PM
Unity Personal (64bit) – P0Main.unity – New Unity Project – PC, Mac & Linux Standalone

27/01/2017 , 05:04:16 AM
Unity Personal (64bit) – P0Main.unity – New Unity Project – PC, Mac & Linux Standalone

27/01/2017 , 02:53:15 AM
Unity Personal (64bit) – P0Main.unity – New Unity Project – PC, Mac & Linux Standalone*

27/01/2017 , 05:03:55 AM
Unity Personal (64bit) – P0Main.unity – New Unity Project – PC, Mac & Linux Standalone
