www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: nuvolanotturna on December 20, 2010, 03:58:09 pm

Title: Antialiasing with software renderer
Post by: nuvolanotturna on December 20, 2010, 03:58:09 pm
Hi, I'm trying to add antialiasing, using the software rendered, but I think I'm doing something wrong since I'm getting just a black image.

Here is my code:
Quote

  buffer = new FrameBuffer(800, 600, FrameBuffer.SAMPLINGMODE_OGSS);

        buffer.clear(java.awt.Color.LIGHT_GRAY);
        world.renderScene(buffer);
        world.draw(buffer);
        
        String name = "/test" + Math.random() + ".png";
        System.out.println(name);
        ImageIO.write((BufferedImage) buffer.getOutputBuffer(), "png", new File(name));

    buffer.dispose();
        



It works fine with SAMPLINGMODE_NORMAL (but "ugly"), or with hardware renderer and SAMPLINGMODE_GL_AA_4X (perfect actually).

What am I doing wrong?
Thanks for any help

Eve


Edit: I'm not getting any error in console
Title: Re: Antialiasing with software renderer
Post by: EgonOlsen on December 20, 2010, 04:40:12 pm
Your code misses the call to FrameBuffer.update()....
Title: Re: Antialiasing with software renderer
Post by: nuvolanotturna on December 20, 2010, 04:52:55 pm
Thanks. Sorry I'm new to this library, and the fact that it was working with hardware renderer was misleading.



Ps Now I have a little problem with texture but I think I'll use a new topic.
Title: Re: Antialiasing with software renderer
Post by: EgonOlsen on December 20, 2010, 05:07:56 pm
The hardware renderer does nothing in update(), but its good practice to add it anyway. If nothing needs to be done, its simply a very cheap nop.