[X3D-Public] implementing stereo display

yiqi m17design at hotmail.com
Wed Sep 28 02:33:11 PDT 2011


You can use custom shader if your application support shader and clip-plane.
I rember introduce in some “PS3 stereo” or “PS3 S3D” document.

Shader can split screen into up-down by a clip-plane and use shader to draw scene twice.  
see below:

... setup clip-plane ...

...  vs shader ...

        Out.Position = mul(In.Position, WorldViewProj) ;
        Out.Position.y *=  0.5 ;
        float2 interaxialOffset;     
        float interaxialAdjust ;
        interaxialAdjust = max (interaxial , viewZRange.x );
        interaxialOffset = currentpass ? float2 (interaxialAdjust ,Out.Position.w)* 0.5  :  float2 (-interaxialAdjust  ,-Out.Position.w) * 0.5;
        Out.Position.xy  += interaxialOffset ;

... compile ... 

technique main { 

pass Pass_R    {    
   VertexShader = compile vs_3_0 vs_main();
   PixelShader = compile ps_3_0 ps_single();      
   AlphaTestEnable = FALSE; 
   AlphaBlendEnable = FALSE; 
   ZEnable = TRUE ;
   ZFunc = LESSEQUAL; 
   ZWriteEnable = TRUE;    
   ClipPlaneEnable =2;
   }

pass Pass_L    {    
   VertexShader = compile vs_3_0 vs_main();
   PixelShader = compile ps_3_0 ps_single();      
   AlphaTestEnable = FALSE; 
   AlphaBlendEnable = FALSE; 
   ZEnable = TRUE ;
   ZFunc = LESSEQUAL; 
   ZWriteEnable = TRUE;    
   ClipPlaneEnable =1;
   }

}

we use these code in our demo http://www.youtube.com/watch?v=8LD5fgrjdjM
with custom shader, even post effects work well.

Also, you can try BS Contact Stereo. It’s good also but you need buy it for remove flying Logo.

----------------------------------------------
skype:m17.meng
http://17de.com/x3d/index.en.html

From: Charles P. Lamb 
Sent: Wednesday, September 14, 2011 11:17 AM
To: X3D Graphics public mailing list 
Subject: [X3D-Public] implementing stereo display

Lately, I've been thinking about how to best produce stereo imagery using X3D.  I've noticed that FreeWRL does it all in the browser.  I'm wondering if a better approach is to have two active viewpoint nodes--one mapped to the browser left image display and one to the browser right image display.  This will allow for more flexibility.

The problem is that at least one of the parameters belongs in both the browser side and in the scene side.  Although the lines of sight are almost always set as parallel I can imagine a user wanting to experiment with non-parallel lines of sight.  I can see the inter-aperture distance changed within the scene as a creative decision.  However, the intra-aperture distance will also need to be changed based on the size of the display and the distance to the viewer.

Anyone have any other thoughts?

Charles P. Lamb


--------------------------------------------------------------------------------
_______________________________________________
X3D-Public mailing list
X3D-Public at web3d.org
http://web3d.org/mailman/listinfo/x3d-public_web3d.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20110928/0ca8b403/attachment.html>


More information about the X3D-Public mailing list