Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (404)
games submitted by our members
Games in WIP (289)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  (tearing hair out while looking at fps count)  (Read 1617 times)
0 Members and 1 Guest are viewing this topic.
Offline NexusOne

Junior Member




Java games rock!


« Posted 2004-01-06 18:00:24 »

With all the problems I'm having in making a game, many of which i've posted about, I have to add more and more code to my game to solve them, which means it has more and more to do every time it goes through the display loop.. now the fps is down to an unbearable 11, yes that's right 11, for a world of about 50,000 polygons with lighting, about 10,000 of which are textured (almost all opaque). I'm using display lists wherever possible, in fact i would guess about 95% of my world is already drawn through display lists. I'm calling glBegin and glEnd only where necessary, texturing and untexturing only where necessary.. what else can I do? I've heard of something called index buffering and something call vertex buffering, but aren't display lists better?
Offline erikd

JGO Knight


Medals: 3
Projects: 3


Maximumisness


« Reply #1 - Posted 2004-01-06 20:10:43 »

Do you know what your bottleneck is (did you profile your code)? I mean, maybe display lists aren't your problem.

Offline Orangy Tang

JGO Kernel


Medals: 48
Projects: 11


Monkey for a head


« Reply #2 - Posted 2004-01-06 21:15:25 »

Yeah, you've got to pin down the bottleneck before you can start looking at optimising it.

The main thing to check is to see if you're geometry or fill limited. Try dropping the resolution to a fraction of what you're using at the moment, if that causes an increase then you're fill limited. If not then chances are you're geometry limited.

Then you can try and narrow it down further. If fill limited it might be caused by lots of overdraw. Or it might be lots of blending that mean you're hitting memory bandwidth problems.

If geometry limited then it could be that you've got a complex vertex shader slowing things down (or indeed a software vertex shader?) or your view culling isn't working as well as you think.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Games published by our own members! Check 'em out!
Try the Free Demo of Droid Assault
Offline NexusOne

Junior Member




Java games rock!


« Reply #3 - Posted 2004-01-07 02:40:00 »

OK, I tried some tests.  When I took off vertex-lighting, I got no performance gain at all. When I took off all non-textured geometry, which makes up 80% or so of the world, I got only a slight increase. Then I tried not texturing the remaining objects either, and I got a 40% increase in performance. Finally I put everything back to normal but made the window 4 times smaller, and the fps rose 110%. So seems as if it is fill-limited, but I still am not sure this is the case, since the geometry of my world is pretty straightforward, I have a terrain and objects such as trees on the terrain, so I don't think there could be much overdraw. Interestingly transparent-textured objects seem to take as long to render as opaque-non-textured objects that have at least 100 times more polygons, and although I don't have many transparent objects in my world I do have 10,000 or so textured ones. I would guess texturing and geometry are both bottlenecks.
Offline princec
« League of Dukes »

JGO Kernel


Medals: 194
Projects: 3


Eh? Who? What? ... Me?


« Reply #4 - Posted 2004-01-07 14:39:29 »

So what card is this running on, anyway?

Cas Smiley

Offline Orangy Tang

JGO Kernel


Medals: 48
Projects: 11


Monkey for a head


« Reply #5 - Posted 2004-01-07 15:08:58 »

Possibly a silly question, but have you checked GL_RENDERER and GL_VENDOR to make sure you're not getting Microsofts software renderer for some reason?

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline Yuri Vl. Gushchin

Senior Member




Speak Java!


« Reply #6 - Posted 2004-01-07 16:16:23 »

In some cases also buffer format you are using slows down a lot: say, GeF 440 Go with 1600x1200, 32 bpp, 16 bit depth + 8 bit stencil buffer in some situations gives really slow performance (when stencil tests enabled, for ex.)

So, can you pls tell us resolution, color depth, buffer format?

And also the point - do you have VSYNC swap buffers synchronization turned on?

Yuri

Yuri Vl. Gushchin
JProof Group
Offline NexusOne

Junior Member




Java games rock!


« Reply #7 - Posted 2004-01-08 04:20:03 »

I'm using XP, which I don't think has its own renderer, on a Radeon 7500 card, with a 1024 x 768 resolution and 32-bit color set on the monitor (does that matter?)... but how do I check my stencil buffer format? And sry but what is VSYNC swap buffers synchronization?
Offline Yuri Vl. Gushchin

Senior Member




Speak Java!


« Reply #8 - Posted 2004-01-08 06:57:08 »

Quote
with a 1024 x 768 resolution and 32-bit color set on the monitor (does that matter?)


Definitely yes.

Quote
but how do I check my stencil buffer format?


Good question. In my case I have modified version of DefaultGLCapabilitiesChooser with DEBUG = true (check the source). If you don't want to rebuild JOGL, just make your own copy of GLCapabilitiesChooser similar to DefaultGLCapabilitiesChooser and pass it to JOGL when creating GLCanvas.

Quote
And sry but what is VSYNC swap buffers synchronization?


This functionality, if enabled, causes every call to SwapBuffers [performed internelly by JOGL just after display(...) call] to wait until next vertical retrace, so you can conly see complete frames on your screen.

Now imagine you have flat panel w/ 60Hz refresh and your app renders 58 fps. With VSYNC enabled you get exactly 30 fps just because of rendering is too slow to fit one frame period (1/60 s) and you are missing every second frame.

Yuri

Yuri Vl. Gushchin
JProof Group
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks for your game!

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (34 views)
2013-05-17 21:29:12

alaslipknot (42 views)
2013-05-16 21:24:48

gouessej (72 views)
2013-05-16 00:53:38

gouessej (71 views)
2013-05-16 00:17:58

theagentd (79 views)
2013-05-15 15:01:13

theagentd (74 views)
2013-05-15 15:00:54

StreetDoggy (116 views)
2013-05-14 15:56:26

kutucuk (139 views)
2013-05-12 17:10:36

kutucuk (140 views)
2013-05-12 15:36:09

UnluckyDevil (147 views)
2013-05-12 05:09:57
Complex number cookbook
by Roquen
2013-04-24 12:47:31

2D Dynamic Lighting
by Oskuro
2013-04-17 16:46:12

2D Dynamic Lighting
by Oskuro
2013-04-17 16:45:57

2D Dynamic Lighting
by Oskuro
2013-04-17 16:23:20

Noise (bandpassed white)
by Roquen
2013-04-05 17:36:01

Noise (bandpassed white)
by Roquen
2013-04-03 16:17:38

Java Data structures
by Roquen
2013-03-29 13:21:12

Topic Request
by kutucuk
2013-03-22 21:42:01
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!
Page created in 0.102 seconds with 22 queries.