Hello,

  the d3d pipeline (in java6) does support bilinear filtering.

  Are you creating the BufferedImages yourself like
  you'd shown or using the 'new BufferedImage(w,h,type)'
  constructor? If it's the former, the images will
  not be managed.

  Also, if you render to this image on every frame
  (like in a loop: update a buffered image, stretch it to the
  backbuffer) then the image is effectively not accelerated
  either since we only cache the image in video
  memory after a few copies from the image were made
  without the source image modifications.

  One thing you can do is to copy the buffered image
  with updated pixels to an opaque volatile image (of the
  same size), and then stretch that volatile image
  to the backbuffer (you will need the ddscale=true
  flag for that). Others had done it and it worked fine.

  Alternatively, do the same thing with the opengl
  pipeline - it would even accelerate the scale
  from BI -> VI.

  Thanks,
    Dmitri


[EMAIL PROTECTED] wrote:
Hi,

I'm  unable to use Java2D with the Direct3D pipeline for fast image scaling 
(video rendering). Nearest neighbour works fine, no need for Direct3D, but the 
quality is poor. Using either bilinear or bicubic scaling leads to poor 
performance. What has to be enabled in order to get hardware acceleration?

Dsun.java2d.d3d=True and Dsun.java2d.ddscale=true

Images are stored within a BufferedImage. Usually with:

bMask = 0x000000FF;
gMask = 0x0000FF00;
rMask = 0x00FF0000;
DirectColorModel colorModel = new DirectColorModel(24, rMask, gMask, bMask);
SampleModel sm = new SinglePixelPackedSampleModel(DataBuffer.TYPE_INT, 
bounds.width, bounds.height, new int[] { rMask, gMask, bMask });
                        WritableRaster wr = Raster.createWritableRaster(sm, 
scaledDataBuffer, new Point(0, 0));
                        scaledImage = new BufferedImage(colorModel, wr, true, 
null);

I've tried drawing the images either directly in JPanel.repaint(...) or 
indirectly by scaling it first into a VolatileImage and then drawing the 
VolatileImage.

Using other image formats (like byte arrays) hasn't helped either.

I'm using JDK 6 and Win XP. The graphics cards are a Asus GeForce 7600 GS 512M 
and an on-board Intel chip (two different PCs). I would like to use D3D instead 
of OpenGL as the driver support seems to be better on Windows (OpenGL does not 
work on either of the computers. One cannot enable the pipeline, the other only 
shows an empty window).

Thanks, Remo
[Message sent by forum member 'remmeier' (remmeier)]

http://forums.java.net/jive/thread.jspa?messageID=222858

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to