# POV-Ray

Posts: 61
Hiro Protagonist
edited March 2016 in Showcase
Anyone know POV-Ray?
The Persistence of Vision Raytracer, or POV-Ray, is a ray tracing program which generates images from a text-based scene description
It's free and open-source.

If anyone want to render Omnidirectional Stereo images or video, here the instructions:
• Overwrite the main .exe with this alpha build: (see the link in the next post)
• Create a scene, and declare a camera with this code:
```// ODS - Top/Bottom
#declare odsIPD = 0.065; // Interpupillary distance
#declare odsLocationX = 0;
#declare odsLocationY = 0;
#declare odsLocationZ = 0;
#declare odsHandedness = -1; // "-1" for left-handed or "1" for right-handed
#declare odsAngle = 0; // Rotation, clockwise, in degree.

camera {
user_defined
location {
function {  odsLocationX + cos(((x+0.5+odsAngle/360)) * 2 * pi - pi)*odsIPD/2*select(-y,-1,+1) }
function {  odsLocationY }
function {  odsLocationZ + sin(((x+0.5+odsAngle/360)) * 2 * pi - pi)*odsIPD/2*select(-y,-1,+1) * odsHandedness }
}
direction {
function {  sin(((x+0.5+odsAngle/360)) * 2 * pi - pi) * cos(pi / 2 -select(y, 1-2*(y+0.5), 1-2*y) * pi) }
function {  sin(pi / 2 - select(y, 1-2*(y+0.5), 1-2*y) * pi) }
function {  -cos(((x+0.5+odsAngle/360)) * 2 * pi - pi) * cos(pi / 2 -select(y, 1-2*(y+0.5), 1-2*y) * pi) * odsHandedness }
}
}
```

Some example of rendering (6480 x 6480 pixels, Top-Bottom).

Stacker Day - POV-Ray sample scene adapted for ODS

Fractals 1 - POV-Ray sample scene adapted for ODS

Fractals 2 - POV-Ray sample scene adapted for ODS

Wineglass - POV-Ray sample scene adapted for ODS

Axis - Test reference

I hope someone can render cool scene with POV-Ray and share here.

Enjoy POV-Ray!

• Posts: 61
Hiro Protagonist
Patch for POV-Ray 3.7:
https://github.com/POV-Ray/povray/relea ... 66%2Bav119

(i posted here because this forum mark 'as spam' if i include it in the first post... i don't know why)
• Posts: 26,156 Oculus Staff
Wow awesome. Didn't know that program was still around.
AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV
• Posts: 976
Art3mis
Last time I used Pov Ray was in the early 00's. Used it to create 3d rendered sprites for a J2ME game. I remember it being a fun tool.
• Posts: 131
Art3mis
Follow-up from the other thread, regarding stereo issue.

The "Stacker Day" image is the most practical to describe. Looking at the two tallest cube towers, in the space between the "P" cube on the left tower and the "O" cube on the right tower, there is a green cube that shows through. For me this green cube is visually "in front" of the towers while it should be behind. Similarly the "Y" purple cube behind the "R" and "A" on the right tower is closer to the viewpoint than the tower itself.

I don't know if you see what I mean. I seem to be particularly sensitive to these artifacts, as my eyes are always drawn to them immediately, while it doesn't bother other people as much.
If you look at the green cube between the towers and you close your eyes alternatively, you can see that we are seeing more of the right side of the cube when viewed with the right eye, it should be the opposite considering the geometry of the scene.

The POV-ray approach is very interesting. Being able to define all the rays individually is super powerful!
• Posts: 61
Hiro Protagonist
regarding stereo issue
My fault...
I correct the issue of "Stacker day", and re-rendered and re-uploaded all images.
But i feel the are still something that it's not correct when direction is not front, i'm trying to understand what...
Being able to define all the rays individually is super powerful!
This is the origin of my fault.
I made a patch of POV-Ray for ODS and test it (it not have the stereo issue above, at least the 'P' cube issue in "Stacker Day").
Within discussion about ODS on POV-Ray newsgroup, clipka implement user_defined camera.
At this point i convert my patch to the new user_camera, and i didn't notice the conversion issue (mainly because i still use the C version). I also have done a corneal transplantation on my right eye, and it's difficult for me to feel this kind of issue, sorry.
• Posts: 1
Hi Clodo,

I've installed PovRay 3.7 and your patch. I'm rendering default examples with your ODS camera setting. All seems to be fine. I'm using Capsule as player (very good).

I'm not sure if you still have any problem to correct. Is this setting ok?

Regards

Pedro
• Posts: 61
Hiro Protagonist
Hi pedropardo,
I just updated the user_defined formula in the first post and re-rendered/re-uploaded all images.
I hope i have resolved all issue. I'm waiting a feedback, thanks!
• Posts: 131
Art3mis
Yes they work!

Now the remaining artifacts are the spiral/singularities towards the zenith and nadir points. The current solution to this is to progressively remove the stereo for higher latitudes. It's called "pole merging", you can read more about this here for example. Various falloff curves can be tested to avoid loosing the stereo too soon.

(It's a trade of artifacts though, with the pole merging technique there is a slight curviness to the floor, as if the spot right under your feet felt farther away. It usually works well for outdoor zeniths.).
• Posts: 61
Hiro Protagonist
edited April 2016
I write two topic on my blog with all details about my ODS experiments,