Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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,
RenderingHints.VALUE_RENDER_QUALITY);
rh.put(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setRenderingHints(rh);
share|improve this question

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.