Skip to main content
GameDev.net gamedev.net
🔒 Locked

Another terrain rendering question

Started by RobM Sep 29, 2008 at 8:58 AM 3 replies 1.1k views
Original Post
RobM
RobM
Hi all I'm using DX9, unmanaged c++ and my current hardware is an NVidia 8800GTS, 2gb RAM and an Intel Core 2 Duo 2.5ghz processor. My terrain is 4096x4096 and features a Crysis-style LOD technique (see Crysis in wf mode). For the most heavily detailed areas, I can draw the frame in under 3ms going down to 0.5ms for less detailed areas, so frame rate never really drops below 300fps in 1920x1200 and generally on average is around 400fps. I'm using a vertex shader to combine height and xz vertex streams, and the pixel shader for some basic 3-texture splatting and I'm not rendering anything else. The CPU is also used as the index buffers for the patches are locked and unlocked each frame (I don't want to use vertex textures yet). At the moment, the memory footprint is around 115megs and my limit is 512. My question is, at what point should you stop trying to optimize the terrain? I know it's a question that probably requires more parameters, but at what point do you say "the terrain is rendering fast enough now to move on to the next part of the game"? (which for me is probably more flexible multi texturing). Eventually, the game will have some instanced objects (trees probably) and a few characters but nothing else really overly graphics-intensive. I feel like it is fast enough (I'm aiming for 60fps or 16ms drawtime) and that the LODS change in the correct places (it all looks pretty realistic). I'm guessing the answer is that if the rest of the game is done and it's not fast enough, go back and further optimize the terrain, but I just wondered if there was any opinion on what's acceptable for terrain-only rendering. Can anyone post some fps figures for comparable terrain size/hardware configuration? Thanks in advance.
ndhb
ndhb
Maybe you also want to submit a few screenshots and what your goals are in terms of image quality? It makes more sense to first achieve what is acceptable image quality, and then look at performance - i.e. it doesn't matter if you render 1000 fps if you're not satisfied with image quality. Does it look good enough already? Sounds like it works fast enough at the moment (more than 100-200 FPS), that you can spend more resources on improving image quality?!
Ashaman73
Ashaman73
Without any requirement no action !

Is there any requirement to render your terrain faster than 300-400 fps ? Not really ! So , try to progress with your engine development.

There are two major problems with optimizing only parts of your engine without knowing the real impact on your final engine:
1. This part will never be any bottleneck , so rending your terrain at 10000 fps instead of 400 fps won't help you if your physics engine runs at 1 fps :)
2. Optimizing means to make assumptions about your engine structure which will result into restrictions ! Any restriction will decrease the usefulness of your engine. I.e. a render engine which renders terrain at 400 fps with the restriction of not rendering any roads will not be a good choice for any car-racing game.

Tipps:
Go on with your engine development as soon as your current engine part in development is robust(!) and acceptable fast. Whenever your engine gets too slow, start profiling and identifing the bottleneck. Revisit the engine part with the bottleneck and optimize it.

Just my 2 cents, doing this for the last 8 years with my own engine :)

--
Ashaman
RobM
RobM
Hi guys

Thanks for the responses. I'll endeavour to post some screenshots up this week.

I feel it's ready to move on, and thanks, Ashaman73, for your response, I've also been developing 'something' for around the same amount of time but I'm now having a proper crack at it.

It's pretty robust in that I can auto-fly about it for hours with no glitches or leaks or frame rate spikes. The LOD also seems to work with pretty much any terrain I throw at it, so I think I'm pretty confident to move on. Now onto flexible multi-texturing.

Thanks again, I'll post up some screenshots with progress once it looks a bit nicer than it currently does!
PrettyBoyTim
PrettyBoyTim
Your terrain sounds pretty solid already. I wouldn't bugger about with it any further unless you have to.

I'm always reminded of this quote by Michael A. Jackson:

Quote:

The First Rule of Program Optimization: Don't do it.
The Second Rule of Program Optimization (for experts only!): Don't do it yet.


Edit: Oh, and a I guess to be a little more useful - you're spending up to a 20% of your budgeted frame time rendering the landscape, although it sounds as if normally you're spending around 3% of your time doing so. 3% sounds absolutely fine - 20% might be pushing it a bit I guess if you're wanting to do a lot of other stuff in your game as well, but you'll probably want to wait and see how long the other things take to do anyway before deciding which bit to optimise further. Anyway, seeing as your game is likely to have to run on a bunch of different machines could you not just adjust the level of detail on the fly? Keep track of how long the terrain is taking to render and dynamically adjust the LOD to keep it around the 10% mark, or something like that.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.