Java-Gaming.org Java4K winners: [ by our judges | by the community ]         
Featured games (67)
games approved by the League of Dukes
Games in Showcase (∞)
games submitted by our members



News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  Print  
  Optimisation2: Public test  (Read 1635 times)
0 Members and 1 Guest are viewing this topic.
Offline Orangy Tang

JGO Kernel
*****

Posts: 2960
Medals: 37


Monkey for a head


« on: 2003-09-02 15:00:57 »

After much wrangling, bug solving and repeated profiling from the earlier thread I've made what I thought would be some major speed ups - Some accurate view & light culling as well as switching everything to use indexed vertex arrays.

Unfortunatly i've not actually seen *any* difference in speed Shocked After the latest bout I found that its not my raw memory copying, or sheer volume of calculations (not now, at any rate) but just the actual rendering - the calls to glDrawElements are just too damn slow.

On a whim I reduced the viewport size, and lo! the fps shot right up to ~75fps once again. So on my GeForce2 GTS I seem to be fill limited at only seven lights Sad I'd like others to give the app a quick whirl so i can see what kind of fps is common - my GeForce used to be pretty good, but by todays standards is probably lagging somewhat on raw fill rate.

App is here: http://studenti.lboro.ac.uk/~cojc5/Vecript/VecriptDist02-09-2003.zip

Readme includes instructions (simple!) to load and view the test scene. I've not included Jogl since that would add ~2Mb that people might already have. Tested on the latest nightly build of Jogl without a hitch, so you can set up your jogl jar & dll how ever you like it on your system.

All comments welcome Smiley And if anyones got any suggestions for general UI / usability i'm all ears..

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

Sr. Member
**

Posts: 456



« Reply #1 on: 2003-09-02 16:36:08 »

First - I do not agree with statement 'only 7 lights'. 7 is really a LOT of lights, if you apply all of them to single object. Have you tried to measure fps with just 1 or 2 lights ? Please check if it will make a difference. If yes, then you can probably try to turn off few least influcencing lights for each object.

On the other hand, AFAIK, pixel fill rate has nothing to do with number of lights. Lights are resolved per vertex (so they limit amount of triangles per screen per second), not at pixel.

Artur Biesiadowski
Offline endolf
« League of Dukes »

JGO Kernel
*****

Posts: 1597
Medals: 2


Current project release date: sometime in 3003


« Reply #2 on: 2003-09-02 18:08:38 »

Hi
 I just tried it, and got a nice big stack trace for ya Smiley here, I got what looked like 66fps roughly, Geforce 4 4200 Athlon xp 2100

HTH

Endolf

Games published by our own members! Go get 'em!
Offline gregorypierce

JGO Strike Force
***

Posts: 905


I come upon thee like the blue screen of death....


« Reply #3 on: 2003-09-02 20:09:13 »

Just a heads up that unless you're doing lighting in a shader - any number of lights more that 3 is TOO MANY lights. NVidia has a performance paper which talks about this and it shows clearly that performance drops off rapidly in proportion to the number of lights you have. In most games, there are very few 'true' lights.

I took this from the nvidia sumer camp notes of '99

Quote

If you are lighting bound:
The ambient light and first light are always free
Each extra light adds about another 5-7%
Spot lights are more expensive than the other light types (no surprises here then), but don?t be afraid to use them


So you're probably eating a 1/3rd of your performance just in lights.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline Orangy Tang

JGO Kernel
*****

Posts: 2960
Medals: 37


Monkey for a head


« Reply #4 on: 2003-09-03 02:07:47 »

Thanks to everyone that gave it a try Smiley I guess I should explain about the lights - regular GL lighting isn't being used (well, one ambient is but that doesn't count) it's all done by building the light intensity up in the alpha buffer, before modulating this by the geometry.

Since this requires (per light!):
  • Clear alpha buffer
  • Load alpha buffer with light intensity
  • Mask off shadow hulls and fins
  • Modulate with scene geometry


Obviously this means that more lights need vastly more activity going on in the framebuffer Sad And i've already reduced the geometry rendered per pass by limiting it to the objects within the light bounds.

I think that using the scissor test could gain me some speed by limiting the screen update to the lights bounds - how much fill rate this saves is another matter though.

Note that the test level is a pretty bad case - i'm profiling with the entire level in view, and most of the lights overlap by quite a bit.

Endolf: Thanks for the trace, it seems like the texture files arn't being found (no big deal really, I broke texturing while optimising). The textures loaded are controlled by a text file in ./Data/Textures/TestSet.txt - I stripped out a lot of the entries to reduce the redundant textures in the zip. You can either check the txt file and fix the entries (should be something like:
Detail            Detail.png
on every line. Perhaps I missed the file extensions on the second collumn?

Or you can just delete the entire contents of the file, textures arn't needed anyway. Did the app continue after these exceptions (should have done!) or did it die a death?

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

JGO Kernel
*****

Posts: 2092
Medals: 10


Mojang Specifications


« Reply #5 on: 2003-09-03 02:36:15 »

Quote
After much wrangling, bug solving and repeated profiling from the earlier thread I've made what I thought would be some major speed ups [...]
Unfortunatly i've not actually seen *any* difference in speed Shocked


That's why you should never guess, and always always use a profiler before optimising. It saves a lot of time, and keeps the code simpler where it can be.

Play Minecraft!
Offline Orangy Tang

JGO Kernel
*****

Posts: 2960
Medals: 37


Monkey for a head


« Reply #6 on: 2003-09-03 02:52:22 »

Well if you look at some of the profiler outputs from the other thread, you'll see some substancial decreases in the time spent in several key methods. I think i shifted my bottleneak from geometry to fill rate and didn't notice when it switched Shocked

Although if you know of a profiler that can give useful information about whats happening down the graphics pipeline i'm more than willing to (ab)use it Smiley

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline endolf
« League of Dukes »

JGO Kernel
*****

Posts: 1597
Medals: 2


Current project release date: sometime in 3003


« Reply #7 on: 2003-09-03 03:56:40 »

Hi
 It carried on running fine, it was just those errors

HTH

Endolf

Offline gregorypierce

JGO Strike Force
***

Posts: 905


I come upon thee like the blue screen of death....


« Reply #8 on: 2003-09-03 19:49:37 »

Well if you've got a mac you can just run the Open Graphics Profiler and it will tell you what you want to know. Intel used to make a rendering pipeline profiler some years back but I don't know if its still supported.

You would think people would be tripping over each other to sell this sort of thing considering the large number of game studios there are in the world.

http://www.gregorypierce.com

She builds, she builds oh man
When she links, she links I go crazy
Cause she looks like good code but she's really a hack
I think I'll run upstairs and grab a snack!
Offline Orangy Tang

JGO Kernel
*****

Posts: 2960
Medals: 37


Monkey for a head


« Reply #9 on: 2003-09-04 02:37:28 »

nVidia apparently have some sort of graphics pipeline profiling tool, but its only avalible to registered developers Sad

From research and experimentation I think i'm not actually fill limited, but memory bandwidth limited. Each light requires a lot of blending into the frame buffer (and lots of 'hidden' geometry like shadow volumes), so lots of read-modify-write operations. Unfortunatly nVidias suggestion to combat this is to drop from 32bit colour to 16bit colour, which isn't possible since that would mean i loose the framebuffer alpha which is such a vital part.

However using scissor testing to restrict the viewport had good results, my test level jumped from ~18fps to ~38fps. Grin With 16 medium and small sized lights I can also hit a consistant ~60fps, so maybe careful level design should be sufficient.

Following from the scissor optimisation, the only other change i can think of would be to use a stencil test to further limit the screen updates. However the difference between scissor and stencil test areas is likely to be pretty small and i was planning on using the stencil test for parallax layers.

[ TriangularPixels.com - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Games published by our own members! Go get 'em!
Offline Cork

Full Member
**

Posts: 138


vote 6uN for OSX


« Reply #10 on: 2003-09-04 11:16:45 »

FYI: I got around 21fps using W2K - GF4 Ti4600 - Dual Athlon MP1800+  (5% processor)

Peter
Offline shawnkendall

JGO Ninja
***

Posts: 691
Medals: 2


Apathy Error: Don't bother striking any key.


« Reply #11 on: 2003-09-04 19:29:06 »

Here's a nice presentation that may help from the nVidia site explaining some performance bottlenecks and possible solutions.

http://developer.nvidia.com/docs/io/4000/GDC2003_PipelinePerformance.pdf

Shawn Kendall
Full Sail Real World Education
Immediate Mode Interactive, LLC
<A HREF="http://cosmic-game-engine.blogspot.com/">Cosmic Game Engine Dev Journal</a>
Pages: [1]
  Print  
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.262 seconds with 21 queries.