1 / 17

Stereoscopic : How to implement it?

Stereoscopic : How to implement it?. Namgyu Kim ( ngkim@postech.ac.kr ) VR Labs. CSE POSTECH. 발표 순서. Stereoscopic methods’ classification Implementation Maverik OpenGL Direct3D Maverik Programming tip Transparent texture in Maverik No maverik’s logo animation start.

magda
Download Presentation

Stereoscopic : How to implement it?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Stereoscopic :How to implement it? Namgyu Kim (ngkim@postech.ac.kr) VR Labs. CSE POSTECH

  2. 발표 순서 • Stereoscopic methods’ classification • Implementation • Maverik • OpenGL • Direct3D • Maverik Programming tip • Transparent texture in Maverik • No maverik’s logo animation start

  3. Classification (1) • Time-Multiplexed • Frame sequential, Page flipping • Field sequential, Interlaced Active Stereo Passive Stereo

  4. Classification (2) • Time Parallel • Anaglyph • Parallax Barrier • Lenticular Sheet • Side-by-Side Slits L R lens L R

  5. Implementation • Possible hardware • Time multiplexed -> Active stereo • Crystal Eyes, VR joy • Time parallel -> Side-by-side, Anaglyph • HMDs (VR4, Glasstron) • Handmade ^^;

  6. Maverik (1) • Time parallel -> Side-by-side • In twin-view graphic card platform • HMDs Eg. stereo.c #include "maverik.h“ #include <stdio.h> int main(int argc, char *argv[]) { MAV_box box; MAV_object *obj; MAV_SMS *sms; mav_opt_stereo= MAV_STEREO_TWO_WINS; mav_initialise(&argc, argv); ….. }

  7. Maverik (2) • Time multiplexed -> Active stereo • Quad-buffer: Front-left, Back-left, Front-right, Back-right • Graphics card supports: FireGL series Eg. stereo.c #include "maverik.h“ #include <stdio.h> int main(int argc, char *argv[]) { MAV_box box; MAV_object *obj; MAV_SMS *sms; mav_opt_stereo= MAV_STEREO_QUAD_BUFFERS; mav_initialise(&argc, argv); … }

  8. Maverik (3) • Stereo configuration options: Global vars • Offset void mav_windowViewModifierSet(MAV_window *w, MAV_viewModifierParams *vmp, MAV_viewModifierFn fn); typedef struct { float offset; float angle; void *userdef; } MAV_viewModifierParams; mav_stp_default.offset= 0.5; mav_windowViewModifierSet(mav_win_left, &mav_stp_default, mav_eyeLeft); mav_windowViewModifierSet(mav_win_right, &mav_stp_default, mav_eyeRight);

  9. Maverik (4) • int mav_opt_right_x • int mav_opt_right_y • int mav_opt_right_width • int mav_opt_right_height • Maverik Programming Manual 참조

  10. OpenGL (1) • Time multiplexed -> Active stereo • Back buffer is divided for L/R image • At first, set OpenGL state to stereo mode Win32 & OpenGL Glut PIXELFORMATDESCRIPTOR pfd; pfd.nSize = sizeof(PIXELFORMATDESCRIPTOR); pfd.nVersion = 1; pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_STEREO; pfd… … choosePixelFormat(…) selectPixelFormat(…) glutInit(&argc, argv); glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGB | GLUT_STEREO); glutCreateWindow("rect");

  11. OpenGL (2) • Select left buf -> render left img ->select right buf -> render right img ->swap to front buffer glDrawBuffer(GL_BACK); glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Draw the image for the left eye. glDrawBuffer(GL_BACK_LEFT); // Draw Left Scene: Projection & Model View Matrix glClear (GL_DEPTH_BUFFER_BIT); // Select back right buffer to recieve drawing glDrawBuffer(GL_BACK_RIGHT); // Draw Right Scene: Projection & Model View Matrix

  12. OpenGL (3) • Time parallel -> Anaglyph • Draw object in white color • glColorMask(R, G, B, A) glDrawBuffer(GL_BACK); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // Left eye filter (Blue) glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE); glColorMask(GL_FALSE,GL_FALSE,GL_TRUE,GL_TRUE); // Draw object in white color glFlush(); glDrawBuffer(GL_BACK); // Right eye filter (Red) glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE); glColorMask(GL_TRUE,GL_FALSE,GL_FALSE,GL_TRUE); // Draw object in white color glFlush() // Swap Buffers

  13. Direct3D • I’m a novice !! ^^; • Show some examples • Graphics card dependent • Nvidia Geforce series • Nvidia platform SDK : NVSDK5.2 • http://developer.nvidia.com • Other development tool • Winx3D SDK • http://www.win3d.com

  14. Implementation • Possible solutions • Maverik, Side-by-Side, HMDs • Maverik, Active, Crystal Eyes • OpenGL, Side-by-Side, HMDs • OpenGL, Active, Crystal Eyes • Direct3D, Active, VR Joys Easy Difficult

  15. Conclusion • Visit VR Labs. PIRL 438 • You can see/do it

  16. Maverik Programming Tip (1) • Transparent texture • Portable Network Graphics (PNG format) • Add MAV_PNG options in Maverik proj. • Link libpng.lib libz.lib -> Recompile • Add path libpng.dll and libz.dll • How to make transparent texture • Use photoshop… ^.^

  17. Maverik Programming Tip (2) • No maverik’s logo animation start • mav_opt_splash = MAV_FALSE; • Good luck… ^^; … mav_opt_splash = MAV_FALSE; mav_initialise(&argc, argv); …

More Related