Hello OpenGL gurus!
I am developing free (Open Source) helicopter simulator - you can find it here: http://decopter.sf.net.
I’ve read about terrain rendering. First I wanted just to draw whole terrain with brute force method. Then I read about LOD - small triangles near, big triangles far - sounds good. I though about quadtree, then I discovered ROAM.
Now I read 2048x2048 picture with heightmap, generate patches, every patch contains 2 binary triangle trees. Every frame I am recalculating trees.
This method sucks. First: terrain is to small, I need something 100 times bigger. Maybe I should load 2048x2048 picture, then add some sin/cos functions? Then I will have 32768x32768 map, but don’t need to remember it all the time - just visible patches.
Second disadvantage of this method is: it needs a lot of calculation. I don’t have split/merge queue yet, but is it really worth to code it? I mean - maybe it’s better to produce (binary triangle tree!) 2-3 levels of detail for every patch and put it in display lists?
I need 9 (3x3) or 25 (5x5) or 49 (7x7) patches at one moment. Camera will be in center patch. I think best choice is 7x7, becouse I could have 3 levels of detail (3x3 - high detail, 5x5 - medium detail, 7x7 - low detail). So I will create “cache” which will remember about 100 patches. When camera move from one patch to another - recalculation will be needed. First engine will check cache - if there is no patch there - oldest patch will be removed from cache and new patch will be calculated (generate sin/cos points, calc bintrees).
The problem is - I can’t just calculate new patches at one moment, becouse game will stop for a while! What can be solution for it? Second thread?
Textures… How could you make LOD with textures? I mean how can be triangle with many textures inside? Should it be always splitted? I don’t want to have one texture for every patch. I need texture for water, other for low land, other for mountains, etc…
Lighting… I’ve read about lightmaps, yes, it’s easy to generate it. But I can’t modify lightmap, what about moving lights? Even Sun is moving on sky. The second problem - I need to remember lightmap for every patch. So patch generation will be longer again.
Do you know any solution for calculating Normals when using LOD?
Please help me - my game needs good terrain engine