I now have the basic terrain system with water working for Zotbox. This all runs very smoothly on the Quest 2 with a lot of headroom for future CPU/GPU needs. I use the Quest 2 for testing since this is the baseline. The terrain is scalable so on Quest 3 there will be a larger view distance for example. Getting to this point hasn’t been easy and I am very excited for where this is going.
URP and the SRP Batcher
Shifting to URP is key with the SRP batcher removing much of the draw call overhead. As long as it shares the same shader variant the meshes with different materials and textures are still batched together. Chunk meshes are batched, detail meshes are batched, etc. It doesn’t remove completely the issue of draw calls but mostly does and reduces it down to more of a shader complexity problem. Using the Unity frame debugger has been essential and I highly recommend it.
Beyond solving batching it has been a struggle to keep vertex load down and minimize transparency and shader complexity. Except for the water meshes there is very little transparency. This is where the art style is key to complimenting the approach to performance. Following a Minecraft and Hytale look reduces vertex counts and the shaders are simple visually. All the main pieces will have custom shaders working within URP but actually simplified from all the extraneous things the standard URP shaders try to handle. This reduces overhead in the shaders and helps boost performance. It may even be possible to eventually move to a custom rendering pipeline using SRP.
Biomes and Details
Zotbox has a basic biome system and both the biomes and water are block based. So water will be in the areas initially generated but with a water algorithm flow out of that into other areas. There can also be multiple water bodies and settings for different looks. What is shown is just the ocean one. There could be clear pristine mountain lakes or pools of green fetid swamp water.
There is also an initial terrain detail system tied to this so details such as trees, rocks, seagrass, shells, etc. are generated through that. Unlike Minecraft the details are models but are tied to the block grid and consume space in it. They will be incorporated into the block based GI and can be created and destroyed similarly to blocks. This will be a big difference from something like Minecraft and provide a lot more richness to the world while still following an art style similar to it.
When moving in the water the underwater lighting, color, and visibility is based on the biome water settings and depth. For the ocean settings it shifts to a darker blue and then the light goes down to almost zero at the bottom. This could be set differently for other water bodies like the pristine lake or the fetid marsh examples.
Buoyancy and Water Effects
I also have water buoyancy working with the floating crate. The buoyancy system will eventually take into account block water flow vectors whenever I get to implement the block water flow algorithm.
There are various basic effects still to do such as the floating water particles and the splash effects. These are fairly simple although I will be trying to do them using particles without any transparency. Again this can work given the art style in most cases. I may also try a very simplistic caustics effect but that is a long shot and probably won’t happen.
More Details Including Kelp and Coral
The initial detail models will also expand with additional models in each category such as rocks, stones, shells, etc. I will be adding a kelp tree that will be dynamic going from the ground to the water surface in the middle depths. There will also be a coral system that will add coral blocks then the coral detail models on top. This will use some Perlin noise generation to do these in clumps.
Lost Loot!
So with all this good news it is official – Lost Loot will be returning in a new form! I plan on doing a remake of the original Lost Loot concept as the first mini game built on Zotbox. Those around in the DK1 days will fondly remember it from Oculus Share. It is fairly simple and the basic mechanics are fun. The art style and added capabilities provided by Zotbox will work well with it and allow for a richer game including a full underground to explore – so much to do!