POV-Ray : Newsgroups : povray.text.tutorials : Updated scripts for make-shift cluster rendering : Updated scripts for make-shift cluster rendering Server Time
24 Apr 2024 01:30:59 EDT (-0400)
  Updated scripts for make-shift cluster rendering  
From: jhu
Date: 29 Jan 2014 18:55:01
Message: <web.52e993ec552e7103d19b0ec40@news.povray.org>
See
http://news.povray.org/povray.text.tutorials/thread/%3Cweb.4bab09e0aad27b55ab8b233e0%40news.povray.org%3E/
for general principles.

I have two 6-core machines that I use for rendering scenes that take a long time
to render. Given a scene called "foo.pov", "foo1,pov" and "foo2.pov" are just
copies of each other.

First machine runs this script:

******************
#!/bin/bash
for ((i=1; i<=1080; i+=20))
do
  if [ ! -e "$i.png" ]
   then
    touch $i.png
    let "j = i + 19"
    povray +A0.3 -d +ifoo1 +O$i.png +w1920 +h1080 +SR$i +ER$j
  fi
done
********************

Second machine runs this script

******************
#!/bin/bash
 for ((i=1; i<=1080; i+=20))
 do
  if [ ! -e "$i.png" ]
   then
    touch $i.png
    let "j = i + 19"
    povray +A0.3 -d +ifoo2 +O$i.png +w1920 +h1080 +SR$i +ER$j
  fi
 done
********************

We end up with numerous files named 1.png to 1061.png once all the machines are
finished rendering, each file being a 20 line portion of the final image. Stitch
them together using imagemagick command-line programs:

******************************
#!/bin/bash

for ((i=1; i<=1080; i+=20))
do
  let "j = i + 19"
  let "k = i - 1"
  convert -define png:size=1920x1080 -extract 1920x20+0+$k $i.png $i\_new.png
done

mv 1_new.png 0001_new.png

for ((i=21; i<=99; i+=20))
do
        mv $i\_new.png 00$i\_new.png
done

for ((i=101; i<=999; i+=20))
do
        mv $i\_new.png 0$i\_new.png
done

convert `ls *\_new.png` -append image.png
**********************************************

Final image is image.png


Post a reply to this message

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