POV-Ray : Newsgroups : povray.binaries.images : Tips for mc-pov Server Time
6 Nov 2024 00:29:18 EST (-0500)
  Tips for mc-pov (Message 1 to 2 of 2)  
From: H  Karsten
Subject: Tips for mc-pov
Date: 22 Sep 2008 13:55:01
Message: <web.48d7da57d7b86a7020776f0@news.povray.org>
Hi people

the last days, I've played with mc-pov again and I was thinking about the method
of combining the rendered images together (pass-rendering). To make experiments
of how to combine images the best way, I tell mc-pov to render only one pass
(in fact, the minimum is two). And then I've rendered an animation instead of a
still image, to get lots of low-passes images that I can combine by myself.

At the first time nothing moves, or does anything in the animation process - I
just like to have the images, to combine them into one image, but then I was
thinking about motionblur. And I make some experiments whith it.

Dont confuse the amount of the motionblur in the sample image with the count of
passes. There are not binded (as it look like in this example). I just used a
sequence of 1024 images for the experiment. Thats, why the blur effects
increases, when I've combined more pictures.

I find out, that it may be interesting, to pre-blur the images, before combining
them: The First image becomes the biggest blur-amount. The amount decreases with
all the images and is zero, when it comes to the last one.

Sometimes it helps good against the noise. And it also makes the picture more
video-compatible (flicker-effects on sharp corners etc.)

When rendering an animation instead of a single image, you can use the framestep
function to use multi-cpus for the rendering. I've used SMP-Pov but often, parts
of the picture were still rendering, hours after other parts was already
finished.

Here is my povray-script, that combines mc-pov images, by generating an
"Avisinth"-script.

################################################################################################################

// ###########################################
// #                                         #
// #  Hi people,                             #
// #  this nice rectangle comes with a       #
// #  program that creates an Avisinth       #
// #  script that combines series of         #
// #  images into one single image.          #
// #                                         #
// #  Use it in PovRay or Pov-patches        #
// #  Its designed to be used with mc-pov:   #
// #  use                                    #
// #                                         #
// #  mc_max_pass 1                          #
// #  mc_rand_seed                           #
// #                                         #
// #  in the montecarlo block in             #
// #  your mc-scene and render               #
// #  an animation instead of a single       #
// #  image.                                 #
// #                                         #
// #  Avisinth and VirtualDub working        #
// #  fine under Wine.                       #
// #                                         #
// #  have fun         h.karsten 2008        #
// #                                         #
// ###########################################

#declare name1="render\\picture_c";  // Part one of the name (everything in
front the number)
#declare name2=".prev.png";          // Part two of the name (everything after
the number)
#declare numbers=4;                  // 0000 = 4             (how many leters
the number have)
                                     // "picture_c0001.prev.png" in the "render"
folder as an example here.

#declare pictures=1024;              // how many pictures you like to combine.
Note: it MUST be a power of two (2,4,8,16,32,64,128,512,1024...)
#declare pre_bluring=true;           // When pre_bluring is true, the image
becomes more video-compatible and sometimes it helps to reduce the noise

#fopen AvisinthScript "Drag_this_into_VirtualDub.avs" write
#write(AvisinthScript,"# Install Avisinth and\n")
#write(AvisinthScript,"# drag this file into VirtualDub\n")
#write(AvisinthScript,"# or print it out to get nice tissue paper\n")
#write(AvisinthScript,"\n")
#declare r=1;

#while (r<=pictures)
 #declare pic=str(r,-numbers,0)
  #switch (pre_bluring)
   #case (true)
    #declare bluring=(1.58/pictures*(pictures-r)); // 1.58 is the maximun value
for the Blur() command in AviSinth

#write(AvisinthScript,"v1",str(r,0,0),"=Blur(ImageSource(",chr(34),name1,pic,name2,chr(34),"),",bluring,")\n")
   #break
   #case (false)

#write(AvisinthScript,"v1",str(r,0,0),"=ImageSource(",chr(34),name1,pic,name2,chr(34),")\n")
   #break
  #end
 #declare r=r+1;
#end

#declare a=1;

#while (a<pictures)
 #declare a=a*2;
 #write(AvisinthScript,"\n")
 #declare r=1;

  #while (r<pictures)

#write(AvisinthScript,"v",str(a,0,0),str(r,0,0),"=merge(v",str(a/2,0,0),str(r,0,0),",v",str(a/2,0,0),str(r+(a/2),0,0),"
)\n")
   #declare r=r+a;
  #end

#end

#write(AvisinthScript,"return (trim(v",str(a,0,0),"1,1,1))\n")
#fclose AvisinthScript

################################################################################################################

Don't forget to repair the broken lines in the code - sorry.

Here the good, and the bad things I've saw, while experimenting:

+ optimal multi-cpu usage by using the frame-step option
+ nice motionblur (also for the camera) possible
+ you have a pathtraycer
+ possibility of pre-processing the images before combining
+ you render all images without dof, motionblur, blurry shadows, anti-allaising
and any other multi-sample effects. This is close to the speed you have, when
you make a classic rendering and have all these features turned on, to get a
good looking result.


- every picture has to be parsed, when rendering an animation. The more CPUs you
have available the less this problem takes effect.
- the script I wrote is designed to produce only one image at the moment. I want
to enhance it to produce series of scripts (each for every frame you like to
have in an animation) and one to import all of these scripts as a sequence of
images, to get an animation.
- at the moment, the number of images you like to combine has to be a power of
two! (2,4,8,16,32,64...)


Post a reply to this message


Attachments:
Download 'anim.jpg' (449 KB)

Preview of image 'anim.jpg'
anim.jpg


 

From: H  Karsten
Subject: Re: Tips for mc-pov
Date: 22 Sep 2008 14:10:00
Message: <web.48d7deedef4dd73f20776f0@news.povray.org>
Here a sample of using pre_bluring in the script.

http://news.povray.org/povray.binaries.images/thread/%3Cweb.48d7ddd638631f5b20776f0%40news.povray.org%3E/


Post a reply to this message

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