Author Topic: Antialiasing with software renderer  (Read 2206 times)

Offline nuvolanotturna

  • byte
  • *
  • Posts: 6
    • View Profile
Antialiasing with software renderer
« 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
« Last Edit: December 20, 2010, 04:12:58 pm by nuvolanotturna »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Antialiasing with software renderer
« Reply #1 on: December 20, 2010, 04:40:12 pm »
Your code misses the call to FrameBuffer.update()....

Offline nuvolanotturna

  • byte
  • *
  • Posts: 6
    • View Profile
Re: Antialiasing with software renderer
« Reply #2 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Antialiasing with software renderer
« Reply #3 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.