### Cross-Eyed Stereo Viewing for FragM, version 1.0

• 7 Replies
• 221 Views

0 Members and 1 Guest are viewing this topic.

#### kosalos

• Fractal Friar
• Posts: 128

#### Cross-Eyed Stereo Viewing for FragM, version 1.0

« on: September 11, 2019, 03:41:48 AM »
Got Stereo Viewing working in FragM.
Not perfect, but usable.

How to view:  With your head ~2ft from the screen, cross you eyes slightly until you see three images.
Relax your gaze, and concentrate on the center image, which is in 3D.

How to update your FragM installation (for Windows,  others are similar?):
The 3D.frag file needs to copied to the
../Fragmentarium-2.5.0-190811-winex/Examples/Include  folder.

How to use:
The "Camera" tab has a new slider called StereoParallax.
Set that to 0.0 for 'normal' viewing.
Set it > 0 to enter 3D viewing, and adjust the parallax separation.
You will have to update the setting as you change the distance to the fractal.
Experiment with parallax & FOV for best effect.
Stereo viewing 'in theory' should work for all frags.

• Posts: 1866

#### Re: Cross-Eyed Stereo Viewing for FragM, version 1.0

« Reply #1 on: September 11, 2019, 07:17:55 AM »
Nice work!
This 3D.frag should get named 3DXIIdStereo.frag or something so it doesn't get mistaken for a normal 3D.frag?
And refer to it from Raytracer3DXIIdStereo.frag that gets included by Kleinian.frag (even though there isn't one copy Raytracer.frag just in case there are changes there that accommodate or enhance 3DXIId stereo viewing)
Saved along with the Buffershader.frag when Auto Save Fragments is enabled, just zip the Kleinian_Files folder after a test render.

This way they can develop as a set of frags for 3DXIId stereo rendering, rather than renaming existing frags.

I'm going to have to add a "kosalos" folder to the Examples repository
« Last Edit: September 11, 2019, 07:32:58 AM by 3DickUlus »

• 3f
• Posts: 1680

#### Re: Cross-Eyed Stereo Viewing for FragM, version 1.0

« Reply #2 on: September 11, 2019, 07:55:59 AM »
Would be nicer if the default 3D.frag supported it, otherwise you have to duplicate so much code for a one-line change (the #include).  then triplicate if you want anaglyph rendering, and quadruplicate for top/bottom equirectangular 360, etc etc.  If the options can be added to the existing 3D.frag in a backwards compatible way (i.e., all the defaults have stereo disabled), please do it that way, then all the existing frags will sprout stereo support with no changes/duplication necessary.

What about using the autofocus depth thing for autoparallax?  Or maybe use the DE at the camera point to calculate a sane parallax value, perhaps with a user settable factor?

Personally I prefer anaglyph to cross-eyed (or wall-eyed) viewing, when I have coloured glasses available.

IIRC Paul Bourke has some nice pages about stereo.

• Posts: 1866

#### Re: Cross-Eyed Stereo Viewing for FragM, version 1.0

« Reply #3 on: September 11, 2019, 08:58:36 AM »
What about using the autofocus depth thing for autoparallax?  Or maybe use the DE at the camera point to calculate a sane parallax value, perhaps with a user settable factor?

this is exactly the reason to start a branch that can develop a bit and then if it's compatible and clean it might migrate to the default.

I already have hundreds of frag_Files folders with many incarnations of 3D.frags, usually tweaked for a specific rendering and not meant to render with any other set of support files, so taking the main frag out of the _Files folder and using the default includes wont render the same as the specialized versions in the _Files folder, it's kinda the reason there is an option to save the support files along with the main frag.

so that special features developed by a user could be self-contained under a folder in the Examples repo and only migrate to the default includes folder when warranted either by modifying, in this case,  all existing 3D.frags or by moving 3DXIId.frag from the Examples/kosalos folder into the Examples/Include folder so that users can include it wherever they like.

In practice, I feel that it should remain in fi the kosalos folder and be used as an example/tutorial on How To Add 3DXIId Stereo to your frags instead of further modifying the base files, this is what FragM is really about, digging into the code and learning how to do stuff. If a user wants it all included, automatic and already done for them then I think they should use a different program.

edit: and for that matter this is also why Sabine62 started the code snippets board, so that novelty frags and cool effects can be shared, it can develop right here into the "must have" frag that every one will want. The amount of activity and progress in this thread will dictate weather or not it's destined to be incorporated into the fragment distribution base... really...
« Last Edit: September 11, 2019, 09:17:12 AM by 3DickUlus »

• 3f
• Posts: 1680

#### Re: Cross-Eyed Stereo Viewing for FragM, version 1.0

« Reply #4 on: September 11, 2019, 10:31:20 AM »
I added some things!  Thanks to kosalos for the inspiration, and thanks to Paul Bourke for his "Off axis (correct)" diagram on http://paulbourke.net/stereographics/stereorender/

What I changed:
- new uniform int Stereo: 0/1/2 for normal/anaglyph/cross-eyed
- new uniform float EyeSeparation, which controls the distance between cameras in world-space units (eg, if 1 unit is 1m setting it to 0.06 would be 6cm)
- new uniform float ProjectionPlane, which is the distance from the eye-plane to the zero-parallax plane (this is used for the asymmetric fustrum)
- note: Paul Bourke recommends ProjectionPlane to be around 30x EyeSeparation with no objects closer to the camera than ProjectionPlane / 2
- for anaglpyh rendering there are two colours for left and right eye filters, defaulting to red and cyan.

These 3 images have exactly the same base preset, I just toggled the Stereo control between 0/1/2.

#### hobold

• Fractal Fluff
• Posts: 370

#### Re: Cross-Eyed Stereo Viewing for FragM, version 1.0

« Reply #5 on: September 11, 2019, 01:41:18 PM »
I am not 100% sure, but to me it seems the bottom image is not actually a cross eye stereogram; left and right half would need to swap places for it to be cross eye.

#### kosalos

• Fractal Friar
• Posts: 128

#### Re: Cross-Eyed Stereo Viewing for FragM, version 1.0

« Reply #6 on: September 11, 2019, 05:05:10 PM »
Wow! Claude is really master!
Just need to negate the 'offset'.
Having the default offset calculated by the frag is great, but I also like manual control.
There are times when an intricate image has small details I want to view,
so I exaggerate the 3D effect just for that moment,
then return it to a lesser value for general viewing without eye strain.

• Posts: 1866

#### Re: Cross-Eyed Stereo Viewing for FragM, version 1.0

« Reply #7 on: September 11, 2019, 08:45:59 PM »
O0 but a little hard on my old eyeballs

the attached zip is how I think it should be "packaged", just unzip to Examples folder and it's available under Examples/kosalos/

Code: [Select]
Mandelbulb Distance EstimatorCross eyed 3D Setuphttps://fractalforums.org/code-snippets-fragments/74/cross-eyed-stereo-viewing-for-fragm-version-1-0/3066/msg16629by kosalos @fractalforums.org 19/10/09 with modifications by claude @fractalforums.org 19/11/09
why this way?

it's really easy to see how to use it
it's really easy to develop it
it's really easy to share it

it is a much bigger job to incorporate it into the entire frag base and then alter the frag base if something changes in XId stuff,
imho much nicer to create a tutorial outlining the changes by listing the differences between the XId files and the frag base files and explaining, step by step, how, why and where the changes need to be made...

### Similar Topics

###### 360 stereo rendering

Started by Dievolve on Mandelbulber

5 Replies
293 Views
November 08, 2019, 05:58:06 PM
by Dievolve
###### Bug-Eyed-Monsters Surf--"Starshine Submarine"--3D Fractal Animation Music Video

Started by Paigan0 on Fractal movie gallery

0 Replies
179 Views
September 12, 2018, 12:38:01 PM
by Paigan0
###### Cross Complex

Started by Dinkydau on Fractal Image Gallery

0 Replies
266 Views
October 22, 2017, 11:31:41 PM
by Dinkydau
###### Tutorial French New Version Mandelbulber GPU version 2.14

Started by meletou on Mandelbulb Maniacs

3 Replies
602 Views
June 27, 2020, 02:42:29 AM
by 1Maniac
###### distorted menger cross kifs

Started by mclarekin on Fractal Image Gallery

0 Replies
159 Views
July 12, 2018, 09:20:54 AM
by mclarekin