Hi cameni,
First, let me congratulate you and all people involved in Outerra project for your outstanding engine and its huge contribution to terrain rendering techniques.
About FBOs, a cause for my stutters was that I was not properly using it. I had a few FBOs and I was switching color attachment to avoid reallocating the depthstencil but this is clearly a bad idea.
I did a few tests with a pool of n preallocated FBOs, n being the maximum number of tiles using RTT at a given time, and the results are showing an improvement.
On the other hand, I quickly fill the VRAM with this technique with depthstencil buffer used only once.
Do you have any tips on this ? Maybe there's a technique between those two ? (like having a smaller pool of FBOs and copying the color texture ?)
I read on another topic one of your sentences : "The roads are defined as vector data, and they are applied on the terrain on GPU using a blending shader that merges it with the existing terrain, to seamlessly blend it in there".
I'm not sure to understand, do you draw your roads as a post process ? Or is it a render to texture of vector data at runtime, the resulting texture being used as a layer when rendering the terrain tile ?
About the multiple materials, I've always been afraid of doing multiple passes because of the amount of geometry... It's the same with the creation of reflection, refraction or shadow maps. I'm still impressed with the amount of triangles I can render with CDLOD and tesselation so I guess I'm always wrongly feeling I'm about to hit hardware limitations.
But you're right, I guess a good first step would be to separate water rendering from the rest, using stencil buffer to avoid unnecessary computations.
Can you confirm your water rendering is done the same way your terrain is rendered, ie regular mesh with all shoreline and gradient informations passed as textures.
And are those textures rendered at runtime from vector data or already as images in your data format ?
As a last question, do you have any tips on how to group several tiles in a single drawcall ?
At the moment, I have a single tile per drawcall because all uniforms (uv offset, position offset, etc...), textures (height map, normal map, landclass maps, etc...) are different.
When drawing several hundred tiles, the cost of these uniforms and texture switch is heavy and I feel like this would be a good path of performance improvement.
Thanks again for your precious advice.