Problems with d3d9 and NVAPI

213 Views Asked by At

I'm writing a stereoscopic player. All parts(decoding, rendering) except Stereoscopic mode are done. But with 3D I have some troubles. Im using NVAPI and D3D9. Render loop looks like that:

render()
{
    begin_scene();
    set_left_eye();
    stretch_left_side_of_surface();
    set_right_eye();
    stretch_right_side_of_surface();
    end_scene();
    present();
}

It's just like described in whitepapers. But there is no stereo effect in result. Just right eye's picture. But glasses are working(so, they are controlled by the app). What am I doing wrong? Can someone explain me how to render stereo images using d3d9 and nvapi?

1

There are 1 best solutions below

0
On
  1. I noticed that each eye should be rendered in a different scene (i.e. wrapped with begin_scene() and end_scene()).

  2. I'm not sure if it is necessary, but I think it is better to set active eye before each begin_scene() (and not during the scene).

As follows:

render()
{
    set_left_eye();
    begin_scene();
    stretch_left_side_of_surface();
    end_scene();

    set_right_eye();
    begin_scene();
    stretch_right_side_of_surface();
    end_scene();

    present();
}