From: Peter <kaf...@xt...> - 2002-11-03 19:20:31
|
> Hi Peter, > > Here is a little checklist that might help you solving your problem : > > Your animation may be stuttering because of frequent runs of the garbage > collector. This can happen if you create and destroy a lot of objects per > frame. To avoid this, make sure you never create any temporary objects in > your rendering loop, having a preference using values that are global to > your classes. > Running your program using the option -Xincgc will smooth the garbage > collection over time (but also reduce performance) and this can help you > figure out if the gc is responsible of your problem. > -> java -Xincgc yourclass I checked out whether GC was the problem as the first step (I mentioned that in the initial post on this subject). I have been running with -Xincgc from the outset. I also explicitly turned on -verbose:gc so I could see when it was gc'ing, but I discovered that it gc'd rarely (I don't create much at all during my main rendering loop) and that the stuttering continued between gc events. > You don't need to compile arrays into display lists (this is really > useless, > I have not noticed any percent of performance increase testing this > feature), but it is always good to lock your vertex arrays. It allows the > driver to optimize the vertex data access in memory and thus gain > performance. Actually I got a very large speed increase when using display lists (which is what I expected since Nvidia explicitly recommend it as being faster than just using arrays - compiled or not) > Make sure you don't recompile your display lists at each frame (this a > stupid advice, but we never know...) heh - don't worry, I'm not doing that =) > Make sure your hard disk drive is not swapping during the rendering, this > would explain the poor / unregular access to the vertex data in memory. > If so, add more RAM to your computer. It's not reading from disk (the terrain is generated from an fbm fractal) > Allocate more RAM than needed to the virtual machine, I've had the feeling > it was increasing a bit the performance. For this, use the flag -Xmx > -> java -Xmx256000000 yourclass (to allocate 256Megs of memory to the > program) I'll try that - I had it in mind that I wasn't using a lot of memory, but that may be an invalid assumption. > Make sure you don't have 3dsMax or any third party openGL application > launched in the background when you execute your program. In some cases, > 3dsMAX make me loose up 70% of my application performance, and I hask > myself > "what the f%% is going on ?"..."oh max is running in the background..." Heh - no, not doing that either. > Don't use too small arrays. Small counts of polygons like 50-200 won't > make > you benefit of a real performance increase. Prefer having several thousand > faces per array if possible. There's no issue with the openGL performance of this code - it's a port of C++ code which was rendering in exactly the same way and performing fine. Actually, it's not even that the Java version is *slow* - it isn't - It achieves pretty much the same fps as the c++ version, it just stutters and doesn't run smoothly. It's like it's dropping a frame every now and then. > I'm personnaly using vertex arrays having very good and smooth performance > under a geForce2MX. What 3d card do you have ? > Geforce 256 / Windows 2000 / 128mb ram. Cheers, Peter. |