Pov-ray 3.7 stereographic camera

Basics of the patch

This patch adds a stereographic camera to pov-ray that allows a user to create side-by-side images, rendered directly on a second (non-primary) screen. Images are rendered as side-by-side images, you you don’t need extra post-processing.

This patch is licensed as AGPL3, the same way as pov-ray 3.7 itself is licensed. You need Visual Studio 2013 for this to work.

You can download the patch and everything you need here on github.

Before compiling the source code

I have a pretty new computer, and my CPU supports AVX2. You can look that up at ark.intel.com .

If your CPU supports AVX or AVX2, it’s best to update the properties of the C++ projects of the release configuration (set build target to the correct capabilities) and update those settings. This simple change can really make a difference in rendering speed.

Second screen

I usually put my code on one screen and enable my 3d second screen. Set the render resolution to the 3D screen resolution and render away; the results will be shown on your second screen.

If you just want to work with one screen that’s fine. If you have one screen attached, it’ll just work like it used to work. You can view the results in 3D with my other tools.

Where did my blocked preview window go?

It’s gone. For good I hope.

Looking at uniformly distributed blocks on a stereographic display as-if it was a side-by-side image, will definitely give you a strong headache that’s going to last for days.

How it works

Apart from the obvious changes in the tokenizer, render window, and all the other plumbing, the main change is in the camera.

Basically you define the distance between two eyes and the distance to the screen. The renderer will then render both pictures as side-by-side image. It’s pretty simple to implement, really.

Test scene

Any scene from pov-ray will do; you just need to modify the camera. I’ve constructed a small test scene with a sphere in front of the screen:

#local VP = <0,0,1>;
camera {
   stereoscopic                // New camera type
   zeroparallax 2.5
   eyeoffset -0.5*1/30

   location VP*0.8
   up y
   right image_width*x/image_height
   angle 60
   sky <0,0,1>
   look_at 0
}
                  
text {
    ttf "arial.ttf" "Some text here"
    0.2, 0
    translate x*-3
    rotate z*180
    rotate y*110
    translate z*-2
    translate y*0.2
    texture {pigment {color rgb <0.5,0.5,1> } } 
    }

plane { <0,1,0>, 0.3
texture {pigment {color rgb <0,1,1> } } }

sphere { <0,0,0>, 0.2
texture {pigment {color rgb <1,0,0> } } }
 
 light_source {
 <-1,0,1>
 color rgb 1
 }                                      

The result: