POV-Ray : Newsgroups : povray.text.tutorials : jhu's very ghetto cluster for rendering still images : jhu's very ghetto cluster for rendering still images Server Time
15 Jun 2024 09:22:20 EDT (-0400)
  jhu's very ghetto cluster for rendering still images  
From: jhu
Date: 25 Mar 2010 03:05:01
Message: <web.4bab09e0aad27b55ab8b233e0@news.povray.org>
If you're like me, you'll have several computers at your disposal that you've
collected over the years. Well, time to dust them off and make them do something
useful. Currently I have a 2.6 GHz Athlon64 and a 1.2 GHz Celeron-L at my

Here are the general steps to set this whole thing up:

0) Put some sort of unix-like OS on the computers and install ssh (I'm assuming
you've already done this part)
1) Give all computers access to the same directory via nfs
2) Make a copy of the .pov file for each computer
3) Have each computer render one or more lines of the scene
4) stitch all the scene files together

Sounds simple, so let's get started.

PART 1 - Give all computers access to the same directory via nfs

If you don't already have a centralized file server with nfs, you can designate
one of computers as the nfs server. Grab the packages via your particular
package manager. Now to setup your nfs server; here's a good link:

The gist of it is to edit "/etc/hosts.deny", "/etc/hosts.allow", and

Let's edit "/etc/hosts.deny" first and put in the following:

That way no one can mount your nfs volume, even you! So let's edit
"/etc/hosts.allow" to change that. Here's mine:
rquotad: ,,
mountd: ,,
statd: ,,

You'll need to know your computers' IP addresses or host names. Then add them
in. Now to edit the "/etc/exports" file. Here's mine:

In my case, I'm sharing my nfs server's "/opt" directory with the other
computers. Now you just need to mount the remote directory to your computer
somewhere. I made a new directory "nfs" in my other computers' home directory so
when I remotely log in to them I just type "mount nfs" with being my nfs server


So now you have the remote directory mounted on each computer. Now to make
multiple copies of your .pov file. Let's call them scene1.pov, scene2.pov, and
scene3.pov. If you need radiosity, you'll need to render the original scene and
edit your scene file to save the radiosity data. Once that is done, edit all the
copies of the scene files to load the radiosity data. Now the fun part. Let's
write a script in the shared directory that will be run by each computer.

Here's script1.sh :

while [ ! -e "scene_1080.ppm" ]
 for ((i=1; i<=1080; i++))
  if [ ! -e "scene_$i.ppm" ]
    touch scene_$i.ppm
    povray +A0.3 -d +FP +iscene1 +Oscene_$i.ppm +w1920 +h1080 +SR$i +ER$i

Here's script2.sh :

while [ ! -e "scene_1080.ppm" ]
 for ((i=1; i<=1080; i++))
  if [ ! -e "scene_$i.ppm" ]
    touch scene_$i.ppm
    povray +A0.3 -d +FP +iscene2 +Oscene_$i.ppm +w1920 +h1080 +SR$i +ER$i

The preceding scripts render the scene at 1920x1080 one line at a time.
Eventually we'll end up with 1080 PPM files of 1920 pixels in length. Now,
depending on how long it takes to parse the scene file, it may be better to make
POV-Ray render several rows at a time instead of one at a time. Edit as


So now we have 1080 PPM files. PPM files are great for manipulation since the
way POV-Ray generates them, the first three lines are text followed by the image
data. In general there are 6 types of PPM files, designated P1, P2, P3, P4, P5,
or P6. POV-Ray outputs PPM files as the P6 type: the data portion is in red,
green, blue triplets in binary format. The other significant one is the P3 type
in which the RGB triplets are in ASCII.

If you open up one of these files in a text editor you'll see the following:

1920 1080
*** image data ***

So what we need to do is make a new PPM file with an appropriate header,
strip the first three lines from each of our 1080 PPM files, and then append the
image data to the new file. Here's the script to do that:

echo "P6 1920 1080 255" >> scene.ppm

for ((i=1; i<=1080; i++))
 cat scene_$i.ppm | sed '1,3d' >> scene.ppm

Now you can convert scene.ppm to your favorite image format.

Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.