DRAFT
This section contains all information about Ayam not fitting into the other main sections.
With the help of the undo system mistakes made while modelling may
be corrected.
Note, that only modifications of objects can be undone. This includes changes
made by interactive modelling actions, changes made using property GUIs,
but also changes to views (type changes or changes to the camera settings
associated with a view, unless explicitly disabled using the view attribute
"EnableUndo"
).
It is currently not possible to undo any changes to the object
hierarchy, including clipboard (e.g. cut, paste) and drag and drop
operations. If an object is deleted, it is gone! If an object is,
accidentally, moved using drag and drop, undo will not help.
The undo system works by storing copies of the different states of changed
objects in an undo buffer. It is possible to step backwards through the
saved states using <Ctrl+z>
(undo) but also forward
using <Ctrl+y>
(redo).
The storage space occupied by the undo buffer may be adjusted using the
preferences option "Modelling/UndoLevels"
. A value of 0
completely disables the undo system.[*]
The value 1 means that there is always one state of the scene that can
be restored, plus, a potential undo operation can also always be
undone using redo.
The changes that would be undone or redone are shown in abbreviated form
in the default prompt of the Ayam console and also in
the main menu entries "Edit/Undo"
and
"Edit/Redo"
.[*]
Several actions will completely clear the undo buffer (i.e. no undo is possible after one of those actions): New Scene, Open (Replace) Scene, and Close View.
Furthermore, undo/redo operations will also modify objects that
reside in the object clipboard (if they have saved states in the undo buffer).
This means that the following sequence of operations leads to a sphere
placed at "0,0,0"
:
create Sphere (at 0,0,0) move Sphere (to 1,1,0) cut Sphere (to clipboard) undo paste Sphere (from clipboard)
This section introduces the modelling concept Tool-Objects, as used in Ayam.
In a standard modelling application, to create a surface of revolution, one would either first create a curve then call the revolve tool to get an appropriate surface (losing the curve as object, or even keeping it, but without relation to the surface), or call the revolve tool first, which would then require the user to draw a curve with similar results: the created surface will typically lose the relation to the surface of revolution tool and the curve (even if kept intact) will lose the relation to the surface. There is no easy way to change parameters for the surface creation or to change the geometry of the curve later on without doing it all over again.
The modelling concept Tool-Objects overcomes these drawbacks by transforming the revolve tool into a scene object.
The following example hierarchy shows two objects in a parent-child relation:
+-Tool_Object(Revolve)
| ^
| :
| <Notification>
| :
\ Parameter_Object(NCurve)
The parent object is called Tool-Object and the child object is
called Parameter-Object. There is a flow of information from the
parameter object to the tool object. This information flow is controlled
by the so called Notification mechanism. The notification mechanism
makes sure that whenever the parameter objects change, the tool object is
informed so that it may adapt to the changes.
For interactive modelling actions, the notification will be carried out
while dragging the mouse or after release of the mouse button (i.e. after
the modelling action finished),
depending on the main preference setting "LazyNotify"
.
In the example above, a NURBS curve is the parameter object and the tool object is creating a surface of revolution from the curve data. The NURBS curve and parameters of the Revolve object may change at any time. When saved to an Ayam scene file, no surface data will be written, leading to very small files that additionally contain a modelling history and capture design intent to a certain degree.
Tool objects may be parameter objects of other tool objects:
+-Tool_Object(ExtrNP)
+-Parameter_and_Tool_Object(Revolve)
\ Parameter_Object(NCurve)
and there may be more than one parameter object per tool object:
+-Tool_Object(Skin)
| Parameter_Object_1(NCurve)
| Parameter_Object_2(NCurve)
| ...
\ Parameter_Object_n(NCurve)
Tool objects create new geometric objects from the information delivered by the parameter object(s) or they modify the parameter object(s) and deliver them to their respective parent object.
The pure hierarchical dependency scheme may be broken up by instance objects:
+-Tool_Object(Revolve)
\ Parameter_Object(NCurve) --------------.
+-Tool_Object(Revolve) | !
\ Parameter_Object(Instance_of_NCurve) <-'
In the scene above, the second Revolve tool object depends on the shape
of the first parameter object. The Instance object transports the data
from one part of the hierarchy to another.
The notification mechanism is aware of this and initiates updates
in the scene hierarchy wherever needed and efficiently (not updating any
objects twice) according to the "CompleteNotify"
main preference
setting. In the example above, due to complete notification, the second
Revolve object will get updated automatically whenever the original
NCurve object changes.
Two other mechanisms exist, that help tool objects to get the information they need and to increase flexibility in hierarchy building and modelling: Provision and Conversion. Both mechanisms are quite similar and convert objects temporarily/transparently (provision) or finally (conversion) from one type to another, e.g. they convert an ICurve (interpolating curve) to a plain NCurve (NURBS curve).
Due to the provision mechanism, an ICurve object could be used instead of an NCurve as parameter object in all examples above easily. And with the help of the conversion mechanism, the Revolve tool objects could be converted to plain NPatch objects (e.g. for modelling operations not available to Revolve objects).
Note that instance objects are subject to a second round of provision, i.e. the master does not need to be of the wanted type but rather provide the wanted type.
Even though, theoretically, every tool could be implemented as tool object, this has not been done in Ayam (mainly, because this would unnecessarily increase the code base). Only the most often used tools that convey and capture much design intent were implemented as tool objects (those are surface or curve creating tools). But also seldom used tools can be elevated to nearly full tool object capabilities through the employment of the concept of scripting objects (see section Script Object).
This can be done easily by e.g. creating Script objects of type "Modify"
that call those tools from their script (after possible conversion of the
provided object(s) to a proper type, the tool may need to operate on).
Even property GUIs to let the user adjust tool parameters as they know it
from the other Ayam objects can be added and different tools can be combined
in single objects with normal script code for unmatched flexibility.
But let us see a simple example first:
+-Skin
+-Script
\ ExtrNC
In the scene hierarchy above, the Script object could be simply reverting the
extracted curve with code like this:
convOb -inplace; revertC
"revertC"
to an object.
A more useful example can be found in the Marsrakete sample scene (as available from the Ayam home page). Here, a curve extracted from a patch is trimmed to the right length using a script like this:
convOb -inplace; trimNC 0.0 0.5
This section contains exhaustive information on what exactly happens, when Ayam reads or writes a scene file.
When reading a scene using "File/Open"
or the MRU list:
"Main/BakOnReplace"
), a potentially
existing old backup copy will be silently overwritten,
note: even if the backup fails, scene reading continues,"OI"
tags; if a master can not be found in
the scene, the respective instance object(s) will be removed,"MI"
tags; if no matching material can
be found, the connection will not be established,"SaveMainGeom"
and/or "SavePaneLayout"
tags, the respective window/widget
geometries from the tags will be re-established,<Ctrl+s>
),* When reading objects from a file:
In contrast to reading scenes via "File/Open"
or the MRU list,
reading scenes via "File/Insert"
does some things differently:
"File/New"
)
and then saving the scene, will enrich the scene file with root
and views (in contrast to loading this scene via "File/Open"
).When saving a scene using "File/Save"
:
"SaveMainGeom"
and/or "SavePaneLayout"
tags (if present
in the Root object),"OI"
tags and "MI"
tags will be created to allow
instances to be connected to their respective masters and objects
to their materials, when reading the scene file again,To customize Ayam beyond the capabilities of the preferences dialog,
the ayamrc file may be used.
This file is either pointed to by the environment
variable AYAMRC
or is determined as following:
"~/.ayamrc"
, where "~"
denotes the home directory of the current user."$(HOME)/ayamrc"
if the environment variable
HOME
exists, else "$(TEMP)/ayamrc"
."~/Library/Preferences/.ayamrc"
, where "~"
denotes the home directory of the current user."~/.ayamrc"
, where "~"
denotes the home directory of the current user.The ayamrc file is read on each start of Ayam and saved again on exit
(if the preference setting "Main/AutoSavePrefs"
is enabled).
The ayamrc file contains:
You may edit the file with any text editor (while Ayam is not
running), but keep in mind, that the file will be parsed by Tcl.
Should you, for some reason, destroy your ayamrc file so that Ayam does
not start correctly anymore you can always start Ayam
with the command line option "-failsafe"
.
When the application is left the next time, or the main menu entry
"File/Save Prefs"
is invoked, a correct ayamrc file will be
created again.
All preference settings will be reset to factory defaults and all your
edits of the ayamrc file will be lost, however.
Another way to reset the ayamrc file is to simply delete the file manually
or using the main menu entry "Special/Reset Preferences"
.
To reset single elements to factory defaults, just remove the corresponding lines from the ayamrc file.
Finally, resetting single preference settings without a text editor is
also possible with the help of the scripting interface by manipulating
the global "ayprefs"
array. The following example leads to a reset
of the tolerance preference setting to its factory default for the
next start of Ayam.
» unset ayprefs(Tolerance)
After unsetting single elements of the preferences array, Ayam should
be restarted.
You may adapt the keyboard shortcuts used in the GUI to your special
needs using the ayamrc file. Note that if you do that, the GUI (the menu
entries and the "Show Shortcuts"
window) will adapt to your
changes but certainly neither this documentation, nor the reference card
(unless recreated using the script "refcard.tcl"
), nor the tutorials.
Ayam does not check for clashes in key bindings. This means, the last set binding for a key will be used.
On Unix, the output of the program "xev"
and the
manual page for the "bind"
command of Tk provide helpful
information about which strings may be used to describe
key presses.
You can also directly use the Ayam console to infer key names, just enter:
» toplevel .keytest; bind .keytest <Key> {puts %K}
into the Ayam console.
Now you can activate the new top level window and type on your keyboard
while the Ayam console prints the names of the keys.
For convenience, the special string "Ctrl"
will be replaced by
"Control"
before a shortcut is handed to the bind
command.
Example:
set aymainshortcuts(Prefs) {Ctrl-p}
<Ctrl+p>
.
See the ayamrc file itself for a complete listing of available shortcuts.
The ayamrc file currently contains the following adjustable hidden preference settings:
"AALineWidth"
, line width used for drawing the lines of
unselected objects (blue lines in standard color configuration)
when anti-aliasing is enabled.
The default value is 1.3. Ayam is not checking, whether the specified
value is supported by the OpenGL implementation used.
"AAFudge"
, offset added to any line ends to accommodate
for different OpenGL implementations wrt. anti-aliasing (default 1.0).
"AASelLineWidth"
, line width used for drawing the lines of
selected objects (white lines in standard color configuration)
when anti-aliasing is enabled.
The default value is 1.5 (a tad higher than "AALineWidth"
above,
to make the perceived line width equal compared to normal lines, in the
case of drawing a selected curve over a not selected resulting surface).
Ayam is not checking, whether the specified
value is supported by the OpenGL implementation used.
"AddViewParams"
allows to add custom parameters to the
view OpenGL widget creation, like e.g. "-stereo true"
. The default
value is ""
(empty string).
"ALFileTypes"
, "ALPlugins"
two lists that describe
file name extensions and corresponding plugins that import and export
files of the type designated by the file name extensions.
"AllowWarp"
: controls whether the mouse pointer should be
moved to the new position of points snapped to the grid while editing
(default: 1 – yes).
"AskScriptDisable"
controls the warning dialog that
appears if scenes with Script objects or tags are loaded. The default
value is 1 – yes, warn about Script objects and tags.
"AUCommands"
, commands that will be run in the console
when <Shift+Return>
is used instead of <Return>
.
See also section
Updating the GUI.
The default value is "uS;rV;"
, leading to a complete
update of the object hierarchy, the property GUI and all view
windows.
"BackupExt"
: is the file name extension to be used for backup
files. Default values are "~"
for Unix and
".bak"
for Win32.
"Balloon"
: time in ms until the tooltip window appears
(default: 1500 - 1.5s).
"Cat"
: name of a program that can read from and write to
a pipe (used by the Rendering GUI) (default: "cat"
)
(a setting of "cat"
will be
automatically replaced by "cat.exe"
on Win32)
"ConsoleTakeFocus"
: can be used to exclude the console
from focus traversal via <Tab>
when set to 0, the default
value is 1.
"ConsoleCursorEnd"
, if switched
on, the first click into the console will move the cursor to the input
prompt, ready for command input, instead of moving the cursor to the
point of the click. This option is enabled by default.
"ConvertTags"
, a comma separated list of tag names.
These tags will be copied verbatim to converted and provided
objects. If any of "BP"
or "CP"
are in this list,
the conversion of tool objects with caps or bevels to NPatch objects
does not generate multiple objects in a Level but just one object
with all caps and bevels[*].
Default value: "TP,TC,BP,CP"
.
"CullFaces"
, enables culling/discarding of back facing
polygons prior to display with OpenGL. This can improve the visual
quality of shaded surfaces at their edges. Note however, that culling
back faces can also disrupt the CSG preview
using AyCSG. Default value: 0 – no.
"CycleHiddenWire"
, determines whether the slow "HiddenWire"
drawing mode is included in the list of modes that are cycled by keyboard
(via "Ctrl+PageUp"/"Ctrl+PageDown"
), default: 0 – no.
"DailyTips"
: a list of strings that appear as tips
on startup in the console (default: large).
"DisableFailedScripts"
: specifies whether scripts in
Script objects or BNS/ANS tags should be disabled when they
fail (default: 1 – yes).
"EFlush"
: time in ms between two flushes of the error message
buffer (default: 2000 - 2s).
"FDShowHidden"
: controls whether the standard file dialog on
Unix shows hidden files (default 1 – yes).
"FDShowHiddenBtn"
: controls whether the standard file dialog on
Unix shows an extra button that toggles display of hidden files (default 0).
"FixDialogTitles"
, this option prepends the title of a message box
that is normally displayed in the window frame of the message box to the
message in the box. This may be necessary because on some systems the title
string might be displayed in an unreadable font or not at all.
On Mac OS X Aqua (not X11!) this option is enabled by default.
On all other systems this option is disabled by default.
"FixImageButtons"
, enables a workaround for buttons
(e.g. in the toolbox) that stay depressed when used. This option is disabled
by default on all platforms.
"FixX11Menu"
enables a workaround for non-sticky menus
on X11 (displaced menus do not stay open). This option is enabled
by default and not used on the Win32 and Aqua platforms.
"FlashObjects"
enables flashing of objects while object
picking. When enabled, this option needs a considerable amount of resources
due to constant picking operations while the mouse pointer travels over the
view window and also leads to a lot of visual noise. Therefore it
is disabled by default.
"IconGamma"
: this setting may be used to adapt the contrast
of all icons (in view menu and the toolbox) to your display gamma. If you
are on a SGI it is recommended to set this to about "0.7". The default
value ""
(empty string) leads to no changes of any icon images.
"KeepNTmpFiles"
: how many
incarnations of the scene in RIB form (which actually may be split
in more than one file due to e.g. instances) created when directly
rendering from a view window should be kept on disk (default: 5)
"Kill"
: name of a program that kills other processes and accepts
a process id as argument (used by the Rendering GUI)
(default: "kill"
) (a setting of "kill"
will be
automatically replaced by "kill.exe"
on Win32)
On the Win32 platform you may also use an internal kill command
"w32kill"
that has been introduced in Ayam 1.4.
"LineWidth"
, line width used for drawing the lines of
unselected objects (blue lines in standard color configuration).
The default value is 1.0. Ayam is not checking, whether the specified
value is supported by the OpenGL implementation used.
"ListTypes"
determines, whether the type of an
object should be displayed in braces in the tree view or listbox.
The default value is 1 – yes, list the types.
"LoadEnv"
, controls whether the environment scene
file should be read on each application start.
The default value is 0 – no file will be read.
Saving an environment scene file
via the menu entry "Special/Save Environment"
or
setting a value different from an empty string (""
) to the
"EnvFile"
preference setting will set this option to 1 automatically.
"MarkHidden"
determines, whether hidden objects
should be marked (using a preceding exclamation mark)
in the tree view or object listbox.
The default value is 1 – yes, mark hidden objects.
"MaxTagLen"
: the maximum number of characters to be displayed
in the buttons in the Tag Property GUI (default: 30).
"NewLoadsEnv"
, if this is switched on, Ayam will read
the scene file specified by "EnvFile"
also when the scene is
cleared using the main menu entry "File/New"
.
The default value is 1 – yes, load the environment file on
"File/New"
.
"NormalizeDigits"
, determines the number of digits to the right
of the decimal point, the transformation attribute and control point
normalizing process should leave intact (Default: 6).
"NormalizePoints"
, controls whether the selected points
should be normalized, after interactive modelling actions
(Default: 1 – yes).
"NormalizeTrafos"
, controls whether the transformation
attributes should be normalized, after interactive modelling actions
(Default: 1 – yes).
"PanDist"
: the distance about which panning in views by
keyboard occurs; positive values are absolute in pixels, negative values are
relative to the current window dimension; a value of -10 means a
tenth of the current window width/height. The default value is -10.
"PaneMargins"
, is a list of currently five floating
point values, used as a safety margin for the panes:
console vs. hierarchy, hierarchy vs. upper-views, lower-view vs. property,
property vs. hierarchy, upper-view-2 vs. upper-view-1 (in this
order).
These values control the minimum size of a pane expressed in an
inverse (1/x) and relative way:
the smaller the number, the bigger the margin. The safety margin
of the uppermost horizontal pane (that divides the upper internal
views from the hierarchy and the third view) is e.g. a bit larger
so that the main menu may not be obscured easily (the corresponding
value is 5.0). The default value for the console (20.0) leads to a
small margin, so that the console may be shrunk to 2 or even 1 lines
of text. The default values are
{20.0 5.0 10.0 10.0 10.0}
"PickTolerance"
: the tolerance used to determine whether an object
should be picked or not (default: 5); this setting determines the size
of a rectangular area around the picked point in pixels, all objects that
are inside or touch this area are considered picked.
"PolyOffset0"
, "PolyOffset1"
two float values, that
control the offsetting of shaded surfaces in the shade and draw
drawing mode (so that the curves always appear on top of the surfaces).
Default values are 1.0, 1.0.
"Prompt"
: controls the prompt for the Ayam console. If
set to an empty string, a default of
\[Undo:$ay(undoo)/Redo:$ay(redoo)\]\[Repeat:$ay(repo)\].../[file tail [pwd]]>
will be used, which displays the name of the operations that can be
undone and redone, the tool to be repeated, and the last component of
the current directory of Ayam like this:
[Undo:None/Redo:None][Repeat:None].../scn>
.
If this would be set to "[pwd]>"
the prompt would display
the full path name of the current directory instead.
To display the value of an arbitrary Tcl variable in the prompt
(e.g. designating the current level in the scene hierarchy) a write trace
must be bound to that variable.
The write trace in turn must call the procedure "ayam_updateprompt"
and may e.g. be established using a small script like this:
trace variable <vname> ayam_updateprompt
.
"PVTexCoordName"
, default name for texture coordinate PV
tags, the default value is "st".
"PVNormalName"
, default name for vertex normal PV
tags, the default value is "N".
"PVColorName"
, default name for vertex color PV
tags, the default value is "Cs".
"SafeAutoFocus"
disables AutoFocus
(see section
GUI preference settings)
when certain dialog windows are open, so that they do not get
shuffled under other windows by accidental mouse movements on systems
where the window manager does only auto raise in conjunction with
auto focus.
This option is enabled by default on Win32.
"SDMode"
, silhouette detection mode for the hidden wire
drawing mode, 0 – off, 1 – z-buffer, 2 – color,
3 – z-buffer and color. The default is 3.[*]
"SelectLast"
determines whether clicks into the tree
widget (but not on any node) should select the last object of the current
level. Default 1 – yes.[*]
"SelLineWidth"
, line width used for drawing the lines of
selected objects (white lines in standard color configuration).
The default value is 1.0. Ayam is not checking, whether the specified
value is supported by the OpenGL implementation used.
"SelXOR_R"
, "SelXOR_G"
, "SelXOR_B"
: determine
a color value that is used for drag selection rectangles.
Note that the color is not used directly but combined with the
color value of already drawn pixels by XOR. The default values
are 255 for the red, 128 for the green, and 0 for the blue component.
"ShiftTab"
, allows to set a specific keyboard symbol for
systems where pressing the Shift together with the Tab key does not
produce "<Shift-Tab>" (the default) but some other symbol like
e.g. "<ISO_Left_Tab>" (many, but not all, modern X11 systems often use
this).
"SimpleToolGUI"
controls whether the standard UI elements
(as known from the property GUIs) should be used in tool dialogs or
just simple entry widgets. Default 0, use standard UI elements.[*]
"StripShaderArch"
determines whether a second extension
(the architecture) should be stripped from the file names of compiled
shaders when scanning for shaders. Default 1 – yes.[*]
"SwapMB"
, "SwapMBSC"
allow to swap mouse buttons 2 and 3
on MacOSX/Aqua (not X11!) for specified mouse bindings ("SwapMBSC"
),
because on MacOSX/Aqua, traditionally, the naming of the
middle and rightmost mouse button is reversed compared to X11/Win32.
This option is enabled by default on MacOSX/Aqua and allows to use
the same set of mouse bindings (the same ayamrc file) for X11 and
Aqua without sacrificing user experience. The middle mouse button,
by default, zooms the view, and the right one moves the view.
"toolBoxList"
: a list of sections or groups of buttons
describing the appearance of the toolbox window (default, using all
available sections: {trafo trafo2 solids misco nurbs toolobjs points
nctools1 nctools2 camera misc}
).
"ToolBoxShrink"
, controls whether the toolbox window
should shrink wrap around its contents after a resize operation.
This option is not used in single window GUI mode. Default is 1 – yes.
"ToolBoxTrans"
, decides if the toolbox window should
be made transient. It will then, depending on the window manager or its
configuration, get a different or no decoration, no icon (or no entry in the
task bar on Windows), and will always be iconified when the main window
gets iconified. Not used in single window GUI mode.
The default value is 1 – yes.
"UseInternalFD"
switches to an internal file dialog for loading
of plugins. This option is only used on MacOSX/Aqua (not X11!), because
there the normal file dialog will not enter application bundle directory
structures. This option is enabled by default on MacOSX/Aqua and not
used on any other platform.
"WarnPropPasteToSel"
: should
"Special/Clipboard/Paste Property to Selected"
raise a warning
requester? (default: 1 – yes)
"WarnUnknownTag"
controls the warning messages for
unknown tag types (default: 1 – yes).
"Wait"
: set this to "waitPid"
to enable the work around
for zombie processes created by the Rendering GUI.
This is e.g. necessary for the Linux platform.
"WheelZoom"
, a float value that controls the zoom factor,
for the mouse wheel; the default value is 0.5.
With the ayamrc file, also the database of RiOptions and RiAttributes may be adapted to the target RenderMan rendering system.
Renderer specific options and attributes can then be added
to the scenes using tags and the main menu entries
"Special/Tags/Add RiOption"
and
"Special/Tags/Add RiAttribute"
,
see also sections
RiAttribute Tag and
RiOption Tag.
The syntax for a new RiOption is quite simple as the following example shows:
set riopt(runtime) { { verbosity s { "silent" "normal" "stats" "debug" } } }
"runtime"
and adds a single
option, "verbosity"
, to it. The option is declared to be of type
string using "s"
and provided with a list of default values:
"{ "silent" "normal" "stats" "debug" }"
.
To add another option to this section, say the option "op"
which shall be an integer value, the aforementioned snippet needs to
be changed to:
set riopt(runtime) { { verbosity s { "silent" "normal" "stats" "debug"} } { op i } }
Available types of parameters are:
{0.0 1.0 0.0}
,{1.0 1.0 1.0}
.This section documents the environment variables used by Ayam.
"AYAMRC"
: designates the full filename of the ayamrc file."HOME"
: path to the ayamrc file (used on Win32 if
"AYAMRC"
is not set)."TEMP"
: path to the ayamrc file (used on Win32 if
"AYAMRC"
and "HOME"
are not set); also initial value of the
"TmpDir"
preference setting (used on Win32 if no ayamrc file exists,
that specifies "TmpDir"
)."AYNOSPLASH"
: if this variable is set to 1, the splash
screen will not be shown."BROWSER"
: filename of the preferred WWW browser (used to
display the documentation URL)."NETSCAPE"
: (if "BROWSER"
does not exist) filename
of the Netscape WWW browser (used to display the documentation URL)."SHADERS"
: initial value of "Shaders"
preference
setting (used if no ayamrc file exists).This section serves as a overview of the various plugins available in Ayam.
There are currently four major types of plugins for Ayam:
aysdr, ayslb, ayslc, ayslo, ayslo3d, ayslx, ayso.
See also section Shader Parsing Plugins.
metaobj, sdnpatch, sfcurve, csphere.
See also section Custom Objects.
dxfio, mfio, mopsi, objio, onio, rrib, x3dio.
See also section Import and Export.
The following plugins are provided to allow
parsing of shaders:[*]
"ayslb"
for Air, "ayslx"
for Aqsis,
"ayso"
for RDC, "ayslo"
for PRMan, "ayslo3d"
for 3Delight,
"aysdr"
for Pixie[*]
, and "aygso"
for Gelato[*].
After loading of one of the aforementioned plugins, Ayam will be able to parse shaders compiled with the shader compiler of the respective renderer.
There can only be one active shader parsing plugin. You can not first load ayslb and then ayslx and expect Ayam to parse slb and slx shaders.
A shader parsing plugin may be loaded
automatically on startup of Ayam using one of the provided Tcl scripts:
"loadayslb.tcl"
, "loadayslo.tcl"
, "loadayslo3d.tcl"
,
"loadayslx.tcl"
, "loadayso.tcl"
, "loadaysdr.tcl"
,
and "loadaygso.tcl"
.
To automatically load a plugin simply add the appropriate
script to the preference setting
"Main/Scripts"
using the "Add"
button in the
preferences editor.
Additionally, those scripts may be further adapted to
set a different "Shaders"
preference setting or to immediately
scan for shaders after loading of the plugin. For that, just remove
the leading hash-marks (#) from the corresponding lines in the script.
Note that changing the scripts for immediate shader parsing is not
necessary if the shader parsing plugin is loaded automatically on startup
of Ayam, as the loading of the scripts (and therefore also of the
plugin) will happen before the Ayam startup
sequence executes the initial shader scanning pass.
The shader search path used for the initial shader scanning pass
is taken from the "Shaders"
preference setting.
If a shader parsing plugin is loaded manually or via unchanged
load script, the shaders search path must be adapted manually.
Furthermore a shader scan must be initiated manually too.
Both actions may be carried out using the preferences editor. Scanning
for shaders may also be started using the main menu:
"Special/Scan Shaders"
.
To better accommodate the fast changing world of RenderMan renderers, since Ayam 1.11 all shader parsing plugins are Ayam version independent (but still renderer version dependent and Tcl version dependent). This allows to distribute updated shader parsing plugins without updating Ayam too and thus in a higher frequency. Furthermore, compiling a shader parsing plugin is now much easier.
Automatic Instancing is available via the main menu entry:
"Special/Instances/Automatic Instancing"
.
Automatic Instancing creates instances from all instantiable
objects, using a simple algorithm that recursively compares
objects. The comparison of materials and tags may be turned off in the
small dialog that pops up after selection of the menu entry
"Special/Instances/Automatic Instancing"
.
Here, also the scope of the automatic instantiation can be set to
the selected objects, the current level, or all objects
in the scene (regardless of current level and selection).[*]
The algorithm is able to create instances of grouping objects too (objects with child objects, e.g. levels or tool-objects like revolve). However, in order for two grouping objects to be instantiated not only all child objects and the grouping objects have to be instantiable, but the child objects also have to be in the right order. It is not sufficient, that for every child of the potential master, a matching child of the potential instance exists. Instantiation of grouping objects may drastically decrease the total number of objects in a scene.
Note that before the automatic instantiation starts, all currently
existing instances will be resolved.
After instantiation some statistics will be displayed in the console.
More information about this subject can be found in:
Schultz, R., and Schumann, H.: "Automatic Instancing of Hierarchically Organized Objects", in: Kunii T.L. (ed.): Spring Conference on Computer Graphics (SCCG 2001) Conference Proceedings, Budmerice, Slovakia, 25-28 April 2001, ISBN 80-223-1606-7
The importance driven rendering plugin may be used to drastically reduce rendering times while developing a scene. It works in three main steps:
"RiMatte"
statements.Many options exist to assign importance and parameterise the rendering passes:
Elements of the scenes may be geometric objects, regions in image space, or regions in object space. Importance values are currently just binary values. Assignment may take place manually (using IDR tags) or half-automatic by derivation of importance from currently selected or changed objects. To avoid inconsistency in the resulting images, importance values may be propagated between (geometrically or hierarchically) near objects, or between objects that are related (e.g. from a material to a geometric object).
Parameterisation of the two rendering passes currently includes selection of a different renderer and the possibility to reduce rendering resolution and shading rate. To further reduce rendering times for raytracing renderers, the size of the region to render may be automatically adapted to the elements of the current importance value (including an optimisation run that balances renderer startup times and times needed to render regions not originally occupied by two regions to merge).
Furthermore, caching of partial images is possible. However, the implementation
of this feature is not very sophisticated at the moment, as it
uses the Unix text tool "diff"
to decide whether two RIB streams are
identical and hence need no re-rendering.
To start using IDR:
"File/Load Plugin"
),"Custom/Open IDR"
,"Selection"
,"Pot"
),"Render!"
button.IDR requires that at least the renderer of the second rendering pass honours RiMatte. Since rgl does not honour RiMatte, it is sometimes necessary to simply exclude objects of different importance value. No wrong images are to be expected from this, as rgl does not calculate other than local lighting effects.
More information about this subject can be found in:
Schultz, R., and Schumann, H.: "Importance Driven Rendering - Using Importance Information in the Rendering Process", in: Hamza M., Sarfraz M. (ed.): Computer Graphics and Imaging (CGIM 2001) Conference Proceedings, Honolulu, Hawaii, 13-16 August 2001, ISBN 0-88986-303-2
The AyCSG plugin may be used to resolve and preview CSG operations. For this, the plugin uses image based CSG rendering algorithms provided by the OpenCSG library by Florian Kirsch. The OpenCSG library, currently, supports the Goldfeather and the SCS algorithm. The latter only works properly with convex primitives. Since both, Goldfeather and SCS, are image based rendering algorithms, there is no limit in geometric object types that may be used in CSG hierarchies. You may e.g. use Quadrics, NURBS, and Metaballs in every possible combination. You just have to make sure, that every CSG primitive describes a closed space.
In order for the CSG rendering algorithms to work properly, the depth
complexity (convexity) of a primitive must be known.
The depth complexity of a primitive determines the maximum number
of forward oriented surfaces any ray through this primitive would pass.
A regular sphere has a depth complexity of 1, a torus of 2, but do
not confuse depth complexity with genus, they are different values.
A 3D representation of the letter A e.g. has a genus of
1 but a depth complexity of 3.
The depth complexity of a primitive can be stored in a "DC"
tag.
A torus would e.g. get a tag named "DC"
with the value "2"
.
If no "DC"
tag is present for a primitive, a default value for
the depth complexity of "1"
will be used.
If you fail to correctly specify the depth complexity, rendering
errors, like missing parts of surfaces, will occur.
Note that the correct operation of AyCSG not only depends on the
depth complexity but also the winding order of the OpenGL primitives
(triangles or quads) used for drawing of the CSG primitives. The
winding order has to be consistent in a scene, so that the rendering
algorithm can decide what is inside and what is outside by looking
at a single OpenGL primitive. For all quadric primitives of Ayam
the winding order is always consistent. However, for NURBS patches
the winding order depends on the orientation of the patch dimensions.
If NURBS patches are used in CSG operations one, consequently, may
need to revert the patches (e.g. using the "RevertU"
tool,
see
Revert U tool).
If the winding order of some of the primitives in a CSG hierarchy
is not right, the respective primitives will not be effective
in the CSG operations to the extent that the rendered image becomes
completely empty.
The AyCSG rendering obeys the "Draw Selection only"
and
"Draw Level only"
view options as well as the hide attribute
of objects. If the CSG rendering fails for complete complex scenes,
you might still get a preview of the important CSG using objects by
selecting them and enabling the "Draw Selection only"
view
option.
Also note that CSG rendering requires fast graphics hardware
(the more fillrate, the better). Furthermore, your OpenGL subsystem
has to support the PBuffers extension and, depending on the
rendering options chosen, a stencil buffer. Speedups may be
achieved using the "GL_ARB_occlusion_query"
or
"GL_NV_occlusion_query"
extensions (if available to you).
Once the AyCSG plugin is loaded successfully you can render the CSG
preview in any view window using the keyboard shortcut
<Ctrl+C>
or using the new button in the menu
bar of every view window (see image below).
If you hold down <Shift>
while pressing the button the view will start to continually render CSG
(the button stays pressed to signify this) until you click onto
the button again.
The AyCSG plugin supports the following options, that are available
through the main menu entry "Custom/AyCSG Preferences"
:
"Algorithm"
allows to switch between the Goldfeather and
SCS algorithm. Note again that the SCS algorithm only works correctly
for convex primitives. The "Automatic"
setting chooses one
of the algorithms based on whether concave primitives (depth complexity
> 1) are present or not.
"DCSampling"
determines a depth complexity sampling
strategy. Quoting from the OpenCSG documentation, the following options
are available:
"NoDCSampling"
: Does not employ the depth complexity. This essentially
makes the algorithm O(n^2), but with low constant costs.
This is the standard Goldfeather algorithm, DC tags must be present
for primitives with a depth complexity greater than one, or rendering
errors may occur.
"OcclusionQuery"
: Uses occlusion queries to profit implicitly from
depth complexity without calculating it. This is especially useful for the
SCS algorithm where this strategy is applied at shape level, resulting in
a O(n·k') algorithm (where k' <= k), without significant
constant overhead.
This strategy requires hardware occlusion queries, i.e. the OpenGL
extension "GL_ARB_occlusion_query"
or
"GL_NV_occlusion_query"
.
If this is enabled (and the "Algorithm"
is set to Goldfeather),
DC tags need not to be present.
"DCSampling"
: Calculates the depth complexity k using the stencil
buffer. This makes the algorithm O(n·k), but with high constant costs.
In case of the Goldfeather algorithm, the literature denotes this as
layered Goldfeather algorithm.
Note that this option requires a stencil buffer which must be enabled
on the creation of a view window using additional view parameters
(preferences option AddViewParams, see also the section on
hidden preference settings).
If stencil buffers are not enabled, Ayam will automatically add the
relevant option to the preferences but this only has an effect on newly
created view windows (i.e. you might also want to restart Ayam, if you
switch to DCSampling).
If "DCSampling"
is enabled (and the "Algorithm"
is set to
Goldfeather), DC tags need not to be present as the
depth complexity of primitives is calculated internally.
"OffscreenType"
: This option allows to switch between two
offscreen rendering techniques, PBuffers and Frame Buffer Objects;
depending on your graphics hardware and driver, one or the other
might work better for you.
"Optimization"
: Currently unused.
"CalcBBS"
determines whether bounding boxes should be
calculated and used for speed up (not working at the moment).See also: Kirsch F. and Doellner J.: "Rendering Techniques for Hardware-Accelerated Image-Based CSG", in: Skala V. (ed.): Journal of WSCG'04, 221-228, ISSN 1213-6972
In case of sluggish response of the user interface of Ayam (not accounting for long tree update operations) several things to increase drawing speed can be done:
"Hide"
in the "Tools"
menu.<Ctrl+d>
manually."UseMatColor"
.To work with very large/complex scenes, it may be necessary to turn off
all views. In Ayam this can be done in the multi window GUI mode
(see section
GUI preference settings).
If there are many objects, it is also advisable to switch the object
selection widget from tree view mode to list box mode (menu:
"Special/Toggle TreeView"
).
Modelling without views does not work on Apple MacOSX (Aqua) if GLU functionality is involved (as every GLU functionality on MacOSX needs a GL context). GLU is needed for the PolyMesh and NURBS tesselation.
Due to the way Ayam is implemented, several restrictions and deficiencies exist:
"TclPrecision"
preference setting, however).Ayam user interface deficiencies:
Helping to make Ayam even better will spice up your life too. Here is how to do it:
Please do not implement custom objects like simple triangles or polygons. This would be something that really is not intended by the Ayam Team, and it would surely show the limits of the current design of all code operating on the scene structure.
Ayam objects should be high-level objects!
Reading the last paragraph you might think that we are a bit biased against polygonal models. We are not. Polygonal models are the only way to preview complex geometry using hardware accelerated graphics, for the moment. But even while RenderMan supports rendering of polygonal models, their use as a primitive is not recommended for good reasons. In other words, use polygonal models in the modeler as quick representation of your higher level objects, but please, if you are going to actually render something, do not use that polygonal representation. If you want to go a complete polygonal way instead, voila, there are good modelers out there.
Suggested reading:
WWW resources related to Ayam:
http://www.ayam3d.org/docs/ayam.html
http://www.ayam3d.org/tut1/tutorial1.html
http://www.ayam3d.org/faq.html
WWW resources related to RenderMan:
http://www.renderman.org/
http://www.rendermanacademy.com/
First of all, I would like to express a big "Thank you!" to Bernd (Pink) Sieker. He is the first real Mops user and beta tester, who urged me during the last years via E-Mail and on IRC to fix this particular bug, add some essential features, move the lights again etc. pp. in countless iterations. Bernd, without your help I surely would not be that far, thanks!
Furthermore, I would like to thank the following people:
OpenGL (R) is a registered trademark of Silicon Graphics, Inc.
The RenderMan (R) Interface Procedures and Protocol are: Copyright 1988, 1989, 2000 Pixar All Rights Reserved
RenderMan (R) is a registered trademark of Pixar
The Affine Libraries and Tools are Copyright (c) 1995, 1996, 1997, 1998 Thomas E. Burge All rights reserved.
Affine (R) is a registered trademark of Thomas E. Burge.
TIFF Software is Copyright (c) 1988-1997 Sam Leffler Copyright (c) 1991-1997 Silicon Graphics, Inc.
Dime is Copyright (c) 1998-1999 Systems In Motion, SA All rights reserved.
AutoCAD (R) is a registered trademark of Autodesk, Inc.
DXF (R) is a registered trademark of Autodesk, Inc.