cancel
Showing results for 
Search instead for 
Did you mean: 

pixelsPerDisplayPixels not 1.0 leads to black screen

Anonymous
Not applicable
In my application, if I choose a value less than 1 (such as .5) for pixelsPerDisplayPixels for ovrHmd_GetFovTextureSize(), then my render goes black as soon as the HSW display stops rendering.

Just for clarity, if I use a pixelsPerDisplayPixels of 0.5, everything works great if I leave the HSW display up. I can turn my head, rotate my body, move around, and everything renders fine. However, as soon as ovrHmd_DismissHSWDisplay() gets called, both the preview window and HMD turn black.

This does not occur if I modify the samples to use 0.5, just in my own application. However, there aren't any DirectX9 samples, so I'm not sure if that's relevant.

I've tried doing a massive graphics reduction pass, by turning off all post effects and using a forward rendering scheme instead of deferred rendering, but nothing I've tried has helped.

I'm using:
Direct Mode (don't have Extended Mode working for my app, so I can't tell you if that works or not)
Windows 7 Professional 64-bit
DirectX9 (Actually Direct9Ex if that matters)
GeForce GTX 650 (also happens on GTX 750ti)

Any ideas? Can someone else with a DirectX9 app also test this?
7 REPLIES 7

HunLyxxod
Honored Guest
I tried with my directX9 (not Ex) application and everything works correctly.

That looks like a wrongly configured viewport.
The directX 9 version of the libovr doesn't check if the render target or the viewport are correct before rendering the distortion. Be sure that theses values are correctly set before calling ovrHmd_EndFrame.

Anonymous
Not applicable
"HunLyxxod" wrote:
I tried with my directX9 (not Ex) application and everything works correctly.

Well, that's good to know at least. It means I may be able to find a solution for this.

"HunLyxxod" wrote:
That looks like a wrongly configured viewport.
The directX 9 version of the libovr doesn't check if the render target or the viewport are correct before rendering the distortion. Be sure that theses values are correctly set before calling ovrHmd_EndFrame.

I can't really see how this would be a viewport problem. The render target and viewport set before ovrHmd_EndFrame are the final backbuffer (1920x1080) regardless of the size of the eye targets.

Additionally, if I were setting those wrong, I would expect the following, which do not occur:
1) Not working regardless of the eye target size. Instead, it's working with the eye target size for pixelsPerDisplayPixels=1.0, but not for any other size.
2) Not working at all. Instead, it works while the HSW display is active, and then stops working afterward.
3) If the viewport were wrong, I would expect it to show a segment of the screen, but it's not, the entire screen is black.

That said, I have tried what you suggested anyway. I have confirmed that explicitly setting the viewport does not resolve my issue.

Any other ideas?

HunLyxxod
Honored Guest
Have you tried using the debug runtime of d3d9 (via dxcpl)?

You probably have a wrong call somewhere. I supposed that was a SetViewport call cause that should be the only thing that depends on the texture size but it looks like I was wrong.

If the d3d9 debug runtime doesn't break on any error, you should use PIX or a similar application. Do a single-frame capture and check if the rendering in the eye texture fail or if it's the distortion rendering that doesn't work.

Anonymous
Not applicable
Thanks for the idea to use debug runtime/PIX. I'm currently working on other tasks, but I'll be able to try this out sometime this week. I'll update this thread once I've done so.

Anonymous
Not applicable
I attempted to take a PIX frame capture with Oculus enabled, and the below image is all I got... seems like PIX doesn't work well with Oculus. Could I be doing something wrong?

pix.png

If I don't enable Oculus, I get the correct frame data.

Anonymous
Not applicable
I didn't figure out how to get Pix working, but I did resolve my black screen issue!

The problem was that I had a DepthStencil surface bound which was a different size than the color surface. The HSW display code turns off depth read/write, which is not restored at the end of the function. Thus, with the HSW displayed, the depth/stencil was turned off and the distortion could render to the backbuffer. However, with HSW off, it was no longer disabling the depth read/write, so the distortion was failing.

My solution was to set the current DepthStencil target to NULL before calling ovrHmd_EndFrame().

mwlesthmr
Protege

I’m going back to the house to go to the gym with the girls 

Still need help?

Did this answer your question? If it didn’t, use our search to find other topics or create your own and other members of the community will help out.

If you need an agent to help with your Meta device, please contact our store support team here.

Having trouble with a Facebook or Instagram account? The best place to go for help with those accounts is the Facebook Help Center or the Instagram Help Center. This community can't help with those accounts.

Check out some popular posts here:

Getting Help from the Meta Quest Community

Tips and Tricks: Charging your Meta Quest Headset

Tips and Tricks: Help with Pairing your Meta Quest

Trouble With Facebook/Instagram Accounts?