Title: RE: [JAVA3D] Full Scene Antialiasing

Hi Kelvin,

Thanks for your response.

Your test program does not present the problem indeed. However, this is only so since the scale of your geometry is in the order of 1. I modified the code so that the color cube is 100 times smaller, slightly changed the viewing platform settings to see the cube the same way as before, and look what that does to the cube! Work of art.

Please find the modified test program in the attachment. You can change mScale parameter to magnify the effect: smaller the scale - worse the jittering.

Yuri.

-----Original Message-----
From: Kelvin Chung [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 06, 2002 7:48 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Re: [JAVA3D] Full Scene Antialiasing


Hi Yuri,

   I can't reproduce the problem using the attach
test program based on your code snippet. Can you please
give it a try to see if it works in your
system ? If it works, please send us your test
program for us to investigate. You may also
try out Java3D v1.3 beta1.

Thanks.

- Kelvin   
---------------
Java 3D Team
Sun Microsystems Inc.  
  
>Delivered-To: [EMAIL PROTECTED]
>MIME-Version: 1.0
>Date: Wed, 6 Feb 2002 15:10:28 -0500
>From: Yuri Nikishkov <[EMAIL PROTECTED]>
>Subject: [JAVA3D] Full Scene Antialiasing
>To: [EMAIL PROTECTED]
>
>Hi all,

Did anybody try to use full scene antialiasing in Java3D? I use the
following code to render the antialiased scene in my view to the off-screen
buffer:

// Obtain graphics configuration
        GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D();
        GraphicsEnvironment env =
GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice device = env.getDefaultScreenDevice();
        GraphicsConfiguration config =
device.getBestConfiguration(template);
// Create offscreen canvas
        Canvas3D canvas = new Canvas3D(config, true);
        mView.addCanvas3D(canvas);
// Set the offscreen to match the onscreen
        Screen3D sOn = ((Canvas3D)screenCanvas).getScreen3D();
        Screen3D sOff = canvas.getScreen3D();
        sOff.setSize(sOn.getSize());
        sOff.setPhysicalScreenWidth(sOn.getPhysicalScreenWidth());
        sOff.setPhysicalScreenHeight(sOn.getPhysicalScreenHeight());
// Set offscreen buffer
        BufferedImage image = new BufferedImage(width, height,
BufferedImage.TYPE_INT_RGB);
        ImageComponent2D imComp = new
ImageComponent2D(ImageComponent.FORMAT_RGB, image, true, false);
        imComp.setCapability(ImageComponent2D.ALLOW_IMAGE_READ);
        canvas.setOffScreenBuffer(imComp);
// Antialiasing
        if (canvas.getSceneAntialiasingAvailable())
                mView.setSceneAntialiasingEnable(true);
// Render to offscreen buffer
        mView.startView()
        canvas.renderOffScreenBuffer();
        mView.stopView();

Resulting picture demonstrates some effort to be antialiased but it is not
exactly what I expect it to be. Looks like the frame is jittered too far.
Can anybody provide any insight on what is wrong? I use Java3D 1.2.1_03.
Hardware should be irrelevant for the off-screen rendering.

Yuri.

 <<antialias.jpg>>

 

Attachment: AntialiasingBug.java
Description: Binary data

Reply via email to