home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-05-25 | 38.2 KB | 1,147 lines |
-
-
-
-
-
- PortRAY User Guide & Manual
- Version 0.11
- April 1994
-
-
- Page :1
-
-
-
- PortRAY Development Team reserves the right to change Any and all details
- within this manual or the accompanying software with no prior warning.
-
- Acknowledgments
- Darren Hewson - Early work on manual
- Paul Smith - RayTECH BBS, and for supplying the Private development
- area on RayTECH BBS.
-
- And MANY thanks to the following people for their suggestions and testing
- of early versions of PortRAY.
-
- Raymond Ore
- Martin Higgs
- Joe Miller
-
- And all the others that have taken the time to have a look at PortRAY and
- returned their comments and suggestions.
-
-
- Contents
-
-
- Page No
- 1 - Introduction 3
-
- 2 - Ray-Tracing 4
- What is Ray-Tracing 4
- 3D Geometry 4
- How does Ray-Tracing Work 5
- Anti-Aliasing 5
- Creating A Scene 5
- 3 - PortRAY 6
- 4 - Camera Files
- 5 - The Scene File
- 6 - Lights
- 7 - Primatives
- 8 - Materials
- 9 - Shaders
- 10 - Define
-
- Appendix A.
-
- Descriptions of example files
-
- Appendix B.
-
- Descriptions of errorlevel values
-
- Page: 2
-
-
- 1. Introduction
-
- PortRAY is a European ray tracer, that is 100% ANSI C Complaint, this means
- that it can be re-compiled and run on any platform that supports ANSI C, this
- also means that there is no way to view the output from PortRAY while it is
- being rendered, this is because of the diverse video and graphic standards
- that would have to be included, to support all known ANSI machines. I have not
- included viewing, because ALL platforms have an abundance of tools and
- utilities to view and manipulate graphic images so I did not feel that a
- renderer that could not view was too serious a hindrance.
-
-
- 2. Raytracing
- -------------
-
- What is Ray-tracing ?
-
- Ray-tracing is a technique used to produce 'photo- realistic' images from
- your computer. It works by simulating rays of light (hence Ray-tracing) in
- a 3d model described by the user. As it uses simulation of light, real
- optical effects such as reflection, refraction and shadows can be
- recreated.
-
- You do not particularly need any programming or artistic skills to produce
- a Ray-traced image although an ability to think in 3 dimensions is
- invaluable.
-
- You wont believe the images you can create.............
- check out the example files.
-
- Skull.gif
-
- 3D Geometry
-
- At school everybody met Geometry, although this invariably would have been
- the 2D variety. If I can drag you back a few years you will remember that
- a point in 2D space can be described by two co-ordinates commonly referred
- to as x and y.
-
-
- 7 |
- Y 6 | .(7,6)
- 5 |
- 4 |
- 3 |
- 2 |
- 1 |
- -------------------
- 1 2 3 4 5 6 7 8 9
- X
-
- In the example above the point is described by the x,y co-ordinate (7,6),
- that is 7 units up and 6 across. Any two dimensional shape can be
- described using this system.
-
- To make the transition to 3D geometry all you need do is add the third
- dimension which is known as 'z'. You can imagine the z direction as coming
- straight out of the screen toward you !
-
-
- Y |
- |
- |
- |
- |____________________
- / X
- /
- /
- / Z
- /
-
- Any point in 3D space can described by it's co-ordinates x,y,z.
-
- In the above system the point at which the x,y,z axes cross is called the
- origin, at the origin x = y = z = 0.
-
- How does it Work ?
-
- The ray-tracer 'shoots' a ray of simulated light from the 'eye' through
- each pixel on the screen into your 3D world (these are referred to as eye
- rays), the colour of the pixel on the screen is determined by the colour
- and intensity of the light and the colour and physical properties of any
- objects that the ray meets.
-
- Rays can be reflected or refracted depending on the properties of objects
- in the scene, each time this happens the light will acquire a little of the
- colour of the surface it reflects from.
-
- Anti-Aliasing
-
- For each pixel in the screen a ray-tracer normally generates one eye ray
- (a ray of light entering the camera/eye), other rays are generated by
- reflection and refraction. However in certain circumstances this can lead
- to 'jagged' edges to the objects in your scene (especially at low
- resolutions). To overcome this a technique called anti-aliasing is used.
- This effectively shoots a number of rays at different parts of the pixel
- and averages the resulting colour to produce a smoother transition at the
- edge of objects.
- (see section 3.1 - Cameras for details of PortRAY implementation).
-
-
- How do I create a Scene ?
-
- The 3D world you describe is constructed out of 'primitives'. A primitive
- is an object such as a sphere that can be given a position size colour and
- texture in a scene. You create the scene by defining the necessary
- primitives in a text file which is then processed and rendered by PortRAY.
-
-
- 3. PortRAY Raytracer
- --------------------
-
- There are three components required to generate a PortRAY raytrace, they
- are
- 1) CAMERA statement
- 2) IMAGE statement
- 3) scene statements (either object, define, light, material)
-
- These can be grouped into one or two files, the first in the CAMERA file,
- which can contain CAMERA, LIGHT and IMAGE statements, but NOT scene
- statements. And the second is the SCENE file, that can contain all three
- different sections. If you wish, you can define one file (the SCENE file)
- to contain all three sections, and so not need a seperate camera file.
-
- Both the scene and camera (if applicable) description files needed to
- produce a raytraced image from PortRAY should be in standard ASCII text.
- PortRAY has a scene description language that is described in later
- sections. However the general syntax used throughout scene and camera
- description files is :-
-
- <Keyword> [<Variable Name> <Value>] ;
-
- The <Variable Name> <Value> block is often repeated. Also <variable name>
- can be another keyword. Command blocks are terminated with a semi-colon.
-
- So, for instance, the command to create a spherical object is;
-
- Object Sphere Centre (x y z) Radius r ; ;
- This terminates the shape definition-^
- This terminates the OBJECT definition--^
-
- Keywords can be in any case, and need not be on the same line, so the
- following is exactly the same as the above
-
- Object
- Sphere
- Centre (x y z)
- radius r
- ;
- ;
-
- Note how in this example the ; terminators are lined up with the keyword
- they terminate and subsequent keywords are indented. Using this notation
- may help to keep your object files organised and avoid syntax errors.
-
- All objects in PortRAY have default values so that simple images can be
- rendered, using the above example
-
- Object
- Sphere
- ;
- ;
-
- will produce a white sphere at position 0 0 0 with radius 1
-
- A file can be included in another by the use of the include statement.
- Include statements cannot appear inside other statements. The format is
- as follows:
-
- include filename.ext
-
- Comments are enclosed in tilde "~" Signs.
-
- E.G. ~This is a comment line and will be ignored by PortRAY ~
-
- Anything on a line after the '//' pair, is also treated as a comment,
-
-
- 4 Camera Files
- --------------
-
- The camera file tells the renderer where to place the camera, what screen
- resolution to use, and if needed what lights should be included for this
- particular camera.
-
- Camera Statement
-
- The camera section of the camera file details the geometry and
- capabilities of the camera to be used for the rendered output. The
- following is a fully specified camera file:-
-
-
- camera
- look-at (0.0 0.0 0.0)
- drop-line (0.0 -1.0 0.0)
- look-from ( 0.0 5.0 -25.0)
- depth 0.028
- x-size 0.032
- y-size 0.024
- filter adaptive
- ;
- filter lens
- samples 10
- focal-length 30.0
- radius 0.1
- ;
- filter super-sample
- x-samples 3
- y-samples 3
- ;
- filter disk
- samples 10
- radius 0.707
- ;
-
- ;
-
- look-from:
- Is the point at which the pinhole or lens of the camera is
- positioned (not to be confused with the scene origin).
-
- look-at:
- Is the point at which the camera is pointing.
-
- drop-line:
- This is used to form the x co-ordinate vector of the screen. In
- effect this allows you to alter the x,y,z directions of the
- co-ordinate system (as outlined in section 1). It is probably not a
- good idea to mess around with this unless you are experienced.
-
-
- depth:
- x-size:
- y-size: are the physical dimensions of the camera.
-
-
-
-
- Filters
-
- Filters define the properties of the camera lens (pinhole or lens)
- and the pixel sampling technique used (anti-aliasing - see section 2).
-
- Filters are cumulative, they can be layered on top of each other
- indefinitely (subject to RAM), if for instance you take the sample below
-
- filter standard
- filter lens samples 10
- focal-length 30.0
- radius 0.1
- ;
- filter super-sample
- x-samples 3
- y-samples 3
- ;
- filter disk samples 10
- radius 0.707
- ;
-
-
- This will generate 900! eye rays for each pixel on screen 10x3x3x10, this
- is obviously too many, they are all included with all sub-functions simply
- as an example.
-
- Generally you would use 1 and in some very rare circumstances 2
- anti-aliasing filters, the standard filter, and for final images where
- realism is important the lens filter if needed.
-
- Standard
-
- This, or the adaptive filter MUST always be present, it is the filter
- that turns camera and film geometry into instructions to shoot rays into
- the scene. It must always be the first filter mentioned in the camera
- section, any listed before this will be ignored.
-
- Adaptive
-
- This filter implements Adaptive anti-aliasing. This variety of anti-aliasing
- adjusts the number of samples it makes dynamically according to the
- parameters you provide it. If the variance (in colour )between the corners
- of a pixel/sub-pixel is greater than the defined limit then the
- pixel/sub-pixel will be split up and resampled
-
- Variables:
-
- Threshold <float> : This sets the limit at which further samples are to
- be taken. If the difference in colour between the
- pixel or sub-pixels in question is less than this
- then no further samples will be taken.
- Default : 0.2.
-
- Max-depth <int> : This defines the maximum numbe of levels the
- re-sampling will continue to.
- Default : 3.
-
-
- cache-size <int> : This is the size of cache to use to store previous
- trace results, this enables the system to cut out
- renders of a section that has already been traced
- NORMALLY this will not need to be changed.
- Default : 1000
-
- Relax <float> : At each successive level, the THRESHOLD is
- multiplied by the RELAX figure, this forces early
- bottom-out at lower levels if the difference between
- corners is slightly larger, for instance at level 0,
- a small variance causes a section to be recursed,
- but at lower levels, the variance is not so
- important.
- Default : 1.2
-
-
- SuperSample
-
- This is an Anti-Aliasing filter, it subdivides each pixel into a
- regular grid and shoots a ray through each cell in the grid.
-
- Variables
-
- X-Samples <int> : The number of samples to take in the x direction
- Default : 2
- Y-Samples <int> : The number of samples to take in the y direction
- Default : 2
-
- Disk
-
- This is an Anti-Aliasing filter, it generates random rays in a disk
- about the centre of the pixel and accumulates the results,weighted by
- distance from the centre (i.e. in centre = 1.0 at circumference of
- disk = 0.0) The more samples the better but above about 20 no difference
- is apparent.
-
- Variables
-
-
- Radius <float> : The radius of the circle within which samples are to
- be generated
- Default : 0.707
- Samples <int> : Number of Samples to generate within the disk
- Default : 4
-
-
- Lens
-
- This Filter simulates a perfect lens (NO chromatic abberation) and allows
- depth of field and blurred images, the higher the number of samples,
- the better quality of image, but about 20 no discernible difference is
- apparent (Apart from the RUN time!)
-
- Variables
-
- Radius <float> : The radius of the lens to simulate (Note NOT the
- radius of curvature, but the actual aperture
- radius)
- Default : 0.1
- Focal-Length <float> : The Distance from the lens from which rays will
- focus clearly onto the film
- Default : 1000.0
- Samples <int> : The number of samples to trace through the lens
- Default : 4
-
-
- Image Statement
-
- The image statement sets up the image resolution and some aspects of
- image quality.
-
-
- image
- xsize 320
- ysize 240
- no-shadows
- no-reflections
- nonstop
- Intersect-Buffer 1000
- ;
-
-
- The above image statement selects an output image resolution of 320x240
- pixels and specifies no shadow and no reflection calculations, this can
- be used to check images prior to rendering at higher resolutions and
- more realistic rendering. The render cannot be interrupted with anything
- less than a ctrl-c. Also the number of entries in the cache used during
- adaptive anti-aliasing is specified in this example, but need not be.
- (The default value is 1000)
-
- 5 The Scene File
- ----------------
-
- The scene file is where you describe the primatives that make up your
- scene. Different objects may be defined in different scene files and
- brought together by using the 'include' statement.
- See Example file : dice.sce
-
- Scene files can also include lights and declarations of materials.
-
- A good practice is to use 'sce' as the extension for your scene files.
-
- 6 Lights
- --------
-
- What is a picture without light ?
-
- This is a critical aspect of most art, be it computer generated or hand
- drawn/painted. It is especially true of Ray-tracing, the whole appearance
- of an image can be altered by just tweaking the lights.
-
- In PortRAY lights can be defined with the camera or the scene. The light
- definition tells PortRAY what attributes each light has. For instance
- colour position and shape.
-
- Below is a typical light source definition.
-
- light
- colour (1.0 1.0 1.0)
- position (-10.0 20.0 -5.0)
- shape sphere
- centre (-10 20.0 -5.0)
- radius 2.6
- ;
- samples 20
- fall-off 1
- no-shadows
- ;
-
-
- This defines a spherical light source with a centre at -10, 20, -5 and
- a radius of 2.6 and a colour of white, shadows from this light source
- will be sampled at 20 random positions on the surface of the sphere.
- The light intensity will fall off at a linear relation to the distance
- that the light travels, and no shadow intersection tests will be done
- against this light source.
-
- Values of fall off are
- 0 - No Fallof
- 1 - linear falloff
- 2 - squared falloff
- Note, these are only examples, the user is free to use any positive
- real value for falloff, so 1.2 or 3.5 are also valid falloff values.
-
-
- Shapes (primitives) supported for light sources are:
-
- Sphere - standard spherical light source
-
- Cylinder - flourescent strip lighting ?
-
- Box - Use your imagination
-
- 7 Primitives
- ------------
-
- Primitives are the shapes that you use to define your scene. Each
- primitive has colour and/or surface texture (defined via 'material')
- associated with it, and can also be stretched or shrunk along all
- three axes.
-
- Scaling, rotation, translation.
- This is accomplished using the shrink/stretch commands as follows
- Look at
- shrink-x <float> : contracts the x-axis
- shrink-y <float> : contracts the y-axis
- shrink-z <float> : contracts the z-axis
- stretch-x <float> : expands the x-axis
- stretch-y <float> : expands the y-axis
- stretch-z <float> : expands the z-axis
- translate <vector> : Moves the object so that the <vector> defines the
- origin for the object definition
- x-rotate <float> : Rotates about the x axis in degrees
- y-rotate <float> : " " " " y " " " "
- z-rotate <float> : " " " " z " " " "
-
-
- The primitives currently available within PortRAY are as follows:
-
- Spheres
- Planes
- Cylinders
- Triangles
- Boxes
- Raw data files
- CSG (Constructive Solid Geometry, INTERSECT, UNION, SUBTRACT)
- Disks
- Polygons (Concave, convex, complex (multiple contours))
-
- Sphere
-
- I think it's fairly obvious what this primitive does, so I'll skip the
- long description !
-
- The variables used to decribe a sphere are listed below:-
-
- Required Variables:
-
- Centre <vec> : A point defining the centre of the sphere
-
- Radius <float> : The radius of the sphere
-
- Optional Variables:
-
- Pole <vec> : A vector describing the north pole of the sphere.
- IE a line running through the centre of the sphere.
- This variable is only required if you wish to map
- a 'material' on to the sphere.
-
- Equator <vec> : A vector that defines what position the longitudinal
- axis starts at.
-
- Examples:
-
- A simple sphere definition would be:
-
- object
- sphere
- centre (0.0 0.0 0.0)
- radius 4.0
- ;
- ;
-
- This would define a sphere with radius 4.0 centred on the origin.
-
- Plane
-
- A plane primitive describes an infinite plane in 2 dimensions
- with no "thickness" in the third dimension.
-
- Required Variables
- Position: This variable simply tells PortRAY where the plane
- should be placed.
-
- Normal: A vector describing the normal of the plane, this
- determines the orientation of the plane. A normal is
- simply the vector at right angles to the plane.
-
-
- Optional Variables
-
-
- X-Axis: Both this and the y-axis are used only for mapping
- 2 dimentional shaders onto the surface of the plane.
- They should be perpendicular for a square grid, and must
- NOT be coplanar with the normal and eachother.
- Y-Axis: See above.
-
- Examples:
-
- Object
- Plane
- Position (0.0 -10.0 0.0)
- Normal (0.0 1.0 0.0)
- ;
- ;
-
- This defines a 'floor' ten units below the origin of the
- scene.
-
- Cylinders
-
- The Cylinders primitive describes a 'pipe'.
-
- Required Variables:
-
- From <vec> : A vector defining the start of the cylinder.
-
- To <vec> : A vector defining the end of the cylinder
-
- Radius <float> : The radius (!) of the cylinder
-
- Optional Variables:
-
- Capped: A keyword indicating that the ends of the cylinder should be
- 'filled in'.
-
-
- Examples:
-
- Object
- Cylinder
- From ( 10.0 0.0 0.0)
- To ( -10.0 0.0 0.0)
- Radius 1.0
- Capped
- ;
- ;
-
- This describes a simple cylinder of 20 length and 1 width with capped ends.
-
- Box
-
- This primitive defines a cuboid shape with it's edges aligned along the
- axis.
-
- Required Variables:
-
- A (x y z) First corner of box
- B (x y z) Opposite corner of box
-
-
- Examples:
-
- Object
- Box
- a (0 0 0)
- b (1 1 1)
- ;
- ;
-
- This describes a simple box of with lower left corner (0 0 0) and upper
- right corner (1 1 1).
-
-
- Triangle
-
- This primitive is used to describe a triangle, which can be flat or
- rounded. Rounded triangles are very difficult (impossible) to hand
- calculate. Flat triangles can be useful to build irregular shapes.
-
- Required Variables:
-
- A (x y z) Three vectors defining the 'corners' of the triangle.
- B (x y z) The triangle can be viewd from both sides.
- C (x y z) The order of the corners is not important.
-
- Optional Variables:
-
- Normal-A (x y z) Three vectors describing the normals of the points
- Normal-B (x y z) at each corner of the triangle. This will provide a
- Normal-C (x y z) rounded triangle
-
-
- Examples:
-
- Object
- Triangle
- A ( 0.0 0.0 10.0)
- B (-5.0 0.0 0.0)
- C ( 5.0 0.0 0.0)
- ;
- ;
-
- This will produce a flat triangle.
-
- Raw
-
- This allows the inclusion of RAW triangle files into scene files
- without having to convert the raw data into triangle statements,
- it also allows PortRAY to compact the data by eliminating any multiple
- references to single points, and at the same time allows PortRAY
- to generate normals at each corner to smooth out the shape automatically
-
- Required Variables:
-
- FILE <filename> : This is the name of the file that contains the
- RAW triangle info, this MUST not have any data
- apart from the raw triangles.
-
- Optional Variables:
-
- WELD <float> : This defines how close two points need to be
- before the system welds them into one point.
- Default : 0.00001
- SMOOTH : This tells PortRAY to generate smoothing normals
- once the triangle data is read in.
- X-ROTATION <float> : No of DEGREES to rotate the triangles about the X
- axis when they are read in.
- Y-ROTATION <float> : No of DEGREES to rotate the triangles about the Y
- axis when they are read in.
- Z-ROTATION <float> : No of DEGREES to rotate the triangles about the Z
- axis when they are read in.
- AT <vec> : The point in the model world that will be the origin
- for the triangles.
-
- CSG
-
- This stands for CONSTRUCTIVE SOLID GEOMETRY and is a way of defining
- a new shape from two others by combining them according to one of three
- rules (UNION, INTERSECT and SUBTRACT).
- because this uses two other objects as parameters, it can be NESTED to ANY
- level, and the material used to shade a point is the material defined
- by the surface that the ray actually hits, in this way you can make a die
- as in EXAM_006.SCE
-
- Required Variables
-
- OPERAND1 <object> : This is the first object
- OPERAND2 <object> : This is the second object
- [UNION | INTERSECT | SUBTRACT] : This defines how to combine them
-
- Operators
- UNION : This one just adds the two shapes together, so you could
- for instance add a spherical cap to the end of a cylinder.
- INTERSECT : This one makes the resulting shape what is inside BOTH
- operand1 AND operand2
- SUBTRACT : This takes the second shape from the first.
-
- Example
- Look at EXAM_005.SCE and EXAM_006.SCE
-
- Polygon
-
- Disk
-
- Same as plane but with the inclusion of the radius <float> keyword.
-
-
-
-
-
-
-
- 8 Materials
- -----------
-
- This part of a scene file allows you to define the surface characteristics
- of the objects that you have defined in your scene. A material definition
- can be created as part of the object eg:
-
- Object
- sphere
- centre (0.0 0.0 0.0)
- radius 1.0
- ;
- material
- colour (1.0 1.0 1.0)
- ;
- ;
-
- or it can be named and used later eg:
-
- define
- material
- named flat-red
- colour (1.0 0.0 0.0)
- ;
- ;
-
- Object
- primitive sphere
- centre (0.0 0.0 0.0)
- radius 1.0
- ;
- material called flat-red ;
- ;
-
-
- All the material options are as follows:
-
- Material
- called <name>
- named <name>
- colour <col>
-
- diffuse-reflection <float>
- diff-colour <col>
-
- specular-reflection <float>
- specular-power <float>
- spec-colour <col>
- reflection <float>
-
- transparency <float>
- tran-colour <col>
- refractive-index <float>
-
- <shader-name> <shader info>
- ;
-
-
- Called: references a pre-defined material (can be included from a seperate
- file)
-
- Named: defines a material for later use
-
- Colour : this defines the basic colour of the object, and so
- sets the values of all three colours (spec, diff, tran)
-
- Diff-Colour : Defines the colour used in diffuse (or Lambertian)
- reflection.
-
- Spec-Colour : Defines the colour used in specular reflection.
-
- Tran-Colour : Defines the colour used as the body or solid colour
- for transparent objects.
-
-
- diffuse-relection : defines the amount of reflection, a value of 1.0
- gives a bright dull object, a value of 0.0 gives a
- dark dull object.
-
- See mats1.sce/mats1.gif
-
- specular-reflection : defines the amount of reflectivity of the material
- A value of 1.0 will produce a shiny surface
-
- See mats1.sce/mats1.gif
-
- specular-power : defines the 'tightness' of the specular highlights.
- High values will give small sharp-edged highlights
- while a low value will give large soft-edged
- highlights
- See mats1.sce/mats1.gif
-
- reflection : Controls the weight of the mirror reflections.
-
- transparency : Defines the transparency of the surface. A value
- of 1.0 will give a totally transparent surface and a
- value of 0.0 will give a totally opaque surface.
-
- see mats2.sce/mats2.gif
-
- refractive-index : Defines the refractive index of the material. This is
- an index determining the amount light gets bent as it
- passes from one material (air) to the other. The
- refractive index for glass is 1.2
-
- <shader-name> : This section allows you to apply 'effects' to the
- surface. Please see the shader section for more info.
-
-
-
-
-
-
-
-
- 9 Shaders
- ---------
-
- Shaders are broken down into two major catagories
- 1) Those that use the 3d position of the intersection to vary the material
- eg, bumpy, fader, turb.
-
- 2) Those that use the 2d mapping on the intersected surface to vary the
- material
-
- Note if you are creating a shape out of several others either by DEFINE
- or CSG, and wish a single variable type shader to cover the whole object
- it is better to stick to the type 1 shaders above, as the 2d mappings
- of each seperate sub object may not mesh very well.
-
-
- Bricks (Type II)
-
- This simulates bricks, by accepting two other material definitions
- and then deciding which to use to form a brick patters, see EXAM_007.SCE
- note that the back wall is shaded using the brick shader.
-
- Variables :
- MORTAR <material> : The material that comprises the bricks
- BRICK <material> : The material to be used for grout
- SIZE <float> : This is the size of the brick texture, the
- greater the number, the larger the bricks
-
-
-
- Tiles (Type II)
-
- This simulates tiling, see EXAM_007.SCE, note that the floor is
- shaded using tiles.
-
- Variables :
- FACE <material>
- GROUT <material>
- TILE-WIDTH <int>
- GROUT-WIDTH <int>
- SIZE <float>
-
-
- Chequers (Type II)
-
- Similar to above, but simulates a chequered floor, by choosing one of
- two materials.
-
- Variables
- MATERIAL-A <material> : The materials that form the
- MATERIAL-B <material> : two different types of square.
- SIZE <float> : The size of the chequer board squares
-
- Bumpy (Type I)
-
- This simulates a bumpy surface, by "perturbing" the normal to the
- surface at any one point.
-
- Variables
- SIZE <float> : This governs the size of the bump features on
- all axes at once.
- TERMS <int> : the higher the number of turms and the rougher
- the bumps will get.
- XSIZE <float> : These three terms independantly alter the
- YSIZE <float> : size of the bumps in the three axes, this
- ZSIZE <float> : allows bark type effects to be generated
-
- MATERIAL <material> : This allows you to overlay the bumps on another
- material, for instance to make bumpy wood.
- SATURATION <float> : This is the amount of the surface that is actually
- bumped, 0.0 and none of the surface will be bumpy,
- or 3.1416 and the whole surface will be bumpy
- DEPTH <float> : maximum depth of perturbation, Note : surface
- artifacts (or acne) can be formed when the angle
- of intersection is close to tangential to the
- surface and the depth of purturbation is too high.
-
- Noise (Type I)
-
- This is similar to bozo in Pov, but can be controlled in several ways.
-
- Variables
- SIZE <float> : the feature size of the noise texture.
- MATERIAL <material> : This allows you to apply noise to another
- material.
- VARIENCE <float> : This defines the amplitude of the varience in
- colour that noise operates in.
- COLOUR <colour> : the base colour about which the varience operates.
-
-
-
-
- Fades (Type I)
-
- This is perhaps the MOST powerful shader available in PortRAY, and along
- with Turb3d (below) can be used to simulate all sorts of natural
- materials. (woods, cloud, granite, rusty-steel)
-
- This shader measures how far along a defined axis, a particular point is
- and then interpolates between colours or materials in a list, the shader
- accepts either a list of distances and either colours or materials.
- The list of entries in the material or colour list is closed by
- entering 0 in the float variable, for instance
-
- material
- fades
- axis (1 1 1)
- colours 0.1 (0 0 0)
- 2.0 (0 0 1)
- 0.0 (0 0 0)
- ;
- ;
- This example fades from (0 0 0) to (0 0 1) over a distance of 0.1,
- and then back again to (0 0 0) over a distance of 2.0.
- Note, never include both materials AND colours lists in a single fades
- command (its a BIT like crossing the beams in GhostBusters :) )
-
-
- Variables
- AXIS <vec>
- MATERIALS [<float> <material>]
- COLOURS [<float> <colour>]
-
-
- Turb3d (Type I)
-
- This shader alters the 3d point that all other shaders use to base their
- outcome on by a 3d volume fractal based on the original position, this
- allows the generation of effects like wood, or cloud.
-
- Variables
- TERMS <int> : The roughness of the fractal or the number of
- iterations that the system goes through to
- approximate the fractal.
- DEPTH <float> : the maximum distance of purturbation of the 3d
- point.
- SIZE <float> : the maximum wavelength of the fractal
- MATERIAL <material> : the material to which the turbulence is to be
- applied.
-
- 10 Define
- ---------
- This is PROBABLY the MOST useful command in PortRAY. It allows you to
- create your own objects or named materials and from there, using them
- as if they where built in, also each defined object and material is
- only stored once, all subsiquent uses of it are stored as pointers to
- the original and orientation information.
- The syntax is as follows
- DEFINE
- [OBJECT
- NAME ATHING
- [OBJECT
- ...
- ;]
- ;]
- [MATERIAL
- NAMED AMATERIAL
- [ ANY MATERIAL SETTINGS]
- ;]
- ;
-
-
- Once a complex object is defined in this way, it can be used just like a
- builtin object, for instance :-
-
- object
- translate (0 0 1)
- ATHING
- ;
- ;
-
- object
- translate (1 0 0)
- ATHING
- ;
- ;
-
- The requirement for the ";" after ATHING in the above example is to allow
- a position for variables to be associated with the "ATHING".
- The overhead for using a complex object like this is at least 16 bytes, and
- at MOST about 50, so it can be very efficient to generate a heirarchy of
- defined objects, to create for instance a stadium full of chairs. or
- a large fence out of smaller simple building blocks, or indeed a wall out
- of larger and larger agregates of blocks.
-
- Materials can be used is a SIMILAR way, for instance :-
-
- object
- sphere
- ;
- material
- called AMATERIAL
- ;
- ;
-
- Again the material AMATERIAL is NOT copied, it is pointed to, and so takes
- up NO extra memory for each re-use.
-
-
- Appendix A. -- List and Description of EXAMPLE scene files
-
- Name Information
- EXAM_001 Shows difference between Diffuse and Specular REFLECTION
- and REFRACTION
-
- EXAM_002 Shows difference between the values of 10, 100 and 1000 as the
- specular-power.
-
- EXAM_003
- EXAM_004 Shows the combination of specular reflection and refraction to
- make a glassy material.
-
- EXAM_005 Shows the three basic CSG operations
- EXAM_006 Shows CSG by the construction of a die
-
- EXAM_007 Shows use of TILE and Brick objects
-
- BGAMMON This and several include files generates a quite detailed view
- of a pine table with two tumblers and a backgammon board with
- brass inlays and 2 dice.
-
-
-
-
- Appendix B. -- ERRORLEVEL MEANINGS
-
- ErrorLevel Meaning
- 0 Successful Render
-
- 1 Unable to open camera file
- Unrecognised Keyword in camera section
- Unrecognised Keyword in Image section
- Unable to open scene file
- Unknown Verb in Scene file
- Attempt to use an object that does not support being the
- shape of a light.
- Unknown verb in Lightsource Definition
- Attempt to use an undefined complex object
- Unknown verb in Object Definition
- Attempt to Overlay a Material Definition with a named one
- Unrecognised/Undefined Material
- Attempt to alter characteristics of a named material
- Unknown verb in Material Definition
- Unknown verb in complex Reference
- Unknown verb in Definition Statement
- Out of memory error, Unable to allocate memort for data storage
- Intersection Buffer Exhausted
-
- 2 Attempt to set number of samples for a lightsource that
- has no defined shape.
- Unable to allocate extra heap space
-
-
-
-
-