Java 3D Quirks

Hey all! Just started using Java3D for a college project; I’m planning to do a 3D tennis game. I’ve got the basics in place - a court, with the ball bouncing around in it - but I’ve come across a problem. Basically, I can run the program several times, and it works perfectly and very fast each time. But then, I’ll try it again and it’ll start running at something in the region of 1 FPS for no apparent reason. Furthermore, it’ll perform in this way every time I run it from then on, until I restart my computer.

I’ve tried writing it in immediate, retained and mixed modes, and the same thing happens in each. I’m stumped as to why this might be happening; the only thing I can think of is that I haven’t performed a proper cleanup when terminating the program, even though I did write code to do so. Does anyone have any idea what might be causing this? As you can imagine, it’s kind of annoying to have to restart my computer every twenty minutes just so I can keep testing.

Edited to add: it also seems to have the effect of slightly interfering with Windows - after this happens, dragging windows etc. sometimes leaves artefacts behind in their previous positions.

Thanks, and expect many more pointless questions in the near future! :wink:

Just for fun, instead of rebooting your computer, when this happens change the desktop display mode and then change it back to your normal setting. Then try re-running your program.

Tried it, but it didn’t have any effect. The tennis game still ran at an incredibly slow framerate, and the window artefacts were still popping up ???

I should probably mention that the game is currently running in an undecorated 800x600 JFrame, with setIgnoreRepaint enabled.

Hrm, I’m no expert on such matters, but in my opinion it sounds like a bug.

If the application is being exited and the JVM closes, there should be no effects propogating over to the next run of the program.

If you’re running the OpenGL-based Java3D, try the Direct3D version, and vice-versa.

Are you still getting any trace of your java application in your task manager process list when you have quit the game?

Which version of J3D are you running. I remember this happening to me on my old ME box. I think a later version sorted it out (at least for me)

really looks like a weird windows-driver-opengl/d3d bug that cannot be solved on the java level.

Herkules: that’s the only other thing I could think of. I updated my GeForce drivers from the nVidia website, and it seems to have fixed the problem (at least, I’ve run it about a dozen time now without it happening). I can only assume that’s where the problem originated, even though my “old” drivers were pretty goddamn new.

Thanks for the help, guys!

Hi,
The only time I have experienced really slow framerates in J3D is when I tried to set the display window to a size that would exceed the available video memory on my card. Now, it sounds like between each run, memory of the video card wasn’t being released, so eventually you would get to the point where you couldn’t allocate any more vid ram buffers, and it would have to resort to slower system ram for drawing? I’m basing this on the fact that I ran this TRON game that was based in J3D at a very high resolution (1400x1050) and it ran like garbage (1fps) but lowering it down to 800x600 made it run at refresh (60fps). I’ve also seen this behavior on 2d based games when I set my screen resoultuion too high.

Is there a way to check to see how much video ram is available, or if a drawing surface is accelerated in J3D?

-Chris