A few of you may know that I'm using Hydrax in Project Utopia. Well, I'm starting to think about performance, and Hydrax is next on my list.
Okay, the way it currently works is:
- The world consists of one large body of land (I mean, really large). As a server is connected, the island increases in size.
- The idea is that around the outside of the 'island' is an infinite ocean. So the end of the world will basically be like looking out at sea into nothingness (as opposed to the boring 'surround it with mountains' approach). Okay, so the projected grid is perfect for that.
- Smaller water bodies inland are rendered on simple planes.
The major problem is that Hydrax is still rendered even when inland as a projected grid. So basically everywhere under the terrain the water is being rendered. Unfortunately Hydrax is a huge performance hit, especially with paged geometry; and with the underwater/depth/etc. effects it has to render everything in 3/4 passes (as far as I remember), so it's really expensive. Chances are, you're not going to be hanging around the coast most of the time.
I've thought about it, and here are some possible solutions:
1) Only load Hydrax in the 'outside' zones. So when a player enters an outside zone, Hydrax is loaded and the player can suddenly see the sea. The problem with this is that the game's performance in these outer zones would be noticeably less than in the inland zones, coupled with a considerable loading time each time a player enters and exists the zone. Plus, the zones are generally huge anyway, so a player may not even see the ocean until he/she is near the coastline.
2) Have Hydrax decide when to render according to the depth technique. The idea being that Hydrax always exists under the land, but where a certain depth is detected (i.e. the ocean surface), it is rendered as normal. Another way may be to have the water occluded and only rendered when it is in the camera view. Or even have Hydrax cut a massive hole out of its mesh. I have no idea if any of this would be possible, but that would be down to Xavyiy.
3) Use the simple grid and have multiple instances of Hydrax act like a zone. Imagine zones like tiles; so say if I had 4 inland zones, I would need 8 zones around the outside defined as water. I'm not sure how this would fare, or if Hydrax can handle it, and it may be more effort than its worth...
Out of the options, I would go with the first since each server has its own set of settings, and I can easily enable/disable Hydrax accordingly. But it's not very swimmingly (NPI).
If anyone has any suggestions/thoughts as to how Hydrax could perform at its best in a large world, that would be a great help.
(Oh and btw if anyone has any idea how to get the depth component working with PLSM, that would be greatly appreciated. It's just refusing to work, and causes PLSM to go crazy and crash out.)