Jump to content
  • Advertisement
Sign in to follow this  
benchparkgreen

Stereo Rendering With Two Viewports

This topic is 5129 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How is this possible? ive had a look about on the net, does opengl have left and right buffers or something? do i use those? does anyone no of any executable examples? cheers

Share this post


Link to post
Share on other sites
Advertisement
I added support for that in a later patch to my nehe creative entry, but it's closed source.

It's pretty simple to do really.
Either a)
create two windows, one on each monitor
or b)
create an extra wide window that spans both monitors (say, 1280x480 if each mon is 640x480).

With two viewports, or two seperate windows, just render the scene to each, but with a slight bias to the camera position either left or right.
Getting the bias distance right is probably one of the hardest things, as it's not really something you could measure, depends on the screen it's being projected to or the head set your using, etc.

Share this post


Link to post
Share on other sites
I forgot to mention,
using the left/right buffers requires special hardware, for example a quadro or firegl card.

Share this post


Link to post
Share on other sites
Quote:
forgot to mention,
using the left/right buffers requires special hardware, for example a quadro or firegl card.


Actually, it is very easy. If you want to put 3D stereo in your games, make sure you download and install the latest nvidia Stereo drivers for your gfx card. I am positive that ATI has an equivilant as well. On my geforce 4MX, these drivers not only make it automatic to "stereofy" standard opengl 3D calls, so that you won't have to put any extra code to see in 3D (anaglyph or shutter LCD), but they also allow you to access openGL's standard stereo buffers through a call to glDrawBuffer(GL_BACK_LEFT) or glDrawBuffer(GL_BACK_RIGHT).

Be careful, because accessing the buffers like that only applies for bitmap rasterization options like glDrawPixels(), (if you want to say write a stereo 3D picture or movie viewer). If you don't have a need to directly write stereo data to the framebuffer, but instead just want to see one of your OpenGL projects in 3D, just stick with the code that you have right now, and activate the stereo driver. its a snap.

For best results, check out NVIDIA stereo programming
and also glimage.c

good luck!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!