Optimize my ROAM engine!
I have been working on a roam engine for the last week, and it''s now working reasonably fast, but it needs to be faster. I''m using a Quadtree to store everything, and at the mo on my athlon 800 with a 32mb geforce 2 gts it''s getting around 30fps in 640x480x16 fullscreen when drawing about 10000 tris on-screen, using OpenGL.
Two things I want to implement are:
* Geomorphing
* Frame Coherence (reusing the last frame''s tessellated mesh)
Now, frame coherence is bloody complicated (so I''ve heard), so can anybody explain how to implement it to me, or point me towards some tutorial or something please?
Wih geomorphing, i know what it is, but how do I actually calculate my percentage value for how morphed a particular node is? Just a simple equation would be great...
Any help appreciated - 30fps is not enough 4 me!
========
Smidge
www.smidge-tech.co.uk
========
--Mr Smidge
Hello, I tried to get a good ROAM implemention running awhile back, while I was unsuccessful before I got bored with the idea I found some good info:
There is an article on GamauSutra located at:
http://www.gamasutra.com/features/20000403/turner_01.htm
Though it doesn''t provide tons of information on frame-coherence, it gives hints and links about it. One of the links is a link directly to the original paper detailing ROAM which is found at:
http://www.llnl.gov/graphics/ROAM/
As for geo-morphing.. If you mean mimicking the effects of natural processes such as erosion, weathering, earthquakes, etc. I don''t really know where to point you. I can tell you that seeing as how you''ve implemented ROAM, you know that you re-tessellate every frame. Now, to geo-morph you can modify the heightmap using some sort of algorithms (for example a crater might just lower the height values in the shape of a circle) and set a flag that the variance tree for this part of the landscape needs to be rebuilt.
Anyways good luck.
There is an article on GamauSutra located at:
http://www.gamasutra.com/features/20000403/turner_01.htm
Though it doesn''t provide tons of information on frame-coherence, it gives hints and links about it. One of the links is a link directly to the original paper detailing ROAM which is found at:
http://www.llnl.gov/graphics/ROAM/
As for geo-morphing.. If you mean mimicking the effects of natural processes such as erosion, weathering, earthquakes, etc. I don''t really know where to point you. I can tell you that seeing as how you''ve implemented ROAM, you know that you re-tessellate every frame. Now, to geo-morph you can modify the heightmap using some sort of algorithms (for example a crater might just lower the height values in the shape of a circle) and set a flag that the variance tree for this part of the landscape needs to be rebuilt.
Anyways good luck.
--------------------------I guess this is where most people put a famous quote..."Everything is funnier with monkey''s" - Unknown
For some random reason unknown to me, I wrote "quadtree" when I meant "binary triangle tree" - how strange.
Thx for the links by the way
Geomorphing (in my case) is not the changing of the heightmap, but a way to remove the ugly popup when an area of landscape is tessellated and the height value which is actually drawn changes, and it looks horrible at close range.
So geomorphing basically has a single value (between 0 and 1) which is the amount between the interpolated value (when it''s not tessellated to highest detail) and the actual value (in the heightmap). I am unsure, however, of how to calculate this value.
========
Smidge
www.smidge-tech.co.uk
========
Thx for the links by the way
Geomorphing (in my case) is not the changing of the heightmap, but a way to remove the ugly popup when an area of landscape is tessellated and the height value which is actually drawn changes, and it looks horrible at close range.
So geomorphing basically has a single value (between 0 and 1) which is the amount between the interpolated value (when it''s not tessellated to highest detail) and the actual value (in the heightmap). I am unsure, however, of how to calculate this value.
========
Smidge
www.smidge-tech.co.uk
========
--Mr Smidge
January 07, 2001 12:13 AM
For geomorphing, you already know the initial height value, and
the ending height value, right?
So can''t you just use linear interpolation (over a period of time)
to morph between the two heights?
the ending height value, right?
So can''t you just use linear interpolation (over a period of time)
to morph between the two heights?
I''d agree with anonymous poster.
Once you get the frame coherence down, I imagine its just a matter of saving the two heights in the relevant node, the time that the change occurred, and then linearly interpolating between these two.
If you asking how to calculate the value between 0..1 here''s how I would do it:
dword timestamp;
float morph_factor;
morph_factor = (GetCurrentTime()-timestamp) / GEOMORPH_TIME;
''timestamp'' is the time that the change occured, and ''morph_factor'' would be the number between 0..1.
GEOMORPH_TIME is some constant you define which will be the length of time it takes to morph from one state to the next.
Get it?
Once you get the frame coherence down, I imagine its just a matter of saving the two heights in the relevant node, the time that the change occurred, and then linearly interpolating between these two.
If you asking how to calculate the value between 0..1 here''s how I would do it:
dword timestamp;
float morph_factor;
morph_factor = (GetCurrentTime()-timestamp) / GEOMORPH_TIME;
''timestamp'' is the time that the change occured, and ''morph_factor'' would be the number between 0..1.
GEOMORPH_TIME is some constant you define which will be the length of time it takes to morph from one state to the next.
Get it?
--------------------------I guess this is where most people put a famous quote..."Everything is funnier with monkey''s" - Unknown
I think what smidge means by ''Geomorphing'' is something like what Tribes did...
Instead of just sharply chopping out polygons further away to save the poly count, it smoothly blends it from one detail level to another, interpolating (as you move closer) from the lower grid detail level to the higher.
I hope that makes sense.
If the above is the case, I think I have an answer for you.
When I use this terrain rendering method, I use a lookup table, and use it as if it is aligned for the detail of the mesh. All you would have to is, instead of using the strict and precise value that the grid gives you, lay another copy of this grid that is aligned on the player.
Now, look at the grab-points (the points where you take the height for the rendered mesh) of the second table, and see where they line up on the first grid. Now, I don''t know the math, but you would calculate the height for the second grid by interpolating between the four points of the first grid that surround it.
Finally, use this second grid, with the now-aquired heightmap values, as your rendering grid.
If that doesn''t make sense, send me an Email (zlaj@hotmail.com), and I''ll see what I can do for you.
Instead of just sharply chopping out polygons further away to save the poly count, it smoothly blends it from one detail level to another, interpolating (as you move closer) from the lower grid detail level to the higher.
I hope that makes sense.
If the above is the case, I think I have an answer for you.
When I use this terrain rendering method, I use a lookup table, and use it as if it is aligned for the detail of the mesh. All you would have to is, instead of using the strict and precise value that the grid gives you, lay another copy of this grid that is aligned on the player.
Now, look at the grab-points (the points where you take the height for the rendered mesh) of the second table, and see where they line up on the first grid. Now, I don''t know the math, but you would calculate the height for the second grid by interpolating between the four points of the first grid that surround it.
Finally, use this second grid, with the now-aquired heightmap values, as your rendering grid.
If that doesn''t make sense, send me an Email (zlaj@hotmail.com), and I''ll see what I can do for you.
RIP GameDev.net: launched 2 unusably-broken forum engines in as many years, and now has ceased operating as a forum at all, happy to remain naught but an advertising platform with an attached social media presense, headed by a staff who by their own admission have no idea what their userbase wants or expects.Here's to the good times; shame they exist in the past.
What I mean by Geomorphing is exactly what Wyrframe said.
The point is that the ground does not morph depending on time, neither does it have value 1 when it''s directly under you and 0 when it''s infinitely far away.
Anyway, that seems to be no trouble, so......
New optimization: can anybody shed some light on how to put triangle fanning into this to speed up the rendering process?
Thx
========
Smidge
www.smidge-tech.co.uk
========
The point is that the ground does not morph depending on time, neither does it have value 1 when it''s directly under you and 0 when it''s infinitely far away.
Anyway, that seems to be no trouble, so......
New optimization: can anybody shed some light on how to put triangle fanning into this to speed up the rendering process?
Thx
========
Smidge
www.smidge-tech.co.uk
========
--Mr Smidge
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement