Is there any antialiasing?


I found setAntialiased(boolean) method for Line, set it, and it made no difference.

Is there antialiasing setting in general?


You have to use an AlphaState with your lines and points if you enable antialiasing.

Just like this?



        AlphaState alph = renderer.createAlphaState();

        alph.setBlendEnabled(true);

        alph.setSrcFunction(AlphaState.DB_SRC_COLOR);

        alph.setDstFunction(AlphaState.SB_DST_COLOR);

        newLine.setRenderState(alph);

        newLine.updateRenderState();



I ran the program. I don't see any difference.

No, you need to use alpha, not color.  So you'll want to use SB_SRC_ALPHA and DB_ONE_MINUS_SRC_ALPHA


Hi,

Sorry I was testing with a different line than what I was seeing on screen.
The setAntialiased(boolean) works.

Yeah, I also think using AlphaState that way makes it look better.

Thanks!

if u r just looking for general anti-aliasing, use display.setMinSample(value). but make sure u do this before the window is actually created.

Thanks,



but I tried this setMin thing, it does not make much difference.



Does it make a lot of difference to you? Anyone?

yap said:

Thanks,

but I tried this setMin thing, it does not make much difference.

Does it make a lot of difference to you? Anyone?


r u sure u set it before u create the window? this means if u r using simpleGame, u need to set it in the constructor.

Yes, it does not make any difference.

I put that statement in the constructor for my Canvas Implementor that extends JMECanvasImplementor.

Still, the same.


FYI, my camera is in parallel projection.
yap said:

Thanks,

but I tried this setMin thing, it does not make much difference.

Does it make a lot of difference to you? Anyone?

Make sure that:
1) you're using latest jME version from CVS.
2) your video card supports antialiasing (use glview to check)

I have a graphics card from which I can turn antialiasing on and off (and they do take effect).

I set the antialiasing to be application-controlled so that I can apply the minSample thing (no diff.).


As far as JME version, I am using the version from about a month ago, which is fairly recent, isn't it?

When working with the a JMe Canvas it seems you need to call setMinSamples before you call createCanvas on the display system. This at least gave me antialiasing in my canvas application.



DisplaySystem.getDisplaySystem("lwjgl").setMinSamples(16);
comp = DisplaySystem.getDisplaySystem().createCanvas(width, height);