Sign in to follow this  
soconne

HALLELUJIA !!!!!!!

Recommended Posts

soconne    105
OMG, I just switched from using glDrawElements in my geomipmapping terrain engine to using glDrawRangeElements, and I got an 80FPS INCREASE !!!!!!!!! Anybody writing a terrain engine should definitely switch to it if you already didn't know this !

Share this post


Link to post
Share on other sites
soconne    105
Well before the switch, I was using glDrawElements and VBO.
And with a 1024x1024 heightmap and a 2048x2048 texture and a 512x512 detail map I was getting about 220fps on a

P4 2.8Ghz HT
1GB PC3200
Radeon 9800 Pro 128MB



And now I'm getting between 300-320fps and a lot more when the LOD is low. I can get up to 550fps if I fly above the terrain.

Share this post


Link to post
Share on other sites
Hamster    247
Just thought I'd slip a quick question in here. I've been trying to write algorithms to generate indices for triangle strips for the connecting strips between patches of differing levels of detail. All attempts seem to work sometimes, but not be able to cope with all valid cases. How are you connecting between patches of differing levels of details? Were you up against this problem, and (just to reassure me that it can be done) did you succeed in getting rid of the gaps without resorting to skirting?

By the way, well done on the speedy implementation, I'll have to switch to VBO's soon. Currently just using standard indexed buffer, not even CVA... shameful :-).

Share this post


Link to post
Share on other sites
Ademan555    361
funny you should say that, im implementing VBOs right this second :-D, but anyways, am i missing something or is glDrawRangeElements() an extension or something? (or what header is it in?) because its not in my gl.h (or at least msvc's auto type isnt recognizing it)
-Dan

Share this post


Link to post
Share on other sites
Promit    13246
Quote:
Original post by Ademan555
funny you should say that, im implementing VBOs right this second :-D, but anyways, am i missing something or is glDrawRangeElements() an extension or something? (or what header is it in?) because its not in my gl.h (or at least msvc's auto type isnt recognizing it)
-Dan


It's in GL 1.2, so you either need a header which gives you 1.2 or the extension. Can't remember the extension's name right now.

Share this post


Link to post
Share on other sites
benjamin bunny    838
Quote:
Original post by bytecoder
Just so you know, an 80 fps increase in speed isn't that much of a difference when a game already has high fps, due to the fact that measurements in frames per second are highly non-linear.


OT: I agree with the author's point, but it's interesting that he chooses this an example of misuse of fps:

Quote:
"My application was running at 900FPS, then I added rendering of .... and my frame rate dropped to 450FPS. Why is this feature so slow?? Why is it cutting my performance in half?!??"


Looks correct to me anyway [smile].

Share this post


Link to post
Share on other sites
nts    968
Quote:
Original post by Hamster
Just thought I'd slip a quick question in here. I've been trying to write algorithms to generate indices for triangle strips for the connecting strips between patches of differing levels of detail. All attempts seem to work sometimes, but not be able to cope with all valid cases. How are you connecting between patches of differing levels of details? Were you up against this problem, and (just to reassure me that it can be done) did you succeed in getting rid of the gaps without resorting to skirting?

By the way, well done on the speedy implementation, I'll have to switch to VBO's soon. Currently just using standard indexed buffer, not even CVA... shameful :-).


This might help you

fixing geomip, no skirts

scroll down there is code for generating the indicies and for fixing the cracks, pretty self explanatory.

Share this post


Link to post
Share on other sites
soconne    105
Yeah, that's actually the thread where I figured out how to do mine. Here's my basic code if you want to see it.
It might look a little odd, but it works, and it makes sense to me.

http://cs.selu.edu/~soconnell/code.txt


Also, have you guys noticed the new gamedev forum doesn't email you when somebody replies to your thread?

Share this post


Link to post
Share on other sites
Hamster    247
I got the tesellation working in the end with triangle strips. Just a day or two of algorithm debugging :-). Now I just have to work up the energy to finish my terrain editing tools... no rest for the wicked, but thanks for the replies.

Share this post


Link to post
Share on other sites
Promit    13246
I just thought I'd point out, making an inline function as a member of a class but not defining it in the header has a habit of not working. It might work in the same compilation unit, but beware if that's a public function.

Quote:
Original post by oconnellseanm
Yeah, that's actually the thread where I figured out how to do mine.

Well, you posted the topic; it'd be unfortunate if you didn't figure out how to do it [wink]

Share this post


Link to post
Share on other sites
_the_phantom_    11250
Quote:
Original post by Promit
I just thought I'd point out, making an inline function as a member of a class but not defining it in the header has a habit of not working. It might work in the same compilation unit, but beware if that's a public function.


not strickly true, it is possible to do Link-time inlining as well as compile time, although it requires a switch to be passed to the linker and works with the VC7.0.

more info here
and here

the important bit being
Quote:

To use LTCG from the Visual Studio .NET IDE is as simple as ensuring that the Whole Program Optimization option is set to Yes. This can be found in the project's Configuration Properties | General pane.

Share this post


Link to post
Share on other sites
Trienco    2555
Quote:
Original post by _the_phantom_
not strickly true, it is possible to do Link-time inlining as well as compile time, although it requires a switch to be passed to the linker and works with the VC7.0.


though i would still argue that inline functions, just like templates should/must be known at compile time and belong into the header, as the source files arent supposed to know each other.

and just think how much you will hate yourself if you need to switch to a compiler without that feature ,-)

Share this post


Link to post
Share on other sites
_the_phantom_    11250
yes, it does make sense at compile time, true, however as pointed out in the first article I linked at link time the system has alot more infomation about the calling site so can make a much more informed choice about inlining code in the long run.

Tbh, i'm hoping that other compilers/linkers will offer this as it could help speed up sections of code by being able to do better inlining across object files.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this