The language is the same for every version, but the program keeps a language version that decides some defaults and some behaviours, so that a scene written long ago renders as it was meant to. The directive #version sets it. This page lists what the number changes, which features need which version, what an old scene needs, and which keywords are deprecated. The other pages of this reference describe the 3.8 language; they mention a version only where a table column says "since".
#version and the effective version
#version number;
#version unofficial number;
#version version;
| Topic | Behaviour |
|---|---|
| The number | A float expression. The parser stores it as an integer, the number times 100 rounded (3.8 is 380, 3.62 is 362). A semicolon should follow it; without one the parser warns. |
| Effective version | Until a #version has been read, the effective version is 3.62. After it, it is the number given. The Version option (+MVn.n) sets the initial value before the scene is read; a scene can still change it. |
The built-in version | A float that holds the effective version, so #declare Saved = version; in a scene without #version gives 3.62. The exception is the statement #version version; itself, where version is the version of the running program, so a scene can say "use whatever program renders me". |
| Changing it again | #version may stand several times in a file. The usual use is in include files: save version, set the version the file was written for, and restore it at the end (Include files). Changing it does not undo what was already parsed; it changes how the following text is read. |
| First statement rule | In the main file of a scene the #version should be the first statement that is not a comment. If something else comes first and the version is 3.8 or higher, it is a parse error. If the version is lower, the parser warns after the scene. A scene without any #version also gets a warning. |
| Too new | A version above the running program's (for instance #version 4.0;) stops with "Your scene file requires POV-Ray version ... or later!". |
#version 3.71 | Warning: that number was the working name of what was released as 3.8. Write #version 3.8. |
unofficial | The word may follow #version. In an official build it is an error ("created for an unofficial version"); in an unofficial build (one made with COMPILED_BY, see Tooling) it is accepted and enables nothing by itself. It lets a scene state that it uses features of a modified program. |
| After parsing | If the scene ended with a version below 3.5, the parser warns that bug compatibility with 3.1 and earlier is not guaranteed, and raises the version to 3.5 for the rest of the render. If the first #version came late, or none came, there is a warning. The warning level option Warning_Level 5 turns off the language-version warnings. |
| The defaults lock | The defaults that change at 3.8 (below) can be switched back and forth with #version until the first default statement. After that, #version only gives a warning ("Scene language version changed after a 'default' statement") and the defaults stay as they are. |
#version version;
#debug concat("running as version ", str(version, 0, 2), "\n")
#version 3.5;
#debug concat("now ", str(version, 0, 2), "\n")
#local Saved = 3.8;
#version Saved;
#debug concat("restored ", str(version, 0, 2), "\n")
global_settings { assumed_gamma 1.0 }
camera { location <0, 0, -2> look_at 0 }
light_source { <0, 0, -10> rgb 1 }
sphere { 0, 1 }
str takes the value, the minimum length and the number of decimals.)What the version changes
The rows run from the newest to the oldest. "Below" means the effective version is lower than the number; "from" means equal or higher. Everything here is read from the parser and the render code of the 3.8 tree.
| Version | Area | Behaviour |
|---|---|---|
| from 3.8 | defaults | An object with no pigment is plain white (rgb <1, 1, 1>); the default ambient is 0.0; the default length of the camera right vector is the image aspect ratio (width over height). Below 3.8: black, 0.1 and 1.33. These new defaults need the version to be 3.8 or more (by #version, Version or +MV). |
| from 3.8 | main file | A #version of 3.8 or higher in a main file that did not start with #version is an error. |
| from 3.8 | file names in strings | A backslash in a string that is read as a file name is an escape sequence, as in any string (so write a path with forward slashes). Below 3.8 it kept its literal meaning, with a warning where it matters. |
| from 3.8 | Netpbm input | Input PPM and PGM images are taken as gamma encoded with the BT.709 curve unless the scene says gamma (the parser warns and suggests gamma bt709). Below 3.8 no gamma correction was applied. |
| from 3.8 | image alpha | filter all and transmit all work on an image that has an alpha channel. Below 3.8 the old (legacy) transmit mode is used for image maps. |
| from 3.8 | lights | fade_power with fade_distance 0 selects the mode where the intensity follows an inverse power law from unit distance. Below 3.8 that combination is not supported: fade_power is ignored, with a warning. |
| from 3.8 | lathe | A linear spline whose first or last point has a negative x is an error. Below 3.8 that case only warns ("leads to artifacts"); a negative x in an inner point is an error in any version. The quadratic spline has the same rule for its last point. |
| from 3.8 | text | charset is not used any more; the encoding of the file decides. Below 3.8 the text object maps characters according to charset (ASCII if none). |
| from 3.7 | gamma | A scene is gamma-aware: assumed_gamma is expected and defaults to 1.0 when missing (with a warning). Below 3.7 gamma handling is off when assumed_gamma is not given. PNG input images get a different default gamma handling below 3.7 (the parser warns). |
| from 3.7 | ambient and radiosity | When radiosity is on, the finish ambient term is not used (use emission for glowing surfaces). Below 3.7 both are added. A large ambient value from 3.7 on gets a warning that suggests emission. |
| from 3.7 | transparency | The weight of a texture layer uses the opacity of its colour; below 3.7 a legacy formula is used. The sky sphere filter is also computed the way 3.6 did below 3.7. The scene background is composed against black unless alpha output is on; below 3.7 it is treated differently when alpha output is on. |
| from 3.7 | global settings | max_intersections is ignored and warned about. |
| from 3.5 | noise | The default noise_generator is 2 (range corrected). Below 3.5 it is 1, the original noise. |
| from 3.5 | camera | A camera statement starts from the default camera, or modifies a camera identifier; a later camera replaces an earlier one (with a warning). Below 3.5 camera statements add to the previous one. |
| from 3.5 | media | The default media sampling method is 3 with 1 interval and 10 samples. Below 3.5 the older settings. |
| from 3.5 | semicolons | A #declare of a float, vector or colour without the final ; is an error. From 3.1 up to 3.5 it is a warning. |
| from 3.5 | other checks | Warnings for declare without #, for max_trace_level outside global_settings, for normalising a zero-length vector. A character above 127 in a string that is read as a plain character string is replaced by a space (with a warning); below 3.5 the 8-bit value is kept. |
| below 3.5 | radiosity | A radiosity block only warns that it now turns radiosity on. The radiosity of 3.7 cannot be reached back by the version (the manual states the same). |
| from 3.1 | macros | #macro needs version 3.1 or higher; below it is an error ("Macros require #version 3.1 or later"). |
| 3.1 and below | layered textures | The filter value of the pigment of the layers is converted to transmit, for old layered textures. |
| from 3.0 | texture syntax, settings | Below 3.0 the old (version 1) texture syntax is read. From 3.0, a setting that belongs in global_settings but stands outside it gets a warning. |
| below 2.0 | height fields | The water_level value is divided by 256. |
| 2.95 and up | directives | A declare, include or version without the # gets a warning. |
| 1.5 and up | old syntax | Warnings for old forms: bicubic patch parameters without keywords, a CSG object with fewer than two objects, composite (use union), alpha (use filter), a pigment type that is not first, a bare number for crand in a finish (use the keyword), a bare number for the fog distance (use distance), a colour map on a pigment that cannot have one. |
#version 3.7;
global_settings { assumed_gamma 1.0 }
camera { location <0, 0, -2> look_at 0 angle 40 }
light_source { <0, 0, -10> rgb 1 }
sphere { 0, 1 }
#version 3.7 the sphere is black (the default pigment is black, and 0.1 of black ambient adds nothing). Change the first line to #version 3.8; and the same sphere renders grey-white at the centre, where the light hits it. Checked by rendering both scenes to a PPM at 4 by 4 pixels.Features by the version that added them
The sources are the manual's "new in" notes and the parser. The list covers what matters when a scene must run on an older program. A feature that is not listed was already there at 3.0.
| Feature | Since | Notes |
|---|---|---|
| any pattern for pigment or normal | 3.0 | before, some patterns were only for one of them |
# before every directive | 3.0 | earlier versions allowed directives without it only between statements |
macros with parameters (#macro) | 3.1 | need #version 3.1 or higher |
; after #declare and #version | 3.1 | required from 3.5 |
interior | 3.1 | holds the inside properties of an object; the material statement groups it with a texture |
| media sampling method 3 as default | 3.5 | |
a radiosity block that turns radiosity on | 3.5 | rewritten in 3.7: the cache file is set by options, and results differ |
| noise generator 2 (range corrected) as default | 3.5 | generator 3 is Perlin noise |
multi-threaded rendering (Work_Threads, +WT) | 3.7 | program feature |
gamma handling, assumed_gamma as a required item | 3.7 | also srgb, srgbf, srgbt and srgbft colour keywords |
emission in a finish | 3.7 | |
#break | 3.7 | may stand anywhere in a #case or #range block, a loop or a macro (before, only right before the next #case) |
| mesh camera | 3.7 | experimental; the render reports it |
| area light diffuse and specular illumination | 3.7 | experimental |
max_extent() of an image map | 3.7 | returns the pixel size; experimental |
slope pattern with a reference point | 3.7 | experimental (slope altitude) |
fonts crystal.ttf, cyrvetic.ttf, timrom.ttf built in | 3.7 | in 3.8 they are files of the include folder |
| new alpha handling in output files | 3.7 | the background needs a filter or transmit value |
anti-aliasing method 3 (+AM3) | 3.8 | Antialias_Confidence, Stochastic_Seed |
the constant tau | 3.8 | 2 times pi |
dictionaries and mixed arrays; global and local pseudo-dictionaries | 3.8 | |
optional macro parameters | 3.8 | and faster repeated calls of a macro from another file |
use_alpha in a finish | 3.8 | fresnel also applies to ambient, diffuse, emission, specular and phong |
isosurface polarity; potential pattern | 3.8 | |
user_defined pigment | 3.8 | colour from a set of functions |
extended ovus; spindle torus control | 3.8 | |
| non-linear pigment map interpolation; maps with more than 256 entries | 3.8 | |
map_type 7 (angular map, for light probes) | 3.8 | |
bt709 and bt2020 gamma names | 3.8 | |
trailing comma in bicubic_patch and matrix | 3.8 | |
blue noise and more dithering methods; Create_Continue_Trace_Log | 3.8 | program options |
| unlimited length of string literals | 3.8 | was 256 |
What an older scene needs
- Put the right
#versionfirst. A 3.7 scene needs#version 3.7;to be read as one; without it the scene is read as 3.62 and warned about. A scene written for 3.1 or earlier works with#version 3.1;(or+MV3.1) but only for the language, not for the bugs of that program. - To keep an old scene's look, leave the version below 3.8: the new defaults (white pigment, ambient 0, aspect-ratio camera) and the other behaviours of the table apply only from 3.8. To move a scene to 3.8, set the pigment,
ambientandrightit relied on. - A scene without
assumed_gammarenders without gamma handling below 3.7. Addingassumed_gamma 1.0changes the colours. - Replace removed or ignored words:
max_intersections,hf_gray_16,charset,load_fileandsave_fileinradiosity. - Check
glass_old.inctextures, which warn, and convert them to the materials ofglass.inc.
Deprecated and experimental
| Item | Status |
|---|---|
alpha in a colour | discontinued: use filter (warning from 1.55) |
composite | use union (warning from 1.5) |
quick colour (color directly in an object) | "belongs in texture"; ignored with a warning |
max_intersections, hf_gray_16, charset | read and ignored, with a warning |
max_trace_level outside global_settings | works, with a warning from 3.5 |
ambient used for glow | use emission; a warning for big values from 3.7 |
declare, include, version without # | warn |
defined() and #ifdef on a reserved word | true, with a warning |
identifiers declared deprecated | a use prints the declared message, once |
options Light_Buffer, Vista_Buffer, Draw_Vistas, Video_Mode, Palette, Test_Abort, Field_Render, Odd_Field | deprecated program options (INI options and switches) |
| experimental features | mesh camera, user-defined camera, spline, subsurface light transport, the .hf function component, slope altitude, backside illumination, obj import and TIFF reading. A render that uses one prints a warning that its design may change. |
Not described
Known, not yet covered
- Reference: the version of origin of many individual keywords (objects, patterns, finish words) is not recorded in the parser source; the "since" column lists only what the manual and the source state. The behaviour differences between 3.1 and 3.5 that concern rendering bugs, not syntax, are not listed.