In my game I want to have the different anti-aliasing option like: none, x2, x4, x8 and x16. I know that you can use anti-aliasing with Graphics2D in the way below bu is there any way that I can use the different levels of anti-aliasing (x2, x4, x8 and x16)?.

RenderingHints rh = new RenderingHints(RenderingHints.KEY_RENDERING,
rh.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);

1 Answer 1


I don't know much about java.awt but from the documentation I can tell you this:

The antialiasing option you are using does not use multiple samples like MSAA and thus does not support the MSAA x2, x4 ... sample counts. The antialiasing method of awt blends the edge pixels with the destination surface by using the exact coverage of the target pixel as the blend factor. The result should be superior even to x16 MSAA but requires all object to be rendered ordered from back to front. MSAA holds multiple samples per pixel and allows rendering in any order as this is required for most 3d scenes.

Keep in mind that the anti aliasing method of awt only influences rendering of geometry edges not of textures. For these you need to use texture filtering methods like KEY_INTERPOLATION -> VALUE_INTERPOLATION_BILINEAR.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .