home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 4
/
DATAFILE_PDCD4.iso
/
utilities
/
utilst
/
texturgdn
/
!TexturGdn
/
Docs
/
Language
< prev
next >
Wrap
Text File
|
1996-09-29
|
55KB
|
1,575 lines
Texture Garden texture generation language specification
========================================================
This file documents version 0.44 of the texture generation language
This is distributed with Texture Garden version 0.44.
1.00 Introduction
1.10 The format of this file
2.00 Writing textures
2.10 Syntactic considerations
3.00 Command summary (commands grouped by class)
4.00 Command details (commands grouped by class)
1.00 Introduction
~~~~~~~~~~~~~~~~~
The Language:
When editing texture generation programs, some syntactical rules need to be
beone in mind. The language is a compromise between three design criteria:
1: That it should be readable by a human
2: That it should be editable by the computer.
3: That it should go like the clappers.
Compactness was not considered to be particularly important.
Characteristically commands are verbose. It is recommended that typing in
commands using longhand is to be avoided and that cut and paste facilities
are employed wherever possible.
When loaded, commands are translated into an internal format and the original
textfile is discarded. Loaded files may contain command names in any case,
truncated names, commands optionally abbreviated with the "." character,
confused and confusing punctuation and mismatched brackets. When the file is
saved, it is cleaned up, reformatted and expanded into a standard format.
Unless you know what you are doing, keeping copies of the original files is
recommended, as What The Computer Thinks You Are Talking About may initially
differ from What You Are Trying To Say.
Error checking is currently implemented mainly at the parsing stage. If the
program you feed the computer contains errors, the message will tell you
which line they are found on. These messages should be helpful in the
process of tracking down mistakes. Runtime error messages are supported, but
should occur very rarely in practise.
If your version of this program is unregistered, then you will probably
experience difficulties in changing existing textures or getting your own
textures to be displayed. Please refer to the "Register" document for
details of why this occurs.
Resources:
There are currently several main resources available for use in generating
textures. The texture generation program "sees" a virtual machine with a
variety of storage media and one primary output channel.
There are three one dimensional buffers of &400 16-bit values which may be
manipulated. One two dimensional buffer is provided, with dimensions
controlled by the size of the sprite to be generated. A buffer for storing
colourmaps exists and there is space reserved for the manipulation of &400
variables. These contain unspecified values on entry to the routine.
Texture generation programs are entered when a texture is required. Their
execution begins at their first line.
1.10 The format of this file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In the command summary which follows, each command is named and then it is
followed by a string in brackets indicating what kind of parameters it takes.
If there are no brackets then the command takes no parameters. In the second
part of the document, descriptions of the operation of each of the commands
are also given.
Comments are considered to be anything after a "|" character. Comments in
If...Then...Else lines are treated using the same conventions as in Obey
files, i.e. "If 1 = 2 THEN |ECHO Equal! ELSE ECHO Not_Equal!" would print
"Not_Equal!" in an Obey file, despite the earlier "|".
2.00 Writing textures
~~~~~~~~~~~~~~~~~~~~~
Conventions:
All textures should begin with a definition of their primary palette enclosed
by the commands "StartColourDefinition" and "EndColourDefinition".
Textures terminate when they reach the "End" command. It is conventional to
place subroutine definitions after the "End" so they are seperate from the
main program. The mutator may rely on this in the future.
2.00 Syntactic considerations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Essentially, the syntax of the language is simple.
Everything falls into one of four categories.
These four categories are: Comments, Commands, Functions and Parameters.
Comments are simple: they are considered to be anything after a "|"
character.
Commands come in three types: Conditional, Ordinary and Branch commands.
Conditionals have the form: "If <Condition> Then <Command> Else <Command>".
The "Until <Condition>" command also comes into this category.
Ordinary commands normally appear at the start of each line. They may have
zero or more parameters. If they have parameters then these are enclosed in
brackets.
Branch related commands come in several types. "Define <DefinitionMarker>"
sets a named mark at a point in the file, "Call <DefinitionMarker>" calls the
relevant "Define" and continues until a "Return" is encountered.
"Goto <DefinitionMarker>" simply continues execution from the relevant
"Define".
Functions may be given instead of parameters. They should never appear at
the start of a line. Functions are defined over the domain (&0000-&FFFF).
They generally range over (&0000-&FFFF). That they have the same range as
their domains means that it is convenient to feed the results of functions
to other functions as parameters.
Parameters may cover the range from &0000 to &FFFF. They may be given as
signed or unsigned, decimal or hexadecimal (with a preceeding "&") integers.
Where a paramter is required, this may be given as a constant numerical value
or as a function. Variables may be used and are implemented as simple
functions.
Textures are not especially sensitive to punctuation mistakes, spaces, or
other idiosyncrasies. If brackets are mismatched, the program guesses where
they should be and inserts them. This is useful when editing textures in a
text editor.
3.00 Command summary (commands grouped by class)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
01 Functions
~~~~~~~~~~~~
Combine(Type,A,B)
ScaledSignedMultiply(A,B)
SignedMultiply(A,B)
PartlyScaledSignedMultiply(A,B)
PartlyScaledMultiply(A,B)
Divide(Numerator,Denominator)
Eor(A,B)
And(A,B)
Or(A,B)
Absolute(A)
LogicalShiftLeft(A,Exponent)
LogicalShiftRight(A,Exponent)
ArithmeticShiftLeft(A,Exponent)
ArithmeticShiftRight(A,Exponent)
Variable(Variable_Number)
Random(And_value,Eor_value)
02 Types
~~~~~~~~
SimpleAddition
UnboundedAddition
CeilingAddition
HalvingAddition
SimpleSubtraction
UnboundedSubtraction
FloorSubtraction
HalvingSubtraction
Maximise
Minimise
Overwrite
PositiveOverwrite
Preserve
Multiplication
ScaledMultiplication
Zeroise
03 Constants
~~~~~~~~~~~~
True
False
Zero
Ninety
OneHundredAndEighty
TwoHundredandSeventy
FloydSteinberg
04 Variables
~~~~~~~~~~~~
X
Y
Z
Size
LogSize
LogBitsPerPixel
AnimationFrameNumber
AnimationType(Frequency)
Sin(Theta)
Cos(Theta)
SignedSin(Theta)
SignedCos(Theta)
SquareRoot(Value)
05 Section of Functions of X and Y
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Noise(Intensity,MaximumFrequency)
PinkNoise(Intensity,MaximumFrequency)
QuickNoise(Intensity,MaximumFrequency)
BandpassNoise(Intensity,MinimumFrequency,MaximumFrequency)
BandpassQuickNoise(Intensity,MinimumFrequency,MaximumFrequency)
FractalNoise(MaximumIntensity,FractalDimension)
ShiftedSymmetricNoise(Intensity,MaximumFrequency,X,Y)
ShiftedSymmetricPinkNoise(Intensity,MaximumFrequency,X,Y)
ShiftedNoise(Intensity,MaximumFrequency,X,Y)
ShiftedPinkNoise(Intensity,MaximumFrequency,X,Y)
ShiftedSymmetricQuickNoise(Intensity,MaximumFrequency,X,Y)
ShiftedQuickNoise(Intensity,MaximumFrequency,X,Y)
ShiftedSymmetricFractalNoise(MaximumIntensity,FractalDimension,X,Y)
ShiftedFractalNoise(Intensity,MaximumFrequency,X,Y)
TwoDimensionalPoint(X,Y)
OneDimensionalPoint(X)
OneDimensionalPointOne(X)
OneDimensionalPointTwo(X)
QuickTwoDimensionalPoint(X,Y)
QuickOneDimensionalPoint(X)
QuickOneDimensionalPointOne(X)
QuickOneDimensionalPointTwo(X)
06 Miscellaneous
~~~~~~~~~~~~~~~~
Beep
Bell
End
Checksum(Value)
UnknownCommand
07 Conditional
~~~~~~~~~~~~~~
If <Condition> Then <Command> Else <Command>...
IsLessThan(A,B)
IsGreaterThan(A,B)
IsLessThanOrEqualTo(A,B)
IsGreaterThanOrEqualTo(A,B)
SignedIsLessTha