Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (539)
Games in Android Showcase (132)
games submitted by our members
Games in WIP (603)
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  
  Vista+Java2D - Performance useless + Vsync doesn't work?  (Read 3061 times)
0 Members and 1 Guest are viewing this topic.
Offline Abuse

JGO Knight


Medals: 15


falling into the abyss of reality


« Posted 2007-12-14 22:39:06 »

Vista Premium (3d desktop disabled - crap waste of resources), Geforce 6800GT *almost latest drivers. (163.44, updating to 163.75 as I type)

Using my ancient Balls.jar benchmarking tool (written way back in Java1.4) - A completely blank 1280x1024 screen now renders at just 37fps.

In XP I would be able to render ~3000 images @ 37 fps.

Any ideas? Java Bug? Vista Bug? Driver Bug? Configuration Bug?

:edit:

oh, and JRE 1.6.0_01

:edit:

Unsurprisingly latest 163.75 drivers made no difference.

:edit:

Turning Aero back on makes fek all difference either.

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #1 - Posted 2007-12-15 00:27:38 »

In JDKs prior to 6u10 (aka 6uN, jdk6.dev.java.net) hw acceleration is disabled on Vista
because of compatibility issues =(

In 6uN the new D3D pipeline is enabled on Vista - please try and report
your experience.

Thanks,
  Dmitri
Java2D Team
Offline Abuse

JGO Knight


Medals: 15


falling into the abyss of reality


« Reply #2 - Posted 2007-12-15 01:13:22 »

Nice!

1280x1024 11000 images @ 60fps Cheesy

Though it looks like acceleration is disabled in windowed mode?
Also fill polygon, oval, and round rect are not accelerated either?

Also, fullscreen exclusive mode has an odd effect on my 2nd monitor - causes it to go completely black until something triggers a desktop repaint. (I say odd, as no other D3D apps do that)

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #3 - Posted 2007-12-15 08:03:44 »

Nice!

1280x1024 11000 images @ 60fps Cheesy

Though it looks like acceleration is disabled in windowed mode?

It should be enabled in windowed mode, too.

Could you run with -Dsun.java2d.trace=log and post the output?

Does your app use BufferStrategy or VolatileImage for back-buffer?

Quote
Also fill polygon, oval, and round rect are not accelerated either?

All of those are accelerated. Pretty much everything is (except xor).
Make sure you have the latest driver, too.

Same, try with logging to see what's being called.

And could you please run with this env. variable set:
  set J2D_TRACE_LEVEL=4
and post the output?

Quote

Also, fullscreen exclusive mode has an odd effect on my 2nd monitor - causes it to go completely black until something triggers a desktop repaint. (I say odd, as no other D3D apps do that)


Other d3d apps have no idea about your second monitor =)
This is probably because we create a d3d device per each
monitor, and when you enter fs mode all of them have to be
reset.

Dmitri
Offline Abuse

JGO Knight


Medals: 15


falling into the abyss of reality


« Reply #4 - Posted 2007-12-15 10:48:56 »

Ah, worked out the cause.

When using BufferStrategy(3) in Windowed mode it loses hardware acceleration - a BufferStrategy with just 2 buffers works ok.

With 3 buffers, it seems to fall back to using :-
sun.java2d.loops.Blit::Blit(ByteIndexedBm, SrcOverNoEa, IntRgb)
instead of :-
sun.java2d.d3d.D3DTextureToSurfaceBlit::Blit("D3D Texture", AnyAlpha, "D3D Surface")


Looks like I was wrong about fill polygon, oval & round rect - they are using the D3D fillPath loops.
It's just the D3D loops don't appear to be very much faster than the java2d software loops.

software ~1250 fillRoundRects @ 30fps (sun.java2d.loops.FillPath::FillPath(AnyColor, SrcNoEa, AnyInt))
d3d ~1750 fillRoundRects @ 30fps (D3DFillPath)

Infact, in the case of fillPolygon the D3D loops are quite abit slower than the software loops!

software ~4700 fillPolygon @30fps (sun.java2d.loops.FillSpans::FillSpans(AnyColor, SrcNoEa, AnyInt))
d3d ~3050 fillPolygon @ 30fps (D3DFillPath)

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #5 - Posted 2007-12-16 00:59:49 »

Yeah, 3 buffers aren't supported with certain Flip modes.

As for the performance of the loops - that's surprising.
In my tests they were faster, but I guess it depends on
the configuration.

Did you test with your 'balls.jar' ? (that came out weird =)

Also, one good thing about d3d loops is that you get
alpha compositing + transforms pretty much for free. Doesn't help
much if you aren't using those, of course.

Dmitri
Offline Abuse

JGO Knight


Medals: 15


falling into the abyss of reality


« Reply #6 - Posted 2008-01-11 23:58:12 »

As for the performance of the loops - that's surprising.
In my tests they were faster, but I guess it depends on
the configuration.

I just tried the same test on a new machine(intel Q6600 quad core with GF8800GTX),
and fillPolygon is again faster through the software loops than it is through hardware.
This is under XP rather than Vista this time.

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
Offline Linuxhippy

Senior Devvie


Medals: 1


Java games rock!


« Reply #7 - Posted 2008-01-14 00:28:23 »

Well polygons are rendered sending down "spans" to the graphic card - a span is a rectangular part of that polygon.
So first there's quite some CPU overhead generating those spans from the polygon supplied by the user and second there's quite a high per-primitive overhead for drawing operations with todays drivers/systems. And because a polygon can result in many spans, a lot of per-primitive overhead happens here :-/

lg Clemens
Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #8 - Posted 2008-01-14 18:17:24 »

All is true, but we do try to batch things up a lot which usually
helps.

Dmitri
Offline bitshit

Junior Devvie




Java games rock!!


« Reply #9 - Posted 2008-01-18 17:12:50 »

Well polygons are rendered sending down "spans" to the graphic card - a span is a rectangular part of that polygon.
So first there's quite some CPU overhead generating those spans from the polygon supplied by the user and second there's quite a high per-primitive overhead for drawing operations with todays drivers/systems. And because a polygon can result in many spans, a lot of per-primitive overhead happens here :-/

lg Clemens

this sounds horribly inefficient, why segminting it in spans and not send the polygons directly to opengl or directx?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #10 - Posted 2008-01-18 18:24:33 »

You can not send the polygons directly. You first would need to segment them into
triangles, which would require changing the way our software pipeline works.

Certainly not impossible but a bit out of the scope for this
release.

Dmitri
Offline Riven
« League of Dukes »

« JGO Overlord »


Medals: 842
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #11 - Posted 2008-01-18 19:26:43 »

Maybe a bit off-topic, but why doesn't java.awt.Graphics have 'native' support for triangles (not using java.awt.Polygon)

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social
Offline trembovetski

Senior Devvie




If only I knew what I'm talking about!


« Reply #12 - Posted 2008-01-19 08:30:29 »

I guess triangles were considered more of a 3D kind of primitive.

Dmitri
Offline Abuse

JGO Knight


Medals: 15


falling into the abyss of reality


« Reply #13 - Posted 2008-01-19 10:52:56 »

Though j2me/midp2 has fillTriangle.... but no drawTriangle   Smiley

I guess when designing awt Graphics they believed offering just the super-set behaviour of polygons was sufficient.
It would certainly fit with the philosophy behind java1.2s Shape & Area classes

Make Elite IV:Dangerous happen! Pledge your backing at KICKSTARTER here! https://dl.dropbox.com/u/54785909/EliteIVsmaller.png
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.

rwatson462 (36 views)
2014-12-15 09:26:44

Mr.CodeIt (29 views)
2014-12-14 19:50:38

BurntPizza (61 views)
2014-12-09 22:41:13

BurntPizza (98 views)
2014-12-08 04:46:31

JscottyBieshaar (58 views)
2014-12-05 12:39:02

SHC (74 views)
2014-12-03 16:27:13

CopyableCougar4 (76 views)
2014-11-29 21:32:03

toopeicgaming1999 (137 views)
2014-11-26 15:22:04

toopeicgaming1999 (127 views)
2014-11-26 15:20:36

toopeicgaming1999 (37 views)
2014-11-26 15:20:08
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
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!