On 1/24/07, Miguel <miguel@jmol.org> wrote:

> I downloaded the 10.2 branch code from svn and I tried to enable
> anti-aliasing by setting the boolean in Viewer.java to true but it didn't
> seem to have any effect. I have a pretty beefy computer that I think can
> handle the extra processing required. Can anyone tell me how to enable
> anti-aliasing?

Dave,

I did a lot of work on anti-aliasing about 18 months ago. Unfortunately, I
never finished it.

The most significant component that is still outstanding is font handling.

I saw two ways to handle fonts:

1. Take the existing fonts but double them along each dimension. Make
sure that the font rendering starts off on even x & y coordinates. Then,
when the antialiasing code runs it will reduce the characters back to
their original shape. The advantages to this approach are:
- a font will look *exactly* if antialiasing is turned off and back on.
This could be useful because we could turn off antialiasing during
rotations.
- the same rasterization of a text string would be used whether or not
antialiasing was turned on

2. Double the font size when it is rendered. That is, if the person was a
12 pt font then render with a 24 pt font. This will look cleaner and will
give better antialiasing. However, the fonts will change if antialiasing
is turned off. In addition, this approach would consume more resources
because it would be working with much larger fonts and the rasterized
strings would be 4 times the size.

In addition, I don't think that I ever figured out the best way to deal
with a line that is exactly 1 pixel wide. We can't render it 1 pixel wide
or it will be very dim. Therefore, they need to be 2 pixels wide, with
special care taken to determine where they start and stop. These 2
pixel-wide lines were going to lead to either (a) more branching+code
inside the existing line drawing routines .OR. (b) cloning of the line
drawing code to create some special purpose 2-pixel-wide line drawing
routines. Choice (a) is probably better ... more maintainable.

I think about the antialiasing stuff from time-to-time and I hope to be
able to get back and finish it up some day when I am able to free up some
time to devote to Jmol again.


Miguel


I'm actually just interested in enabling anti-aliasing for the molecules themselves. The bonds look fairly jagged and I'd like them to be smooth. No text on my molecules. It sounds like this part is done then? Can you give me any tips on how to enable it?

--
David Grant
http://www.davidgrant.ca