Now I will try adding it in sections:
Hi Guys-
I’ll hit all these at once, I appreciate the questions and comments:
-
- Floating Point Limitations:
I’ve seen this with procedural data when you go way, way, way out, but it’s not been a practical issue for me so far.
I did run into some issues tiling out the Birmingham data, so used doubles for intermediate calculations in a few places. For the runtime engine, it’s not been a problem with real-world data, the BHam set is about 1143 square miles and coordinates are not a problem.
Infinite procedural background has a definite limitation, but for the real world data it hasn’t been an issue (so far).
Check out the live camera fly-through, that is pulling from disk, it’s choppier running from ftp but once the data is streamed into memory, integrating with the runtime engine is very quick. The core is designed to stream in new data from network (or local disk) with minimal delay, you can see this in the live video from the cell phone.
One of the reasons I did the cell phone video was to show how smooth it runs without video capture running, a stand-alone implementation (straight c++/dx) would be much easier to work with, as Unity has some limitations.
There are definite limitations with hardware/memory/bandwidth/etc. but it runs decently enough on my system with BHam, and that’s a good test case.
So, the short answer is, it really depends on the data and hardware, but it has a high performance limit before it craps out.
The tiles are never touched manually, the only thing needed is the path to the different LODs and the naming convention for the files.
The script code has a client callback to request any tile at XY coordinate, at lodLevel n.
The raw data is a bunch of tiles, downsampled into a pyramid of LODs (so if the first LOD has like 16x16 tiles, the next LOD has 8x8, and so on). So you have to tile out mipmaps (more or less), but it’s just folders of images.
None of that ever has to be loaded into Unity, the critical info is the naming convention for the paths, how many LODs, how many xy tiles in each LOD, expected resolution, things like that.
The webplayer can stream tiles from any ftp so it will be possible to enter in your own path info and stream custom tiles (once I get the GUI in there for that).
NOTE: It’s possible to pre-setup environments using a mix if custom regions and procedural stuff, so you could custom create a terrain using Unity with the other features, however, for the tiling stuff, it just streams the raw imagery (tiled into LODs) and heightmaps, and runs it on the spot.
There are a few ways of getting data into the engine but it’s designed to be as hands-off as possible. Generic images are used for the input data, with no pre-processing required.
-
- Cache terrain over areas already gone over
It could save the data, but the memory is reserved for runtime stuff so it doesn’t hang around if not needed. I will be adding some predictive cache stuff in the future (which might hang on to older regions) but for now it just caches as needed and stores only the data required.
The elevations and texture have an internal LOD system so it does store more data than is actually rendered per frame. SO there is a ton of data in the background that might not actually make it to the screen.
The engine uses a custom mesh, and Unity is a bit slow about vertex buffer access (the mesh basically has to be updated each frame).
I can do the terrain collisions, etc., and there is code for that, but it’s not a pre-baked mesh, it’s always dynamic. It would be nice if Unity provided lower level access to the vertex buffer stuff, but it seems to run ok as is. A standalone c++/dx version doesn’t have those issues.
The mesh data could potentially be generated and save out, and the code interface could be used to generate procedural (mixed with custom) data, but saving the mesh isn’t so critical, it’s a rendering system and not so much of a world-builder.
NOTE: Morphing LODS: The elevation data is constantly being morphed for smooth transitions between LODs, if you check out the gamish-demo on the main site page that will show an example of that.
The LOD settings for geometry are adjustable in script, and whatever data is available (heightfields, etc.) will be filtered through those settings. So you could have high-res data filtered through a low-res terrain mesh, and vice-versa.