The scanner of POV-Ray 3.8 looks every identifier up in a fixed table of reserved words. A word that is in the table becomes a keyword token and cannot be used as the name of a user identifier: #declare box = 1; is an error. The table (Reserved_Words in source/parser/reservedwords.cpp) holds 523 words, written in lower case and matched case sensitively. In the program that the examples on this site were run with, 515 of them are active; the other eight are inside #if blocks of the source and are compiled out (see the end of this page). This page lists every word, grouped by what it does. A word that is used in several places is listed once, in the group where it is mostly used, and the meaning says where else it appears.
Eight words have a second spelling (color for colour, grey for gray and so on); both spellings give the same token. How the scanner finds a word in the text is on Lexical structure; the words that follow a # are on Preprocessor directives.
Token categories
Reserved words are matched against the text word by word, so a word that contains another (boxed, box) is a different word; the scanner takes the whole identifier first and looks it up afterwards.
The header reservedwords.h numbers the tokens in blocks. The order matters: the parser tests a token against the end of a block to ask which kind of expression the token can start. A token that is in no block is a plain keyword. There are four categories.
| Category token | Name in messages | What is in the block | Meaning |
|---|---|---|---|
SIGNATURE_TOKEN_CATEGORY | file signature | only the UTF-8 byte order mark | tokens that identify a file format |
FLOAT_TOKEN_CATEGORY | float function | the words abs acos acosh asc asin asinh atan atan2 atanh bitwise_and bitwise_or bitwise_xor ceil clock clock_on cos cosh defined degrees dimension_size dimensions div exp false file_exists floor inside int ln log max min mod no now off on pi pow prod radians rand seed select sin sinh sqrt strcmp strlen sum tan tanh tau true val vdot version vlength yes, and the tokens for a float identifier and a float constant | words that may start a float expression |
VECTOR_TOKEN_CATEGORY | vector function | the words max_extent min_extent trace vaxis_rotate vcross vnormalize vrotate vturbulence x y z, and the token for a vector identifier | words that may start a vector expression |
COLOUR_TOKEN_CATEGORY | colour keyword | the words alpha blue filter gray green red rgb rgbf rgbft rgbt srgb srgbf srgbft srgbt transmit, and the token for a colour identifier | words that may start a colour expression |
A float expression is therefore recognised by its first token: a number, a float identifier, or one of the float words. The block order of the source also puts sqr outside the float block: sqr is a keyword of the julia_fractal object only and is not a function. The expression rules are on Expressions, vectors and identifiers, and the functions one by one on Functions and constants.
Examples
The two spellings of a word give the same token, so they can be mixed. A word that is compiled out (see the end of the page) is free to use as a name.
#declare A = color rgb <0.2, 0.4, 0.6>;
#declare B = colour red 0.2 green 0.4 blue 0.6;
#declare Same = ((A.red = B.red) & (A.green = B.green) & (A.blue = B.blue));
#debug concat("same colour: ", str(Same, 0, 0), "\n")
#declare breakpoint = 7;
#declare obj = 8;
#debug concat("free words: ", str(breakpoint + obj, 0, 0), "\n")
sphere { 0, 1 pigment { gradient x color_map { [0 color A] [1 colour B] } } }
same colour: 1 and free words: 15. color and colour are one word, red 0.2 green 0.4 blue 0.6 builds the same colour as rgb, and breakpoint and obj are ordinary names in this build.A reserved word cannot be declared. The messages of the two common mistakes:
#declare box = 1;
Parse Error: Expected 'undeclared identifier', box found instead
#declare a = sqr(2);
Parse Error: Expected 'RValue to declare', sqr found instead
Directive and statement words
The words that follow #, and the words that belong to declarations and file access.
| Word | Meaning |
|---|---|
append | file mode of #fopen: open a file for writing at its end |
break | #break: leaves a #switch case or a loop |
case | #case: one branch of a #switch |
debug | #debug: writes text to the debug stream |
declare | #declare: defines an identifier with global scope |
default | #default: sets the default texture settings |
deprecated | in a #declare or #local: marks the new identifier as deprecated, with a message that is shown when it is used |
else | #else: the alternative branch of a conditional |
elseif | #elseif: a further condition in an #if chain |
end | #end: closes #if, #ifdef, #ifndef, #while, #for, #switch and #macro |
error | #error: stops the parse with a message |
fclose | #fclose: closes a file opened by #fopen |
fopen | #fopen: opens a data file |
for | #for: counting loop |
if | #if: conditional |
ifdef | #ifdef: conditional on an identifier being declared |
ifndef | #ifndef: conditional on an identifier not being declared |
include | #include: reads another file at this place |
local | #local: defines an identifier that ends with the enclosing block, macro or file; also the pseudo-dictionary local.name |
global | the pseudo-dictionary global.name, which reaches the global identifiers |
macro | #macro: defines a macro |
once | after deprecated: show the message only the first time |
optional | marks a macro parameter that may be left out; also used in multiple-assignment declarations and array initialisers |
range | #range: a range of values in a #switch |
read | #read: reads values from an open file; also the file mode of #fopen for reading |
render | #render: writes text to the render stream |
statistics | #statistics: writes text to the statistics stream |
switch | #switch: multi-way conditional |
undef | #undef: removes an identifier |
unofficial | in #version unofficial 3.8;: states that the file was written for an unofficial build |
version | #version: sets the language version; as a float word it is the current version number |
warning | #warning: writes a warning; the parse goes on |
while | #while: loop while a condition holds |
write | #write: writes values to an open file; also the file mode of #fopen that creates or empties a file |
sint8 | #write data type: signed 8-bit integers |
sint16be | #write data type: signed 16-bit integers, big endian |
sint16le | #write data type: signed 16-bit integers, little endian |
sint32be | #write data type: signed 32-bit integers, big endian |
sint32le | #write data type: signed 32-bit integers, little endian |
uint8 | #write data type: unsigned 8-bit integers |
uint16be | #write data type: unsigned 16-bit integers, big endian |
uint16le | #write data type: unsigned 16-bit integers, little endian |
function | declares or uses a user-defined function; also starts a function-valued pattern |
Objects
Keywords that begin a shape or a group of shapes. See Finite objects, Implicit objects, Meshes and CSG.
| Word | Meaning |
|---|---|
bicubic_patch | a bicubic surface patch with 16 control points |
blob | a set of spherical and cylindrical components that merge into one smooth surface |
box | a box between two opposite corners |
composite | the old name of union; reading it gives a warning for language version 1.5 or older |
cone | a cone or truncated cone, from two end points with radii |
cubic | a cubic polynomial surface given by 20 coefficients |
cylinder | a cylinder from two end points and a radius; also a light type and a camera type |
difference | CSG: the first object minus the others |
disc | a flat disc or ring |
height_field | a surface built from an image or a function |
intersection | CSG: the volume shared by all the objects |
isosurface | the surface where a function equals a threshold |
julia_fractal | a three-dimensional slice of a four-dimensional Julia set |
lathe | a surface of revolution made from a spline |
lemon | a lemon-shaped solid given by an apex, a base and three radii |
merge | CSG: a union without the inner surfaces |
mesh | a set of triangles and smooth triangles |
mesh2 | a mesh given as lists of vertices, normals, UV vectors and index triples |
object | uses an object identifier, or nests an object, and may add modifiers; also a pattern |
ovus | an egg-shaped solid from two radii; radius, distance and precision adjust it |
parametric | a surface given by functions of u and v |
plane | an infinite plane from a normal and a distance |
poly | a polynomial surface of order 2 to 15 from a list of coefficients |
polygon | a flat polygon from its corner points |
polynomial | a polynomial surface given as terms xyz(i, j, k): c |
prism | a linear or conic sweep of a closed spline |
quadric | a quadric surface from three vectors and a float |
quartic | a quartic surface given by 35 coefficients |
smooth_triangle | a triangle with a normal at each corner |
sor | a surface of revolution from a list of points |
sphere | a sphere from a centre and a radius |
sphere_sweep | a tube made by sweeping a sphere along a spline |
superellipsoid | a rounded box with two roundness exponents |
text | extruded text from a TrueType font |
torus | a torus from a major and a minor radius |
triangle | a flat triangle from three corners |
union | CSG: all the objects together |
split_union | modifier of union: sets whether the parts are split into separate bounding boxes |
light_group | a group of objects and lights that are lit as one set |
tiles | old texture form: two textures laid in a checker, the second after tile2 |
tile2 | in tiles: starts the second texture |
Keywords inside objects
Arguments and sub-keywords that belong to one kind of object.
| Word | Meaning |
|---|---|
accuracy | isosurface and parametric: how exactly the root of the function is found; also a normal setting |
all_intersections | isosurface: find every intersection of a ray |
cmap | text: selects the character map of the font by platform and encoding numbers (experimental) |
component | blob, old syntax: one spherical component |
conic_sweep | prism: the cross-section shrinks to a point at the far end |
contained_by | isosurface and parametric: the box or sphere that is searched |
cube | julia_fractal: the cube function type |
evaluate | isosurface: adaptive evaluation with three parameters |
face_indices | mesh2: the triangles, as triples of vertex indices |
flatness | bicubic_patch: how flat a subpatch must be before it is treated as flat |
hf_gray_16 | height_field: reads a PNG with 16 bits of grey as the height |
hypercomplex | julia_fractal: use hypercomplex numbers instead of quaternions |
inside_vector | mesh and mesh2: the direction of the ray that tests whether a point is inside |
internal | text: picks a built-in font by number |
linear_sweep | prism: the cross-section moves in a straight line |
major_radius | torus, and the toroidal warp: the radius of the ring |
max_gradient | isosurface and parametric: an upper bound for the gradient of the function |
max_iteration | julia_fractal: the number of iterations |
max_trace | isosurface: how many intersections of a ray are searched |
normal_indices | mesh2: normal index triples, one per face |
normal_vectors | mesh2: the list of normal vectors |
number_of_sides | pavement pattern: the number of sides of the tile |
open | leaves out the end caps of a cone, cylinder, isosurface, lemon, prism or sor |
polarity | isosurface: the sign that decides which side of the threshold is inside (positive is the default) |
precision | julia_fractal: the precision of the surface; ovus: the root tolerance |
precompute | parametric: the depth of a table that is computed first |
pwr | julia_fractal: the power function type |
quaternion | julia_fractal: use quaternions (the default) |
reciprocal | julia_fractal: the reciprocal function type |
slice | julia_fractal: the cutting plane in four dimensions |
smooth | height_field: interpolates the normals; also a camera keyword |
sqr | julia_fractal: the square function type |
strength | blob components and the black_hole warp: a strength value |
sturm | uses the slower and more exact Sturm root solver on poly, cubic, quartic, lathe, sor and prism |
texture_list | mesh2: a list of textures that faces select by index |
threshold | blob and isosurface: the level of the surface |
tolerance | sphere_sweep: the depth tolerance |
ttf | text: introduces the font file name |
type | bicubic_patch: the patch type; also the type number of a black_hole warp |
u_steps | bicubic_patch: subdivisions in the u direction |
uv_indices | mesh2: UV index triples, one per face |
uv_vectors | mesh2 and bicubic_patch: the UV coordinate list |
v_steps | bicubic_patch: subdivisions in the v direction |
vertex_vectors | mesh2: the list of vertex positions |
water_level | height_field: heights below this fraction are cut off |
xyz | polynomial: starts a term, xyz(i, j, k): c is the coefficient of xi yj zk |
radius | spotlight and cylinder light: the inner cone; ovus: the radius of the connecting sphere; photons: the gather radii |
Object modifiers
Items that may follow an object. See Object modifiers.
| Word | Meaning |
|---|---|
bounded_by | sets the bounding volume of an object |
clipped_by | cuts away the part of an object outside a shape |
cutaway_textures | in a CSG: where a surface is cut away, the texture of the cutting object is shown |
double_illuminate | lights a surface from both sides |
dtag | reads a string for debugging; only debug builds use it |
global_lights | says whether the global lights light this object or group |
hierarchy | turns the bounding hierarchy of an object on or off |
hollow | says that the inside of the object is empty, so media can fill it |
importance | radiosity: how much the object counts, above 0 and at most 1; also a radiosity global setting |
interior | the interior of an object: index of refraction, media and so on |
interior_texture | a texture for the inner side of the surface |
inverse | turns an object inside out; also a setting of the black_hole warp |
material | a texture and an interior used together |
no_image | camera rays do not see the object |
no_radiosity | radiosity rays do not see the object |
no_reflection | reflections do not show the object |
no_shadow | the object casts no shadow |
pass_through | in photons: photons go through the object |
photons | the photon settings of an object or a light |
projected_through | light: the object that the light is projected through |
refraction | in photons: the object refracts photons; in a finish, the old way to set the refraction |
target | in photons: the object is a target for photons |
collect | in photons and media: whether photons are collected |
uv_mapping | makes the textures of the object follow the UV coordinates of its surface |
Transformations and warps
| Word | Meaning |
|---|---|
matrix | a transformation by twelve numbers (a 4 by 3 matrix) |
rotate | rotates by angles in degrees about x, y and z |
scale | scales by one float or by a vector |
transform | applies a transform identifier, or starts a transform declaration |
translate | moves by a vector |
warp | bends the coordinates of a pattern before it is looked up |
black_hole | warp: draws the pattern into a centre like a black hole |
dist_exp | cylindrical and spherical warps: the exponent of the distance falloff |
flip | repeat warp: mirrors alternate copies along an axis |
offset | repeat warp: shifts each copy; also the offset of an image map |
orientation | cylindrical and toroidal warps: the axis of the warp |
repeat | warp: repeats the pattern along an axis |
Camera words
See Cameras.
| Word | Meaning |
|---|---|
camera | the camera block |
angle | the field of view in degrees |
aperture | the size of the lens opening for focal blur |
blur_samples | the number of rays for focal blur |
bokeh | the pigment of out-of-focus highlights |
confidence | focal blur: the confidence level of the adaptive sampling; also in media |
direction | the viewing direction and, by its length, the zoom of the camera; also in rainbows |
fisheye | camera type: fisheye |
focal_point | the point that is in focus |
location | the position of the camera |
look_at | points the camera at a position |
mesh_camera | camera type: rays are taken from a mesh |
omnimax | camera type: omnimax |
orthographic | camera type: parallel projection |
panoramic | camera type: panoramic |
perspective | camera type: perspective (the default) |
right | the right vector of the camera, which also gives the aspect ratio |
sky | the sky vector of the camera |
spherical | camera type: spherical; also a pattern and a map type |
ultra_wide_angle | camera type: ultra wide angle |
up | the up vector of the camera; also the direction of a ground fog |
user_defined | camera type: rays given by functions or a mesh; also a pattern type |
variance | focal blur: the variance for the adaptive sampling; also in media |
Light words
See Lights.
| Word | Meaning |
|---|---|
light_source | a light source |
adaptive | area light: the depth of adaptive sampling |
ambient_light | global setting: the colour of the ambient light |
area_illumination | area light: the shape of the light also shapes the illumination |
area_light | makes a light a rectangular or circular array of points |
circular | area light: a circular array |
fade_distance | light: the distance at which the light has full strength; also an interior value |
fade_power | light: the exponent of the fading; also an interior value |
falloff | spotlight and cylinder light: the angle of the outer cone; also a falloff value of the black_hole warp and of reflection |
jitter | area light: randomises the points; also in media and photons |
looks_like | an object that stands where the light is |
media_attenuation | light: the light loses strength in media |
media_interaction | light: the light shows in media |
orient | area light: turns the array to face the point that is lit |
parallel | light type: parallel rays |
point_at | the point at which a spotlight, cylinder or parallel light is aimed |
shadowless | the light casts no shadows |
spotlight | light type: spotlight |
tightness | spotlight: how sharp the edge of the cone is |
Texture, pigment, normal and finish words
See Textures and pigments and Normals and finishes.
| Word | Meaning |
|---|---|
texture | a texture: pigment, normal and finish together |
pigment | the colour of a surface |
normal | the bump pattern of a surface |
finish | how the surface reacts to light |
texture_map | a map from pattern values to textures |
pigment_map | a map from pattern values to pigments |
normal_map | a map from pattern values to normals |
slope_map | a map from pattern values to heights and slopes |
density_map | a map from pattern values to densities |
colour_map | a map from pattern values to colours |
material_map | chooses a texture by the index of an image pixel |
bump_map | makes a normal from the brightness of an image |
bump_size | the height factor of a bump |
no_bump_scale | the bump height does not scale with the object |
quick_colour | pigment and texture: the colour used for quick renders |
ambient | finish: the ambient light factor |
albedo | finish: the diffuse, phong or specular values are albedo values |
anisotropy | finish subsurface: the direction preference of scattering |
brilliance | finish: how the diffuse light depends on the angle |
conserve_energy | finish: reflected light is taken from the diffuse light |
crand | finish: random graininess of the surface |
diffuse | finish: the diffuse factor |
emission | finish and media: light that the surface or medium gives out |
fresnel | finish: reflection depends on the angle, by Fresnel's law |
irid | finish: thin-film iridescence |
metallic | finish: tints the highlights like a metal |
phong | finish: the strength of the Phong highlight |
phong_size | finish: the size of the Phong highlight |
reflection | finish: the colour or strength of the mirror reflection |
reflection_exponent | finish: shapes the reflection at the edge |
roughness | finish: the size of the specular highlight (small is sharp) |
specular | finish: the strength of the specular highlight |
subsurface | finish and global settings: sub-surface light transport |
thickness | irid: the thickness of the film |
translucency | finish subsurface: how much light shows through |
use_alpha | image_map: take the transmit value from the alpha channel of the image; also accepted in a texture |
use_colour | image_map: use the colour of the palette entries of an indexed image |
use_index | image_map: use the palette index of an indexed image |
Interior, media and atmosphere words
See Media and interior.
| Word | Meaning |
|---|---|
aa_level | media: the depth of the antialiasing of method 3 |
aa_threshold | media: the threshold of the antialiasing of method 3 |
absorption | media: the colour that is taken out of the light |
arc_angle | rainbow: the angle of the arc |
altitude | slope pattern: the direction of the height |
background | the colour behind everything |
caustics | interior: the strength of fake caustics |
density | media: a density pattern or a density map |
dispersion | interior: the dispersion of the index of refraction |
dispersion_samples | interior: the number of colour samples for dispersion |
distance | fog and rainbow: the distance at which the effect is strong; also an ovus setting |
eccentricity | media scattering: the eccentricity of the Henyey-Greenstein type |
exterior | the medium or setting of the outside of an object |
extinction | media scattering: a factor for the sum of absorption and scattering |
fade_colour | interior: the colour a fading ray tends towards |
falloff_angle | rainbow: the angle over which the rainbow fades out |
fog | atmospheric fog |
fog_alt | fog: how fast the ground fog thins with height |
fog_offset | fog: the height at which the ground fog starts |
fog_type | fog: 1 for constant, 2 for ground fog |
intervals | media: how many intervals a ray is divided into |
ior | the index of refraction |
media | a participating medium |
method | media: the sampling method 1, 2 or 3 |
rainbow | an atmospheric rainbow |
ratio | media: the share of samples taken in lit parts |
samples | media: the number of samples per interval |
scattering | media: the type and colour of scattering |
sky_sphere | a sphere of sky pigments around the scene |
turb_depth | fog: the depth of the turbulence |
turbulence | a turbulence value for patterns, warps, fog and iridescence |
width | rainbow: the angular width of the bow |
Global settings words
See Global settings.
| Word | Meaning |
|---|---|
global_settings | the block of settings for the whole scene |
adc_bailout | a ray stops when its contribution falls below this value |
always_sample | radiosity: take samples in every pretrace step |
ascii | charset: 7-bit text |
assumed_gamma | the gamma that the colours of the scene are given in |
autostop | photons: stop shooting at this fraction of the size of the target |
brightness | radiosity: the brightness factor of the result |
charset | the old way to choose the character set of the file; 3.8 warns that it is no longer supported |
count | radiosity: the number of rays per sample; photons: the count of photons |
error_bound | radiosity: the error bound |
expand_thresholds | photons: how the gather radius grows |
gather | photons: the minimum and maximum number of photons gathered |
gray_threshold | radiosity: how much of the colour of a surface is kept (grey at 0) |
irid_wavelength | the wavelengths used for iridescence |
load_file | radiosity: the file the sample data is read from |
low_error_factor | radiosity: the error factor of the first passes |
max_intersections | the number of intersections stored per ray |
max_sample | radiosity: an upper limit for the brightness of a sample |
max_trace_level | the recursion depth of reflection and refraction |
maximum_reuse | radiosity: the largest reuse of a sample |
minimum_reuse | radiosity: the smallest reuse of a sample |
mm_per_unit | the length of one scene unit in millimetres, used by sub-surface scattering |
nearest_count | radiosity: how many nearby samples are averaged |
noise_generator | chooses the noise algorithm |
number_of_waves | the number of wave sources of the ripples and waves normals |
pretrace_end | radiosity: the size of the last pretrace pass |
pretrace_start | radiosity: the size of the first pretrace pass |
radiosity | the radiosity block; also an object modifier block |
recursion_limit | radiosity: the depth of the diffuse bounces |
save_file | radiosity: the file the sample data is written to |
spacing | photons: the average distance between photons |
sys | charset: the system character set; also an image file type |
utf8 | charset: UTF-8 text |
Pattern words
See Patterns and maps.
| Word | Meaning |
|---|---|
agate | the agate pattern |
agate_turb | agate: the amount of turbulence |
aoi | the angle-of-incidence pattern |
average | the pattern that averages several patterns |
boxed | the box-shaped gradient pattern |
bozo | the bozo noise pattern |
brick | the brick pattern |
brick_size | brick: the size of a brick |
bumps | the bumps noise pattern |
cells | the cells pattern |
checker | the checker pattern |
control0 | quilted: the first control value |
control1 | quilted: the second control value |
coords | facets: the coordinates setting |
crackle | the crackle pattern |
cubic_wave | wave form: cubic |
cylindrical | the cylindrical pattern, map type and warp |
dents | the dents noise pattern |
density_file | a density taken from a DF3 file |
exponent | julia pattern: the exponent of the function; reflection: the exponent of the angle dependence |
facets | the facets pattern |
form | crackle: a form vector; pavement: the form number |
frequency | pattern modifier: how often the map repeats |
gradient | the gradient pattern, along a vector |
granite | the granite pattern |
hexagon | the hexagon pattern |
image_map | a pigment or normal taken from an image |
image_pattern | a pattern from the brightness of an image |
inside | a float function and a pattern: tests whether a point is inside an object |
interpolate | image maps and density files: the interpolation type |
julia | the Julia set pattern |
lambda | turbulence: the frequency step between octaves |
leopard | the leopard pattern |
magnet | the magnet fractal pattern |
mandel | the Mandelbrot pattern |
map_type | image maps: the projection type, 0 to 5 |
marble | the marble pattern |
metric | facets and crackle: the exponent of the distance metric |
mortar | brick: the thickness of the mortar |
number_of_tiles | tiling: the number of tiles per side |
octaves | turbulence: the number of octaves |
omega | turbulence: the weight of each octave |
onion | the onion pattern |
pattern | in a function: builds a function from a pattern |
pavement | the pavement pattern |
phase | pattern modifier: shifts the map |
pigment_pattern | a pattern from the brightness of a pigment |
planar | the planar pattern and map type |
poly_wave | wave form: a power of the ramp |
potential | the pattern made from the potential of a blob |
quilted | the quilted pattern |
radial | the radial pattern |
ramp_wave | wave form: ramp |
ripples | the ripples normal |
scallop_wave | wave form: scallop |
sine_wave | wave form: sine |
size | facets: the size of the facets |
slope | the slope pattern |
solid | crackle: fill the cells with solid values |
spiral1 | a spiral with one arm |
spiral2 | a spiral with two arms |
spotted | the spotted noise pattern |
square | the pattern of four squares |
tiling | the tiling pattern |
toroidal | the toroidal map type and warp |
triangle_wave | wave form: triangle |
triangular | the pattern of six triangles |
waves | the waves normal |
wood | the wood pattern |
wrinkles | the wrinkles pattern |
blend_gamma | colour_map: the gamma used for blending |
blend_mode | colour_map: how the colours are blended, 0 to 3 |
File-type and gamma words
| Word | Meaning |
|---|---|
all | image maps: filter all and transmit all set the value for every palette entry |
bmp | image file type: BMP |
bt2020 | gamma curve of ITU-R BT.2020 |
bt709 | gamma curve of ITU-R BT.709 |
df3 | density file type: DF3 |
exr | image file type: OpenEXR |
gamma | image maps: the gamma of the file, a number or one of srgb, bt709, bt2020 |
gif | image file type: GIF |
hdr | image file type: Radiance HDR |
iff | image file type: IFF |
jpeg | image file type: JPEG |
pgm | image file type: PGM |
png | image file type: PNG |
pot | image file type: POT |
ppm | image file type: PPM |
premultiplied | image maps: says whether the colours of the file are premultiplied by alpha |
tga | image file type: TGA |
tiff | image file type: TIFF |
Functions
Float, vector and string functions. Their arguments and results are on Functions and constants.
| Word | Kind | Meaning |
|---|---|---|
abs | float | absolute value |
acos | float | arc cosine, in radians |
acosh | float | inverse hyperbolic cosine |
asc | float | character code of the first character of a string |
asin | float | arc sine, in radians |
asinh | float | inverse hyperbolic sine |
atan | float | arc tangent, in radians |
atan2 | float | arc tangent of y over x, with the quadrant |
atanh | float | inverse hyperbolic tangent |
bitwise_and | float | bitwise AND of two integers |
bitwise_or | float | bitwise OR of two integers |
bitwise_xor | float | bitwise exclusive OR of two integers |
ceil | float | smallest integer not below the value |
chr | string | one-character string from a character code |
concat | string | joins strings |
cos | float | cosine of an angle in radians |
cosh | float | hyperbolic cosine |
datetime | string | formats a date and time that is given in days |
defined | float | 1 if an identifier is declared, else 0 |
degrees | float | radians to degrees |
dimension_size | float | the size of one dimension of an array |
dimensions | float | the number of dimensions of an array |
div | float | integer division |
exp | float | e to a power (also a julia_fractal function type) |
file_exists | float | 1 if a file can be found, else 0 |
floor | float | largest integer not above the value |
int | float | the integer part, cut towards zero |
ln | float | natural logarithm |
log | float | base 10 logarithm |
max | float | the larger of two values |
max_extent | vector | the upper corner of the bounding box of an object |
min | float | the smaller of two values |
min_extent | vector | the lower corner of the bounding box of an object |
mod | float | remainder of a division |
pow | float | a to the power b |
prod | float | product of the terms of a vector or array of floats |
radians | float | degrees to radians |
rand | float | next random number of a stream |
seed | float | makes a random stream |
select | float | chooses one of up to three values by the sign of the first |
sin | float | sine of an angle in radians |
sinh | float | hyperbolic sine |
sqrt | float | square root |
str | string | a number as text with a width and decimals |
strcmp | float | compares two strings |
strlen | float | the length of a string |
strlwr | string | lower-case copy of a string |
strupr | string | upper-case copy of a string |
substr | string | part of a string |
sum | float | sum of the terms of a vector or array of floats |
tan | float | tangent of an angle in radians |
tanh | float | hyperbolic tangent |
trace | vector | shoots a ray at an object and returns the hit point |
val | float | converts a string to a number |
vaxis_rotate | vector | rotates a vector about an axis |
vcross | vector | cross product |
vdot | float | dot product |
vlength | float | length of a vector |
vnormalize | vector | a vector scaled to length 1 |
vrotate | vector | rotates a vector by three angles |
vstr | string | a vector as text |
vturbulence | vector | the turbulence displacement at a point |
Constants and built-in variables
| Word | Meaning |
|---|---|
pi | the constant 3.14159... |
tau | the constant 2 pi |
true | the value 1 |
false | the value 0 |
yes | the value 1 |
no | the value 0 |
on | the value 1 |
off | the value 0 |
clock | the animation clock value |
clock_on | 1 when the animation is on, else 0 |
now | the current time as a number of days |
t | the name of the fourth component of a vector, after a dot |
u | the first component of a UV vector, after a dot; the u parameter in a parametric function |
v | the second component of a UV vector, after a dot; the v parameter in a parametric function |
x | the vector <1, 0, 0>; the first component after a dot |
y | the vector <0, 1, 0>; the second component after a dot |
z | the vector <0, 0, 1>; the third component after a dot |
Colour words
| Word | Meaning |
|---|---|
colour | starts a colour value (also spelt color) |
alpha | a discontinued name of filter; the parser warns for language version 1.55 or older |
blue | the blue component of a colour |
filter | the filter component of a colour |
gray | accepted after a dot, as in C.gray, where it is meant to give the grey value of a colour; in this program it returns the second component, the same number as C.green. It is not a keyword that can start a colour |
green | the green component of a colour |
red | the red component of a colour |
rgb | a colour of three components |
rgbf | a colour with a filter component |
rgbft | a colour with filter and transmit components |
rgbt | a colour with a transmit component |
srgb | an sRGB colour, converted to linear; also a gamma curve name |
srgbf | an sRGB colour with a filter component |
srgbft | an sRGB colour with filter and transmit components |
srgbt | an sRGB colour with a transmit component |
transmit | the transmit component of a colour |
Spline, array and dictionary words
| Word | Meaning |
|---|---|
array | declares an array |
b_spline | spline type: B-spline |
bezier_spline | spline type: Bezier curves with four control points per piece |
cubic_spline | spline type: cubic through the points |
dictionary | declares a dictionary |
linear_spline | spline type: straight lines between the points |
mixed | array: the elements may be of different types |
natural_spline | spline type: natural cubic spline |
quadratic_spline | spline type: quadratic through the points |
spline | declares a spline, or starts a spline value |
Alternative spellings
These words are listed in a block of their own in the table. Each gives the same token as the word in the second column.
| Word | Same as |
|---|---|
color | colour |
color_map | colour_map |
fade_color | fade_colour |
grey | gray |
grey_threshold | gray_threshold |
hf_grey_16 | hf_gray_16 |
quick_color | quick_colour |
use_color | use_colour |
Words that are compiled out
Eight words of the table are inside #if blocks of reservedwords.cpp. In this build they are ordinary identifiers: a scene that declares #declare breakpoint = 1; or #declare obj = 2; is accepted and runs.
| Word | Condition and meaning |
|---|---|
breakpoint | only when POV_DEBUG is set: a debugging aid of the parser |
distance_maximum | never (#if 0): an obsolete word |
obj | only when POV_PARSER_EXPERIMENTAL_OBJ_IMPORT is set (it is 0 by default): Wavefront OBJ import |
prefix | same condition as obj: part of the OBJ import |
suffix | same condition as obj: part of the OBJ import |
sred | never (#if 0): sRGB red component, not enabled at present |
sgreen | never (#if 0): sRGB green component, not enabled at present |
sblue | never (#if 0): sRGB blue component, not enabled at present |
Operator and punctuation tokens
The table of reserved words also holds 34 operator and punctuation tokens. Three of them have two characters: >=, <= and !=. How the scanner reads them is on Lexical structure, and how the parser uses them in Expressions, vectors and identifiers.
| Text | Token | Text | Token | Text | Token |
|---|---|---|---|---|---|
& | AMPERSAND | @ | AT | ` | BACK_QUOTE |
\ | BACK_SLASH | | | BAR | : | COLON |
, | COMMA | - | DASH | $ | DOLLAR |
= | EQUALS | ! | EXCLAMATION | # | HASH |
^ | HAT | < | LEFT_ANGLE | { | LEFT_CURLY |
( | LEFT_PAREN | [ | LEFT_SQUARE | % | PERCENT |
. | PERIOD | + | PLUS | ? | QUESTION |
>= | REL_GE | <= | REL_LE | != | REL_NE |
> | RIGHT_ANGLE | } | RIGHT_CURLY | ) | RIGHT_PAREN |
] | RIGHT_SQUARE | ; | SEMI_COLON | ' | SINGLE_QUOTE |
/ | SLASH | * | STAR | ~ | TILDE |
Pseudo-tokens
The last part of the table holds tokens that are not words of the language. They give the parser names for what it has just read, and the second column is what the error messages call them. The identifier tokens are the type tags of the symbol table; the table of identifier types, with what declares each, is on Expressions, vectors and identifiers.
| Token | Name in messages | Meaning |
|---|---|---|
ARRAY_ID_TOKEN | array identifier | an identifier declared as an array |
CAMERA_ID_TOKEN | camera identifier | a declared camera |
COLOUR_ID_TOKEN | colour identifier | a declared colour |
COLOUR_MAP_ID_TOKEN | colour_map identifier | a declared colour map |
DENSITY_ID_TOKEN | density identifier | a declared density |
DENSITY_MAP_ID_TOKEN | density_map identifier | a declared density map |
DICTIONARY_ID_TOKEN | dictionary identifier | a declared dictionary |
FILE_ID_TOKEN | file identifier | an identifier of an open data file (#fopen) |
FINISH_ID_TOKEN | finish identifier | a declared finish |
FLOAT_ID_TOKEN | float identifier | a declared float |
FOG_ID_TOKEN | fog identifier | a declared fog |
FUNCT_ID_TOKEN | function identifier | a declared function with a float result |
INTERIOR_ID_TOKEN | interior identifier | a declared interior |
MACRO_ID_TOKEN | macro identifier | a defined macro |
MATERIAL_ID_TOKEN | material identifier | a declared material |
MEDIA_ID_TOKEN | media identifier | a declared medium |
NORMAL_ID_TOKEN | normal identifier | a declared normal |
NORMAL_MAP_ID_TOKEN | normal_map identifier | a declared normal map |
OBJECT_ID_TOKEN | object identifier | a declared object |
PARAMETER_ID_TOKEN | parameter identifier | a macro parameter that was passed by name (a file, a macro or another identifier) |
PIGMENT_ID_TOKEN | pigment identifier | a declared pigment |
PIGMENT_MAP_ID_TOKEN | pigment_map identifier | a declared pigment map |
RAINBOW_ID_TOKEN | rainbow identifier | a declared rainbow |
SKYSPHERE_ID_TOKEN | sky_sphere identifier | a declared sky sphere |
SLOPE_MAP_ID_TOKEN | slope_map identifier | a declared slope map |
SPLINE_ID_TOKEN | spline identifier | a declared spline |
STRING_ID_TOKEN | string identifier | a declared string |
TEMPORARY_MACRO_ID_TOKEN | unfinished macro declaration | a macro whose definition is still being read |
TEXTURE_ID_TOKEN | texture identifier | a declared texture |
TEXTURE_MAP_ID_TOKEN | texture_map identifier | a declared texture map |
TRANSFORM_ID_TOKEN | transform identifier | a declared transform |
UV_ID_TOKEN | uv vector identifier | a declared two-dimensional vector |
VECTFUNCT_ID_TOKEN | vector function identifier | a declared function with a vector result |
VECTOR_4D_ID_TOKEN | 4d-vector identifier | a declared vector of four or five components |
VECTOR_ID_TOKEN | vector identifier | a declared three-dimensional vector |
EMPTY_ARRAY_TOKEN | empty array | the type of an array whose elements have not been given a value yet |
IDENTIFIER_TOKEN | undeclared identifier | a name that is in no symbol table yet |
DUMMY_SYMBOL_TOKEN | dummy symbol | the target of an omitted item in a multiple assignment |
END_OF_FILE_TOKEN | End of File | the end of the input |
FLOAT_TOKEN | float constant | a number in the text |
STRING_LITERAL_TOKEN | string literal | a string in the text |
UTF8_SIGNATURE_TOKEN | UTF-8 signature BOM | the byte order mark at the start of a file |