Saturday, May 5, 2012

Video of a forest

As promised, here is a video of a forest:



Some stats about this video:

  • It was captured in realtime on an ATI 4770 at HD720p
  • Framerate was capped at 30 fps
  • It shows an area of 1 km x 1 km
  • It has seven LOD
  • It took 12 hours to generate in three VoxelFarm nodes
  • The generated mesh dataset is 100 MB

Some good news:

  • This is streaming over HTTP. Peak bandwidth was below 300K/seg
  • Mesh resolution can be increased, streaming can cope
  • LOD transitions are hardly noticeable

What needs work:

  • More diversity: This has only one type of tree leaves and two types of grass.
  • Needs more plants in the floor, bushes and baby trees
  • Shadows and global illumination
  • Billboard placement needs improvement
  • Better textures

Tuesday, May 1, 2012

Under the trees

Here are more foliage screenshots from Sputnik. It is the rest of the series I did over the weekend. As you can see the blobs are entirely removed, but they are still used to create the leaves and collect illumination.




Monday, April 30, 2012

Here is some pudin

Finally, some leaves. In this image you can see how trees look once the crown blobs have been seeded with branch instances. It is a very early test, but I thought it may help you see beyond the green blobs in all my previous tree screenshots.


This renders in realtime. I took the screenshot from my experimental HTTP streamer Sputnik. The lighting is very primitive. This will improve a lot with the radiosity solution.

I have been playing under this forest for a while now. I will post a video when I get some time.

As usual I look forward to your suggestions and ideas. I want to thank Robin Green for pointing a nice method to smooth normals. I'm already using portions of that.

Monday, April 23, 2012

The Faraway Forest

One recurring question about the trees and forests I am doing is how they will show in the distance, from how far you could see them. It is a real issue.

I chose a different approach for trees than most engines I know. In traditional engines, trees are done by instancing the same tree models many times over the landscape. Each tree instance is known by the scene management and rendering engine. If a tree is sufficiently distant it can be represented by a simpler instance. This works nicely even for distant forests, but it imposes a very homogeneous look for your trees. If you want very large trees with unique branches this becomes a problem. At some level of detail the unique tree needs to be replaced by an instance. The more unique the tree, the bigger the visual jump will be.

I wanted to take a different approach to instancing. I still use it, but for much smaller elements like grass, flowers, tree leaves and small branches. This means each tree has unique geometry. Trees are fairly complex objects, a distant forest could have thousands of them. How to overcome this?

Many years ago I was flying over the Amazon rain-forest. I could see a thick layer of tree canopies below and a thick layer of clouds above me. I was amused by how similar they were. I began wondering if a forest could be rendered as a volumetric object, more like clouds.


I also wondered if I could make tree canopies opaque. After all they are often so dense you cannot really see inside them. It would really cut the number of polygons. All the branches inside the canopy could be removed, only the larger branches supporting the canopy puffs would remain. Here is one example taken form a Voxel Studio mesh render preview:


When looking at this, keep in mind there is a missing layer of instancing that goes on the crown volumes. This is rendered pretty much like grass and flowers over the ground (which you also won't see in this picture). You will be able to see a lot of detail coming out of the tree crowns. The green blobs in the picture before are the base for this instancing. This basic geometry is from where leaves and small branches get their position and -very important- their illumination.

I liked the fact that tree identities would be lost in this gigantic cloud. The geometry of several trees could be merged and simplified together, there was no need to think of tree instances beyond the generation stage. Also it would be rather easy to perform light scattering in the canopy cloud. To me proper lighting was essential to convey the scale of the trees and how it feels to be under them.

This approach had some big issues too. It does not work very well unless trees have fairly thick crowns. You can have a lot of small crown puffs to represent sparse crowns, but this could hurt your polygon budgets.

Now comes the initial question: How does it look when trees are far away? This is where this approach can shine. Since there are no individual tree instances anymore, the volume can be simplified down to the levels we know will look fine on screen. Then the instancing of leaves and branches continues to provide detail on top of the simplified clouds.

The following images show how much the trees can be simplified. You need to remember that each consecutive level appears further away. When these meshes are rendered in their proper positions, you cannot really tell the coarse level is just a weird soup of polygons.

This is LOD 1, which is shown pretty close to the camera:


This is LOD 6, which shows a few hundred meters away from the camera:


And this is LOD 10, which appears at more than one kilometer away. As you can see, the forest has entirely blended with the terrain. This means the grown polygons are not rendered anymore, only the canopy layer remains visible:


Here you can see the same progression from a different point of view. The LOD levels are the same: 1, 6 and 10.


Hopefully I have answered that forest-in-the-distance question. This looks really nice when properly illuminated and adorned with instances. In the short future I will post about that.

Tuesday, April 10, 2012

New Look

It was a nice quiet long weekend. I had some spare time to sink into this project. While it has nothing to do with procedural generation, I was always bothered by the plain generic look of my Voxel Studio application. So I decided to give it a new look.

This is really a waste of time. Only one person in the entire planet is using this program (you guessed who), but hopefully this may change in the future. For us who spend so much of our lives looking a computer screens I think we should make our software pretty and fun to use.

Here are some screenshots:





The biggest change was I moved all the commands into a single "ribbon" interface. I was never a fan of the ribbon when it was introduced by Microsoft. Now I see it does make the UI simpler, especially for a program you never used before. I like the fact there are no modal dialogs anymore. It also creates more space if you want it. The ribbon can collapse, then it behaves similar to a traditional menu.

Something the screenshots don't show is the docking system for all the views allows to extend your workspace across different monitors. This is how I normally use this program.