I finally got round to properly working on a modified version of
@Z22's twenty layer 3D shader. A zip file of a directory containing it and a set of basic scenes using it can be downloaded using the link
http://www.theemusnest.eu/scenes/Zips/=%20Z22+TE%20=%203D.zipThis version uses the same algorithm as Z22's shader but
a) I have optimised the use of ifs which are inefficient on GPUs because they prevent evaluating things in parallel.
b) I have generaly arranged things to maximise the available parallism
c) It does everything in one shader invokation rather than separately for the left and right eyes' images.
d) It is controllable via uniform: clauses in the scene file.
e) It is not limited to purely horizontal displacements of the images or slices.
f) It contains some debugging code that when enabled shows the contributions of individual slices.
Because of the optimisation this version of the shader runs smoothly on my system whereas the version it was based on slightly overloaded the GPU which caused a small slowdown.
The scenes just show a single clip with different scenes being provided for Cage, Glass, Pole, Standing, Table and Top clips. In each case there is a scene for cross eyed viewing and one for SBS capable equipment. I do not have an SBS system so I may have made a mistake there.
I have seen two problems.
Firstly the way I generate both images in a single shader means that if the girl moves too far left or right such that the two images overlap results in the intruding part of the image being dropped even if it only intrudes on a transparent background area. I think that I can improve on this without doubling the work done by the shader.
Secondly, if the overall shift beyween the top and bottom layer is larger than the default used in the shader then strange things happen - as you will see if you increase it to 30 or more (which you can do using a Max_Parallax uniform in the scene file - see comments in the shader for the exact syntax to use). I do not yet understand why this happens,
It is heavily commented both to describe how to use the various control parameters and how the shader itself works.