Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (536)
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 1919 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 Ninja


Medals: 16
Projects: 4
Exp: 14 years


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: 56
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!
Legends of Yore - The Casual Retro Roguelike
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

JGO Kernel


Medals: 343
Projects: 3
Exp: 16 years


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: 56
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.

 

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

The first screenshot will be displayed as a thumbnail.

CogWheelz (13 views)
2014-07-30 21:08:39

Riven (21 views)
2014-07-29 18:09:19

Riven (14 views)
2014-07-29 18:08:52

Dwinin (12 views)
2014-07-29 10:59:34

E.R. Fleming (32 views)
2014-07-29 03:07:13

E.R. Fleming (12 views)
2014-07-29 03:06:25

pw (42 views)
2014-07-24 01:59:36

Riven (42 views)
2014-07-23 21:16:32

Riven (29 views)
2014-07-23 21:07:15

Riven (30 views)
2014-07-23 20:56:16
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
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!