The previous post described a new system that allows rendering rich surfaces we call "meta-materials" using low-resolution geometry. Meta-materials cover ranges from 100 meters to 10 meters. What about anything more distant than that, that is, the range from tens of kilometers down to 100 meters?
It turns out the same system applies. You can think of this as "meta-meta-materials", we just do not call them that because one "meta" in a name is already too much. We have multiple objects that do fit that description. A terrain biome is one example.
In this post, you can see the results of applying this method to biome objects. All images are in faux solid color, which we use to make sure feature placement is correct.
Here is a single biome and the amount of geometry it takes to represent it:
In order to capture the detail, this biome also uses 1024x1024 texture maps for diffuse color, normals and other maps required for physically based rendering. Terrain voxels, which are generated on the fly, emit UV coordinate pairs which link the voxel's position in the world with the right section of these texture maps.
Here you can see multiple biomes in the same image, again in faux color, covering an area of approximately 3000 square kilometers:
Since most detail is contained by textures, it is possible to use a much coarser geometry. The following images show that we can crank up the mesh simplification and still obtain fairly good looking features:
As a creator of worlds, this feature is entirely transparent to you. These detail textures are automatically generated. Actually, all the content in these images was generated by our procedural algorithms, but if you had custom made maps, you would not need to be concerned about creating and maintaining the detail textures.
Like I said in the previous post, this is a technique frequently used in modern polygon-based terrain. The key here is this is now working on voxel terrains. These environments can be modified in real time by players. They can harvest materials, make trenches, even blow out entire craters in real time.
Following one man's task of building a virtual world from the comfort of his pajamas. Discusses Procedural Terrain, Vegetation and Architecture generation. Also OpenCL, Voxels and Computer Graphics in general.
Showing posts with label Detail Recovery. Show all posts
Showing posts with label Detail Recovery. Show all posts
Thursday, February 2, 2017
Saturday, July 4, 2015
Export your creations
We just completed a new iteration on the FBX export feature. This new version is able to bake textures along with the geometry. Check it out in this video:
The feature seems rather simple to the user, however there are massive levels of trickery going on under the hood.
When you look at a Voxel Farm scene a lot of what you see is computed in realtime. The texturing of individual pixels happens in the GPU where the different attributes that make each voxel material are evaluated on the fly. If you are exporting to a static medium, like an FBX file, you cannot have any dynamic elements computed on the fly. We had no choice but to bake a texture for each mesh fragment.
The first step is to unwrap the geometry and make it flat so it fits a square 2D surface. Here we compute UV coordinates for each triangle. The challenge is how to fit all triangles in a square while minimizing wasted space and any sort of texture distortion.
Here is an example of how a terrain chunk is unwrapped into a collection of triangles carefully packed into a square:
The image also shows that different texture channels like diffuse and normal can then be written into the final images. That is the second and last step, but there is an interesting twist here.
Since we are creating a texture for the mesh anyway, it would be a good opportunity to include features not present in the geometry at the current level of detail. For instance, consider these tree stumps that are rendered using geometry at the highest level of detail:
Each subsequent level of detail will have less resolution. If we go ahead five levels, the geometric resolution won't be fine enough for these stumps to register. Wherever there was a stump, we may get now just a section of a much larger triangle.
Now, for the FBX export we are allocating unique texture space for these triangles. At this level of detail the texture resolution may still be enough for the stumps to register. So instead of evaluating the texture for the low resolution geometry, we project a higher resolution model of the same space into the low detail geometry. Here you can see the results:
Note how a single triangle can contain the projected image of a tree stump.
This process is still very CPU intensive as we need to compute higher resolution versions for the low resolution cells. This iteration was mostly about getting the feature working and available for users. We will be optimizing this in the near future.
The algorithms used here are included in the SDK and engine source code. This sort of technique is called "Detail Transfer" or "Detail Recovery". It is also the cornerstone for a much better looking LOD system, as very rich voxel/procedural content can be captured and projected on top of fairly simple geometry.
The feature seems rather simple to the user, however there are massive levels of trickery going on under the hood.
When you look at a Voxel Farm scene a lot of what you see is computed in realtime. The texturing of individual pixels happens in the GPU where the different attributes that make each voxel material are evaluated on the fly. If you are exporting to a static medium, like an FBX file, you cannot have any dynamic elements computed on the fly. We had no choice but to bake a texture for each mesh fragment.
The first step is to unwrap the geometry and make it flat so it fits a square 2D surface. Here we compute UV coordinates for each triangle. The challenge is how to fit all triangles in a square while minimizing wasted space and any sort of texture distortion.
Here is an example of how a terrain chunk is unwrapped into a collection of triangles carefully packed into a square:
The image also shows that different texture channels like diffuse and normal can then be written into the final images. That is the second and last step, but there is an interesting twist here.
Since we are creating a texture for the mesh anyway, it would be a good opportunity to include features not present in the geometry at the current level of detail. For instance, consider these tree stumps that are rendered using geometry at the highest level of detail:
Each subsequent level of detail will have less resolution. If we go ahead five levels, the geometric resolution won't be fine enough for these stumps to register. Wherever there was a stump, we may get now just a section of a much larger triangle.
Now, for the FBX export we are allocating unique texture space for these triangles. At this level of detail the texture resolution may still be enough for the stumps to register. So instead of evaluating the texture for the low resolution geometry, we project a higher resolution model of the same space into the low detail geometry. Here you can see the results:
Note how a single triangle can contain the projected image of a tree stump.
This process is still very CPU intensive as we need to compute higher resolution versions for the low resolution cells. This iteration was mostly about getting the feature working and available for users. We will be optimizing this in the near future.
The algorithms used here are included in the SDK and engine source code. This sort of technique is called "Detail Transfer" or "Detail Recovery". It is also the cornerstone for a much better looking LOD system, as very rich voxel/procedural content can be captured and projected on top of fairly simple geometry.
Tuesday, June 28, 2011
Mesh re-projection of a Tree
I did this screenshot recently. It shows how original geometry can be compressed and still retain most of its complexity in the textures. The subject in this case is a tree:
As usual you can click on the image to get a higher resolution version.
As usual you can click on the image to get a higher resolution version.
Friday, June 17, 2011
Mesh re-projection, a screenshot
This screenshot illustrates another key step in the world generation workflow:
As you can see I threw in the silhouette of a gentleman so proportions can be better appreciated.
The world geometry is initially generated in very high detail. I want this to run on low-end devices, so using this geometry in the client is out of the question. The high detail geometry is simplified until a certain thereshold of polygons per volume is met. For this I use simplification based on Quadratic Error Metrics, but a flavor of my own. I tested several of the mesh optimization codes out there, not one could simplify the huge meshes I was generating fast enough. I plan to cover that side of the story in a future post.
Then the high resolution geometry is projected onto the low resolution geometry, so a lot of the detail is preserved in form of textures. I will cover this method in the future too, but it is very similar to the one described in GPU Gems 3, Chapter 22.
As as result, an entire world scene can be rendered with a very small number of polygons, which will come very handy I'm sure.
As you can see I threw in the silhouette of a gentleman so proportions can be better appreciated.
The world geometry is initially generated in very high detail. I want this to run on low-end devices, so using this geometry in the client is out of the question. The high detail geometry is simplified until a certain thereshold of polygons per volume is met. For this I use simplification based on Quadratic Error Metrics, but a flavor of my own. I tested several of the mesh optimization codes out there, not one could simplify the huge meshes I was generating fast enough. I plan to cover that side of the story in a future post.
Then the high resolution geometry is projected onto the low resolution geometry, so a lot of the detail is preserved in form of textures. I will cover this method in the future too, but it is very similar to the one described in GPU Gems 3, Chapter 22.
As as result, an entire world scene can be rendered with a very small number of polygons, which will come very handy I'm sure.
Subscribe to:
Posts (Atom)







