Quad tree LOD, but with triangles?
#1 Members - Reputation: 127
Posted 05 December 2012 - 06:25 PM
Hello gamedev! I am a high school student working on a procedural planet engine in my spare time using DirectX 11 and C++.
Four weeks ago I was 100% new to DirectX 11, but I have learned a lot just by reading tutorials and getting inspiration
from tech demos.
So far I'm taking the Icosahedron approach to generating a sphere. There's a lot of blogs, articles and theory on this, but not
much raw code examples specifically for DX11 C++...most of them I have found are for OpenGL. It took me three weeks, but I
managed to write my own version of Andrew True's nifty counterclockwise method. (here) I've created wrapper functions for
properly subdividing and merging these triangles, now I need to work on dynamic LOD.
Unfortunately he doesn't seem to be active anymore, his website is gone, and he never posted anything on LOD with his tactic. :C
So for the last week I've been trying to come up with the best solution to triangle based LOD. I've read up on various methods like
quad trees, RTIN and ROAM, but they all deal with cube quads mapped to the sphere. I obviously need a different approach.
________________________________________________________
So I need something that works with my subdivided Icosahedron.
The first method I tried was very basic. I check distance on all triangles. If the distance was greater then a certain value I would
subdivide the triangle, and vice versa for merging children back into a parent. At first this method was extreeeeemly expensive.
I wasn't able to get past 3 subdivisions before the number of sqrt() calls per frame was taking a tole on my FPS.
I've optimized it since then by only checking distance on triangles of the current and previous LOD levels, but it's still waayyy
too slow and it's all done on the CPU side.
My goal is to be able to go from planet to surface...seamlessly...but I can't figure out how I would do this.
Am I wrong about chunked LOD? Can RTIN, ROAM, or quad trees work with my triangle setup somehow?
#2 Members - Reputation: 887
Posted 05 December 2012 - 07:29 PM
This lends itself beautifully to being hardware accelerated with the GPU on DX11. Here's a tutorial to read through, but also check out the sample that comes with your SDK.
http://www.rastertek.com/dx11tut38.html
Sorry I can't comment about your current algorithm, if it's not GPU accelerated using a geometry shader and the d3d11 tessellators it probably isn't worth pursuing.
Love DAOC? Tryout my DAOC clone: https://dl.dropboxusercontent.com/u/8974528/VON_Dist.zip
#3 Members - Reputation: 127
Posted 05 December 2012 - 07:45 PM
I really should be doing this on the geometry shader like you said.
EDIT: Wait...your saying I can send the base icosahedron data (only 12 vertices) to the GPU and then do tessellation
and heightmap stuff right there? None of this needs actually needs to be on the CPU side?
As far as hardware tessellation goes, how would I get the data back from the GPU to use with collision? Assuming that
is even possible, wouldn't the data be behind by one frame when I go to calculate with it?
Edited by Dr. Krunklehorn, 05 December 2012 - 07:49 PM.
#4 Members - Reputation: 887
Posted 05 December 2012 - 08:04 PM
Here I found this link:
http://prideout.net/blog/?p=48
Edited by Steve_Segreto, 05 December 2012 - 08:10 PM.
Love DAOC? Tryout my DAOC clone: https://dl.dropboxusercontent.com/u/8974528/VON_Dist.zip
#6 Members - Reputation: 127
Posted 06 December 2012 - 02:25 PM
exactly what I am looking for: http://puu.sh/1xFx7
I would like to change the Tessellator so it generates equilateral triangles like this: http://puu.sh/1xFIx
Could I do this in Hull and Domain shaders?
#7 Members - Reputation: 887
Posted 06 December 2012 - 07:46 PM
Love DAOC? Tryout my DAOC clone: https://dl.dropboxusercontent.com/u/8974528/VON_Dist.zip






