Author Topic: Software renderer and Java6 Update10  (Read 12186 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Software renderer and Java6 Update10
« on: January 17, 2008, 01:14:11 pm »
Hi all!

I was just playing around with the early access version of Update10 (http://download.java.net/jdk6/binaries/), it has a new D3d-pipeline for Java2D (for Windows)...and it sucks. So just in case anybody is using this in combination with the software renderer, make sure to disable that new pipeline in case of performance problems by doing a -Dsun.java2d.d3d=false

On my test machine, the performance degrades to 50% of what the normal (or the OpenGL-) pipeline could deliver with that shiny new pipeline.
« Last Edit: January 17, 2008, 01:21:57 pm by EgonOlsen »

Offline Jonas

  • byte
  • *
  • Posts: 41
    • View Profile
Re: Software renderer and Java6 Update10
« Reply #1 on: January 17, 2008, 02:13:04 pm »
Hi

ouch ... and this pipeline is turned on by default? Sounds like a step into the wrong direction;D

Thanx for the hint
Simple things should be simple, complex things should be possible - Alan Kay

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Software renderer and Java6 Update10
« Reply #2 on: January 17, 2008, 02:39:43 pm »
ouch ... and this pipeline is turned on by default?
Yes, it is. But this is only an early access version, it's not a final release and it does work fine with the OpenGL-pipeline instead which should basically do the same thing, so i hope that this behaviour can be fixed. I've already opened a thread in the corresponding forum at Sun (http://forums.java.net/jive/thread.jspa?threadID=35484&tstart=0).

Offline Jonas

  • byte
  • *
  • Posts: 41
    • View Profile
Re: Software renderer and Java6 Update10
« Reply #3 on: January 17, 2008, 03:00:51 pm »
I don't quite understand why anyone is interested in a d3d pipeline for java anyway..I mean..after all AWT should be platform independent :).
Especially for a 2d toolkit..oh well..

Simple things should be simple, complex things should be possible - Alan Kay

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Software renderer and Java6 Update10
« Reply #4 on: January 17, 2008, 03:50:17 pm »
I think it's about performance. Some operations like transparency and scaling are much faster when done using a 3D pipeline.

Offline Jonas

  • byte
  • *
  • Posts: 41
    • View Profile
Re: Software renderer and Java6 Update10
« Reply #5 on: January 17, 2008, 04:15:37 pm »
Yes but that should be possible to do using an OpenGl pipeline as well..at least to my humble understanding ;D.

Java3d also offers a direct3d modus which is used by quite a few people. Kinda wierd..since it's not possible to access it directly anyway...so I guess there must be some kind of gain when using d3d on windows or some such..
Simple things should be simple, complex things should be possible - Alan Kay

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Software renderer and Java6 Update10
« Reply #6 on: January 17, 2008, 04:21:11 pm »
Better driver support maybe. OpenGL drivers usually lack in quality when compared to D3D drivers.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Software renderer and Java6 Update10
« Reply #7 on: January 17, 2008, 04:31:05 pm »
Plus Microsoft provides D3D drivers for most cards when installing Windows but no OpenGL drivers. You have to use the vendor's drivers to get proper OpenGL support. Maybe not all users are doing this.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Software renderer and Java6 Update10
« Reply #8 on: January 18, 2008, 01:37:27 am »
Update on the situation: They've filed a bug report for this after i had submitted a simple test case. I'll post a link to the bug once it appears on the list. I really hope that things can be improved, because otherwise, they've seriously damaged per-pixel stuff.
« Last Edit: January 18, 2008, 01:44:04 am by EgonOlsen »

Offline Jonas

  • byte
  • *
  • Posts: 41
    • View Profile
Re: Software renderer and Java6 Update10
« Reply #9 on: January 18, 2008, 10:37:04 am »
Well I guess best is to turn it off by default ;D.

Wouldn't something like this in the main class help?

Code: [Select]
static
   {
      if(System.getProperty("os.name").contains("Win"))
      {
         System.setProperty("sun.java2d.d3d", "false");
      }
   }

That should work for applets too
Simple things should be simple, complex things should be possible - Alan Kay

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Software renderer and Java6 Update10
« Reply #10 on: January 18, 2008, 12:57:57 pm »
Yes, that would work. The question is, if that works in an applet, because the VM may initialize the pipeline before actually giving control to the applet...i'm not sure about this. The new applet plugin in that update supports VM parameters, so that would be another place to add it. However, one have to know that this is needed, and not everyone will. The idea of a default d3d-pipeline just sucks imho.

Offline Jonas

  • byte
  • *
  • Posts: 41
    • View Profile
Re: Software renderer and Java6 Update10
« Reply #11 on: January 18, 2008, 01:01:29 pm »
The idea of a default d3d-pipeline just sucks imho.

Agreed ;D
Simple things should be simple, complex things should be possible - Alan Kay

Offline Hrolf

  • int
  • **
  • Posts: 84
    • View Profile
Re: Software renderer and Java6 Update10
« Reply #12 on: March 08, 2008, 10:46:53 pm »
Ulp! Will this affect Runescape & Bloodridge?  :-[

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Software renderer and Java6 Update10
« Reply #13 on: March 09, 2008, 10:39:16 am »
Yes, it will. But it's not a problem on all systems. But on some (like the AGP one that i used for testing), it's a killer. At SUN, they seem to test their Java2D changes on one or two machines IMHO and they keep ignoring that we are NOT taking about 10% slower compared to the current, official release but about 10% of the blitting performance. But because it's a problem with the way D3D works, i don't think that the situation will improve. Luckily, you can disable the pipeline even in applets when using the new applet plugin, which will be available for IE and FF3 (but not for FF2).
If you don't like this, vote for the bug (http://bugs.sun.com/view_bug.do?bug_id=6652116). It might not help but it doesn't hurt either.
« Last Edit: March 09, 2008, 11:06:22 am by EgonOlsen »

Offline Hrolf

  • int
  • **
  • Posts: 84
    • View Profile
Re: Software renderer and Java6 Update10
« Reply #14 on: March 10, 2008, 05:02:27 am »
OK I voted for it! That's bad news for me!  :(