Skip to main content

Direct3D transform artifacts

2 replies [Last post]
alnrelly
Offline
Joined: 2004-04-29
Points: 0

I have experimented with the new Direct3D flag for composting java2d. It is documented here http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5104393. In most cases I would prefer to use the opengl acceleration by specifying -Dsun.java2d.opengl=true, however on machines that do not have opengl capability, like laptops and desktops built for office use, the video card often does not have an opengl driver.

I have found that on some machines (like a laptop with an Intel 815 chipset and DirectX 7) that when an image is drawn at a large size weird clipping artefacts appear.

My application has a JPanel in a JScrollPane in a JSplitPane in a JFrame. The paint component method includes:

Graphics2D g2 = (Graphics2D) g; g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR); g2.setRenderingHint(RenderingHints.KEY_ALPHA_INTERPOLATION, RenderingHints.VALUE_ALPHA_INTERPOLATION_SPEED);
g2.scale((double) zoom, (double) zoom); g2.drawImage(img, 0, 0, null);

where img is a BufferedImage.TYPE_INT_ARGB.

When zoom is large (say over 5) and the img is also large (say 2000 x 2000 pixels) then it gets clipped diagonally at the corners when Direct3D is enabled (amonst other drawing errors). This does not happen on faster machines (such as my GForce 6600GT). It also does not happen when I do not use Direct3D or use the OpenGL acceleration.

Any ideas?

Regards,

Alistair

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
trembovetski
Offline
Joined: 2003-12-31
Points: 0

Hm. Looks like a driver bug to me. I'll see if I can reproduce it. (I'm assuming you're trying some build of Java SE 6, right?)

I wouldn't expect too much out of Intel 8xx chipset-based
boards Direct3D performance-wise anyway. On my notebook
the driver bugs are so severe that they reboot the system
quite repeatedly if the Direct3D pipeline is heavily
used..

Thanks,
Dmitri
Java2D Team

alnrelly
Offline
Joined: 2004-04-29
Points: 0

I have been using Java SE 6 beta 2. I have a build of my app up on my website. It is a pretty heavy user of java2d in very many ways. To see the effect I am talking about run my app in Direct3D mode using the OverlayD3D.exe launcher, or from the command line by customising the Overlay batch file.

http://www.alistairdickie.com/overlay/

To see the artifacts zoom in (using the mouse wheel). On my desktop I do not get the artifacts, on my laptop (with the aforementioned chipset) it is all screwy past a certain stage near the corners of the map.

Let me know what you think of the app. I am waiting for the first non-beta release of Mustang for full deployment.

Regards,

Alistair