Re: red and blue stereo in Performer

New Message Reply Date view Thread view Subject view Author view

From: Angus Dorbie (dorbie++at++sgi.com)
Date: 02/12/2001 10:25:50


This is real simple;

Simply create two overlapping channels (left and right eyes) and use
glColorMask to draw to specific color planes for each channel.

Your choice of colors will depend obviously on the glasses you use.

Cheers,Angus.

Daniel F Johnston wrote:
>
> OK! I admit it! I failed ... and it is time to ask the good folks on the
> Performer
> discussion group.
>
> I have a left/right channel pair - with associated offsets - and when I
> have
> a stereo visual, then I get good and proper active stero display. Now
> I want
> this Performer application to work on any system - even those without
> an active stereo visual. So, I thought I would add in the option to
> switch
> to cheap, color-incorrect, red-blue stereo. This should only take a
> couple of days right!
>
> Wrong! It has now been a man-week or more and all I've learned is
> that even with recent Performer training and three years of using
> the API, I still don't know enough to do this right. Especially, I still
>
> don't know enough OpenGL.
>
> What I have been working on:
> - ONYXs, Octane, and O2 computers with active stereo emmitters and
> glasses
> - Performer code to view general (Performer/data) models
> - left and right pfChannels, with separate draw callbacks for each
> channel
>
> What I have tried;
> 1 There is a pure OpenGL example in the developer's club library.
> I tried to add that to my draw callbacks, selecting the GL_BACK
> buffer instead of GL_BACL_LEFT (or RIGHT). It almost worked
> in that I got monochrome red or blue images, but I could not merge
> them back together into a single stereo image. It took a number
> of pfDraw calls and glCopyPixel calls, so the display was very slow.
> Question? Is there some way to tap into the pfDraw function so
> that we have the pixels in the frame buffer just before they are
> to be moved to the display buffer? Then I could just modify their
> colours and the code should work.
>
> 2. I looked at glBlendFunc (and yes I know that Performer 2.4 has
> pf versions of these now) but when I tried blending the results of
> left (with no pfDraw) and right (with a blend and then a single
> pfDraw) then all I could see was a black background and the
> front-most part of my object. Trying different options for
> source and destination didn't help ME much - but then I really
> didn't understand the man pages of the description in the
> OpenGL Programming Guide book.
>
> 3. I defined pfColorTables - one mostly red, and the other mostly
> blue. Then I enabled one of these in the draw callbacks just before
> the pfDraw. The left scene objects were drawn in one color, then
> the right drawn in another. This was still using a stereo visual, but
> I could fix that later right? Using the model torus.pfs it looked
> OK ... but switching to wireframe mode had no effect (but did in
> active stereo and mono mode). Then I tried other models:
> chamber.0.lsa displayed in mostly black but with some multi-colored
> polygons, esprit.flt did not change color at all. So... I guess I
> really don't understand this either.
> ++++++++++++++++++ code snippet +++++++++++++++++
> /* handle draw style */
> pfuPreDrawStyle( set->shared->drawStyle,
> set->shared->scribeColor);
>
> if( set->shared->viewMode == AP_REDBLUE_VIEW_MODE )
> {
> pfEnable(PFEN_COLORTABLE);
> if( set->shared->secretSwapMode == PF_OFF )
> pfApplyCtab(redColor);
> else
> pfApplyCtab(blueColor);
> }
> else
> pfDisable(PFEN_COLORTABLE);
>
> pfDraw();
>
> pfuPostDrawStyle( set->shared->drawStyle );
> ---------------------------------------------
>
> 4. I have flown through Performer Town in red/blue stereo by
> calling glColorMask before the pfDraw. Because it is a
> mask and not a 'redraw in mono', only the red objects (for
> example) are drawn one one channel, and only blue on the
> second. A lot of green geometry os not drawn at all. And,
> you still need to be in an active stereo visual - so why bother.
>
> Anyway... before my head gets any worse from all this beating
> it against the wall - can anyone show me some sample code
> or supply a good hint about how to approach this in Performer?
>
> Thanks for any help.
>
> --
> ___|__ |
> / | \ ||\ Daniel (Dan) Johnston
> /___|___\ || \ Dan.Johnston++at++nrc.ca
> _____|____ || \ National Research Council of Canada, London, ON
> | | | || \ Integrated Manufacturing Technologies Institute
> \___| | | ||____\ Tel: (519) 430-7081 Fax: (519) 430-7090
> \_o_\___|____|_|______\_ Inst: http://www.nrc.ca/imti
> \ o / These opinions are my own! Not those of NRC.
> \________________/ Virtual Reality:
> http://www.nrc.ca/imti/vetc/home.html
> More Tall Ships - Fewer Computers!
>
> -----------------------------------------------------------------------
> List Archives, FAQ, FTP: http://www.sgi.com/software/performer/
> Open Development Project: http://oss.sgi.com/projects/performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com

-- 
For Performer+OpenGL tutorials http://www.dorbie.com/

"In the middle of difficulty lies opportunity." --Albert Einstein


New Message Reply Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Feb 12 2001 - 10:26:24 PST

This message has been cleansed for anti-spam protection. Replace '++at++' in any mail addresses with the '@' symbol.