Hi all,
Inside the attached .zip file: SBSStereoRenderMethod.as, and TopBottomStereoRenderMethod.as
—
Away3D 4.1Alpha has a new stereoscopic rendering framework. The problem is it doesn’t support side-by-side (SBS) stereoscopic rendering. As near as I can tell, SBS is one of the most common rendering methods, used by 3D TVs, Head-Mounted-Displays (HMDs), etc. And in particular, for /my/ application, I need SBS-rendering.
In the past, I’ve been using 2 Views, one for each eye. This still works on the desktop, but it killed my mobile app. In contrast, Away3D-4.1’s stereoscopic support works on my mobile devices. So, I spent the last two days implementing an SBSStereoRenderMethod class for Away3D-4.1, then tweaked it a bit to create TopBottomStereoRenderMethod.
Please understand that this is the first time that I’ve worked with shaders. I know of at least one bug in my code - there’s some dead space between the images that isn’t supposed to be there. There may be other bugs. I make no guarantees about the quality or the usability of the attached code.
I attempted to heavily document my AGAL code. It took me forever to work backwards from the assembly-langauge AGAL code, and I’m hoping my documentation can help others not only to understand my code, but also hopefully to gain a better understanding of the fragment-shader code in AnaglyphStereoRenderMethod and InterleavedStereoRenderMethod. But again: I make no guarantees.
(Also: I have a commented version of the fragment shader code in AnaglyphStereoRenderMethod.as, if anyone’s interested. The only difference is the comments.)
If anyone knows what’s up with the bar in the middle with these render methods, I would love to hear it. Better yet, if you can offer a patch, I would greatly appreciate it.
Licensing: I consider my own work on this to be public-domain. That said, this is based on code from Away3D-4.x, so the full files are under Away3D’s license (Apache-2.0).
All the best,
Bibek