____________________________________________________________________________ T H E A D V A N C E D R E N D E R I N G T O O L K I T ____________________________________________________________________________ M O D E L I N G ____________________________________________________________________________ COORDINATE SYSTEM The coordinate system that is used in ART is right-handed. By convention the x-axis points to the right, the y-axis to the back and the z-axis upwards. PRIMITIVES The following simple geometric primitives can be used to construct objects: SPHERE a sphere in the origin with radius 1.0 CUBE a unit cube with extent from 0.0 to 1.0 in all axes CYLINDER a cylinder in the origin the with the axis being the z-axis, radius 1.0 and vertical extent from z = 0.0 to z = 1.0 CONE a cone with the apex in the origin, axis being the z-axis, and a radius of 1.0 at its base at z = 1.0 PARABOLOID a paraboloid with its axis being the z-axis and an extent from z = 0.0 to z = 1.0 HYPERBOLOID( ) a hyperboloid with ist axis being the z- axis and an asymptotic cone with the apex at the origin and a radius of 1.0 at z = 1.0 and z = -1.0; the sheet of the hyper- boloid has a specified offset from the origin; a positive offset results in a hyperboloid of one sheet, a negative offset in a hyperboloid of 2 sheets TORUS( ) a torus with its axis being the z-axis and a major radius of 1.0; the minor radius is specified as parameter SPINDLE( ) essentially a torus, but the minor radius is here bigger than the major radius, thus generating an overlap region: the spindle TRANSFORMATIONS An Object can be subjected directly to up to four transformations using the following syntax: [ trafo: ] [ trafo: : ] [ trafo: : : ] [ trafo: : : : ] If you need more than four transformations, you can combine pairs of transformations using: [ then: ] Each of the transformations can be one of the following: SCALE( , , ) scale object by given values in each of the respective axes USCALE( ) scale object uniformly by value SCALE_X( ) scale object in x-axis by value SCALE_Y( ) scale object in y-axis by value SCALE_Z( ) scale object in z-axis by value SHIFT( , , ) shift objet by given values in each of the respective axes SHIFT_X( ) shift object in x-axis by value SHIFT_Y( ) shift object in y-axis by value SHIFT_Z( ) shift object in z-axis by value ROT_X( ) rotate object about x-axis ROT_Y( ) rotate object about y-axis ROT_Z( ) rotate object about z-axis SHEAR_XY( , ) shear along xy-plane SHEAR_YZ( , ) shear along yz-plane SHEAR_ZX( , ) shear along zx-plane OBJECT COMBINATIONS In order to build up more complex objects, the set-operations union, intersection, and subtraction can be used to combine objects. The basic syntax for these operations is the following: [ or: ] the union of both objects [ and: ] the intersection of both objects [ sub: ] object 2 subtracted from object 1 The or: and and: operators are also one-sided, since the material of object 1 overrides the material of object 2 in the intersection region. Since it is often necessary to combine more than two objects with a union, the following shorthand has been introduced: UNION( , , ..., , 0 ) This is the union of all objects in the list. Again this is not a symmetric operation. In the overlapping areas the material of the objects that are specified first will override the material of later objects. Note that the list has to be terminated with a 0, in order to make the compiler happy. For opaque objects it is not necessary to use the union operator, as the interior of the object is not seen anyhow. For these cases the GROUP( , , ..., , 0 ) function has been introduced, which can be rendered a bit faster. SURFACES In order to generate realistic images it is necessary to specify surface attributes for objects: [ surface: ] The specified surface can be one of the following simple surfaces: LAMBERT_REFLECTOR( ) diffuse surface PERFECT_REFLECTOR( ) perfect mirror PHONG_REFLECTOR( , ) phong mirror BLINN_REFLECTOR( , ) blinn mirror PHONG_REFRACTOR( , ) phong glass BLINN_REFRACTOR( , ) blinn glass TRANSPARENT_SURFACE( ) simple filter The colour parameter of each of these simple surfaces specifies the reflection coefficient. See the COLOURS section for a detailed description on how to specify colours. The exponent parameter of the phong and blinn surfaces define the width of the highlight. The higher the exponent, the smaller the highlight. In order to build up more complex surface descriptions, multiple simple surfaces can be combined linearly: GENERAL_SURFACE( , , , , ..., ..., , , 0.0) Here each of the weights is a value greater than 0.0 and smaller thatn 1.0, that specifies the influence of the corresponding sub- surface on the combined surface. Note that you have to specify 0.0 as terminating weight (a 0 alone will lead to an error!). MATERIALS For transparent objects it is necessary to specify the material which contains the attributes valid in the volume contained by the object: [ material: ] Currently only one type of material is available: STANDARD_MATERIAL( , , ) The refraction colour specifies the index of refraction for each colour band. The extinction colour is the colour that is left when white light is sent through 1 unit of material. In a normal material extinction will absorb all light and result in black if enough material is traversed. The haze colour can be set to change this asymptotic colour. COLOURS The easiest way to specify colours is by using RGB values: COLOUR_RGB( , , ) The components have to be given in the range between 0.0 and 1.0. As a shorthand the following primary colours have also been defined: COLOUR_BLACK, COLOUR_RED, COLOUR_GREEN, COLOUR_BLUE, COLOUR_CYAN, COLOUR_MAGENTA, COLOUR_YELLOW, COLOUR_WHITE For specifying gray values it is possible to use: COLOUR_GRAY( ) with a value between 0.0 and 1.0. In order to do spectral rendering it is necessary to specify colours as spectra. For examples have a look at the '.arm'-files in the 'lib/Spectrum' subdirectory of the 'artist' directory. All the spectra in this directory can be used with the shortcuts specified in the '.arh'-files located in the 'include/Spectrum' subdirectory of the 'artist' directory. SOLID TEXTURES In order to make the surface attributes of an object dependent on the location of the point on the object surface, it is possible to use solid texturing: MAPPED_SURFACE( , SURFACE_MAP( , , , , ..., ..., , , MAP_END)) The texture function returns a value between 0.0 and 1.0 which is used to index into the following map of surfaces. Each surface in the list is preceeded by the value at which it is valid. At intermediate values, neighbouring surfaces are linearly interpolated. Below the first value, the first surface is used, above the last value, the last surface is used. The list of values must be terminated with 'MAP_END'. TEXTURE FUNCTIONS Texture functions can be used to assign a value to each point in 3-space. CELLULAR_TEXTURE2D(,, , , ..., ) A linear combination of the distance functions to the first closest feature points. The distance functions are combined using the specified weights. Feature points are automatically distributed evenly throughout space. CELLULAR_TEXTURE3D(,, , , ..., ) A linear combination of the distance functions to the first closest feature points. The distance functions are combined using the specified weights. Feature points are automatically distributed evenly throughout space. CHECKER_TEXTURE2D() CHECKER_TEXTURE3D() TILE_TEXTURE2D(, , ) PERLIN_NOISE() Random noise band-limited to one octave, with an average cycle length of about 1.0. FRACTAL_PERLIN_NOISE(,) Random noise with fractal frequency characteristic. PERLIN_TURBULENCE(,) Similar to FRACTAL_PERLIN_NOISE, but added discontinuities of the derivative. MARBLE_TEXTURE (,) WOOD_TEXTURE (,) ONION_TEXTURE (,) These three textures specify repeating functions that cycle along either the x-axis (MARBLE_TEXTURE), radially outward from the z-axis (WOOD_TEXTURE), or centrally outward from the origin (ONION_TEXTURE). The noise function that needs to be specified perturbs these cycles. WAVES_TEXTURE(, ,,, ,,, ..., ..., ..., ..., ,,, MAP_END) In all texture functions, and specifies the position at which the texture function is evaluated. The 2-dimensional point must be specified by using a mapping and a parametrization for calculating a 2D point on the surface Currently the only supported mapping is: NATIVE_MAPPING() This chooses the native mapping for each primitive object. Parameterization currently can be: DEFAULT_PARAMETERISATION Defined for all objects. CYLINDRIC_PARAMETERISATION Currently only defined for the sphere. As a three dimensional point for texturing, the following can be chosen: GLOBAL_HITPOINT The hit point of the ray in the global coordinate system. This can be thought to define a global texture space in which objects are positioned. LOCAL_HITPOINT The hit point of the ray in the local coordinate system of the primitive object that was hit. REFERENCE_HITPOINT This starts out to be the global coordinate system at the moment the solid textured surface is applied to an object. If the object is then transformed, the texture is transformed with the object. This is different to GOLBAL_HITPOINT, where the texture stays fixed in 3-space, and transforming the object moves the object through texture space. TEXTURE_MAPPING In order to use an image file as a colour map for an object, you can use the following sequence: MAPPED_COLOUR_2D( , COLOUR24_MAP_2D("")) BUMP MAPPING Bumps can be used to simulate a fine structure on a surface. This can be done by specifying a 'height' function that will be used as a so called 'bumpmap': BUMPMAPPED_SURFACE(, ) As heightfunction any of the mentioned texture functions can be used. CAMERA Currently ART only provides a simple pin-hole camera model: [ CAMERA imageSize: IVEC2D( , ) ray: RAY3D( , ) zoom: ] The given image size is used as a default and can be overridden on the commandline using the '-res' option. The eye point and view vector need to be specified as point or vector respecively: RAY3D(PNT3D(,,),VEC3D(,,)) The length of the view vector is ignored, a magnification factor of 1.0 indicates that the distance of the image-plane from the eye point is equal to the diagonal of the image. SCENE In order to set up a scene, it is necessary to build a scene object. This can be done as follows: [ SCENE object: camera: renderer: ] The object specified needs to include the geometric object with all its surface parameters and the light sources. One of the following default renderers can be directly specified: STANDARD_MIDPOINT_RAYTRACER simple raytracer STANDARD_ADAPTIVE_RAYTRACER high-quality raytracer STANDARD_SLOW_EDGE_RENDERER STANDARD_FAST_EDGE_RENDERER For more specialized rendering needs, more renderers can be found in the 'renderer' sub-direcoty of the 'artist' directory. ARM FILES A '.arm'-file contains a function that returns the whole scene. The name of this function needs to be create_ where is the exact filename of the '.arm'-file without extension. A typical '.arm'-file will have the following structure: ArObj create_() { ArObj = ; ArObj = ; ... ArObj = ; return ; } ____________________________________________________________________________