Using Povray from Geomorph

The purpose of Geomorph is to create and edit terrain maps. Creating believable landscapes requires also a "renderer" like Povray, which takes the 2D terrain map, places it in a 3D world and allows the user to add textures, a sun, a sky, clouds, water or other objects.

Unfortunately, Povray does not offer a GUI. As input, it takes text files of commands operating on mathematical coordinates, or "scene files", bearing the .pov extension, as seen on the schema at the bottom.

Povray files can be modified with text editors. Geomorph provides some standard scenes or templates to make the task easier. These pages present basic information for users who want to edit these scenes to experiment with Povray.



How Geomorph launches Povray

When the Geomorph user clicks on the "Render" button , a command like this one is executed:

povray +Iscene.pov +O_hfname.png +P + D +FN +W480 +H640

This command can also be executed on the command line, in a Linux console.

Before launching the command, Geomorph saves the active document in the "test.png" file. The Povray templates use this name as input. This way, you can render the active height field to see the outcome of what you are doing, before saving it under its actual name, in case you want to cancel the last change.

Version 0.40 and later
Now the active document name is contained in the global variable main_terrain. It is "test.png" if the active document has unsaved modifications, or the document name if it has been saved.

Geomorph also saves the parameters of the current camera in the camera.inc file.

The meaning of the options are:
+I : Input scene, the *.pov text file you can edit.
+O : Output file, a PNG or a TGA.
+FN: Output the result in the PNG format (use +FT for TGA, and -F for no file ouput)
+D : Displays the image. -D cancels the display, for instance when only a file is required (with +FN or +FT).
+P : Pauses after displaying the image, otherwise the image disappears immediately.
+W, +H : Width and height, in pixels

The +FN, +D, +P, +W and +H parameters can be changed in the options dialog.

Starting with version 0.23 of Geomorph, the output file name is the height field file name prefixed with "_". The prefix can be changed in the options dialog. This prefix avoids overwriting of the height field file by the output file.

When typing the Povray command in a console, outside Geomorph, if no output file is specified and an image output is required with the +FN or +FT option, the name of the scene file is used. For instance, desert.pov would give desert.png - in this case, it is preferable that your height field name is not desert.png !

When editing a Povray file rendered from Geomorph, it is recommended to start Geomorph from a console. This way, the Povray error messages would be displayed on the console.

Written in May 2005, modified in January 2007.

Contact:    Patrice St-Gelais

Back to the documentation index


SourceForge.net Logo