SEP # : 16 - Scilab
SEP # : 16 - Scilab
SEP # : 16 - Scilab
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
<strong>SEP</strong> # : <strong>16</strong><br />
Title: antialiasing<br />
Version: 1.0<br />
Author: JB Silvy<br />
Review:<br />
Commented:<br />
State: Draft<br />
<strong>Scilab</strong>Version: 5.2<br />
Vote:<br />
Created: Tuesday, 17 February 2009<br />
Abstract<br />
In this <strong>SEP</strong>, we discuss the introduction of full screen antialiasing (FSAA) to enhance <strong>Scilab</strong><br />
Graphics image quality. When used in <strong>Scilab</strong>, antialiasing would allow to remove staircase artifacts<br />
that appears in <strong>Scilab</strong> Graphics, especially for polylines. For more information on antialiasing in<br />
general, see [1].<br />
Background<br />
All <strong>Scilab</strong> versions until <strong>Scilab</strong> 5.1 are not able to activate full screen antialiasing. However, most<br />
of software having visualization capabilities use it to enhance their graphics quality. They have<br />
consequently an advantage upon us. Matlab does not have such a feature by default but some<br />
toolboxes [2] provide it. Antialiasing has also been requested in our bug data base [3].<br />
Rationale<br />
FSAA enhances image quality but also decreases graphic performances. When FSAA is activated, it<br />
also comes with a quality setting. The higher the setting, the better the quality, but also the lower are<br />
the performances. Practically, there are nowadays 4 standard settings which are “2x”, “4x”, “8x” and<br />
“<strong>16</strong>x”. The “4x” and “8x” are the more commonly used settings. With “2x”, the difference with no<br />
antialiasing is barely noticeable. The difference between “8x” and “<strong>16</strong>x” is also barely noticeable.<br />
Consequently, “4x” represent a good compromise between speed and quality whereas “8x” stands<br />
for the best quality.
Figure 1: Result of plot3d() in <strong>Scilab</strong> without antialiasing.<br />
Figure 2 : Result of plot3d() in <strong>Scilab</strong> with antialiasing 4x.
Figure 3 : Result of plot3d() in <strong>Scilab</strong> with antialiasing 8x.<br />
From <strong>Scilab</strong>, the antialiasing will be controlled per figure. A property “anti_aliasing” will be added<br />
to figure handles. This property value can be one of the following: “off”, “2x”, “4x”, “8x”, “<strong>16</strong>x”. If<br />
the property is set to “off”, antialiasing is disabled. Otherwise, the value stands for the antialiasing<br />
quality.<br />
An other approach would be to have only two or three possible values, more understandable by the<br />
user. The value could be chosen between “off” or “on” (actually setting quality to “4x”) or between<br />
“off”, “performance” (quality “4x”) and “quality” (quality “8x”).<br />
By default, the anti_aliasing will be turned off to avoid speed loss in already existing <strong>Scilab</strong> codes<br />
(such as Scicos). However, the default can be changed by modifying the default figure.<br />
Limitations<br />
As any OpenGL/JOGL development, this feature should be widely tested on different architectures.<br />
This will avoid bad surprises on low end computers.<br />
Moreover, antialiasing might not be supported by a few graphic configurations. In this case a<br />
warning will be send to the user that antialiasing won't work on his configuration.<br />
Example Usage<br />
// setting antialiasing by default
df = gdf();<br />
df.anti_aliasing = “4x”;<br />
plot();<br />
// changing anti_aliasing quality<br />
f = gcf();<br />
f.anti_aliasing = “<strong>16</strong>x”;<br />
f.anti_aliasing = “off”;<br />
Changelog<br />
1.0 – Initial Revision<br />
Copyright<br />
This document has been placed under the license CeCILLB.<br />
Bibliography<br />
[1] Wikipedia – Antialiasing entry, http://en.wikipedia.org/wiki/Antialiasing<br />
[2] Myaa My AntiAlias for Matlab,<br />
http://www.mathworks.com/matlabcentral/fileexchange/20979<br />
[3] S. Ledru <strong>Scilab</strong> Bug 2984 , http://bugzilla.scilab.org/show_bug.cgi?id=2984