Stereo/Warp Shader Not Loading

The place for all discussion of the Oculus Rift compatible open source 3D drivers.
Post Reply
Cetra
One Eyed Hopeful
Posts: 2
Joined: Wed Aug 15, 2012 10:04 pm

Stereo/Warp Shader Not Loading

Post by Cetra »

Hey guys,

I've been playing around a bit with the vireio driver trying to get Natural Selection 2 to work correctly. Input/tracking is working OK, but it appears as though it's not loading the shader and applying stereo vision/warping.

I've had a look at some of the proxy classes for other games, and they all appear to do mostly the same thing, initialise the StereoView class and call the Draw() function after hijacking Present and EndScene DirectX functions. This doesn't appear to work. It's as if there's another process intercepting it

Strangely though, the tracking is working fine. I basically used the SetVertexShaderConstantF function from the source engine proxy and this adjusts the view in game correctly.

Also, I had to copy over the dll files to the game's directory to get it to detect at all, so I'm not sure if that may be the cause of it.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: Stereo/Warp Shader Not Loading

Post by cybereality »

Honestly not sure about this. In SBS or Rift mode you should at least see the split image (even without stereo). The tracking is just mouse emulation (mostly) so this could work even if the stereo doesn't. I did have trouble with some games, so it's not like every game is just going to work off-the-bat. Sorry I can't be of more help.
Cetra
One Eyed Hopeful
Posts: 2
Joined: Wed Aug 15, 2012 10:04 pm

Re: Stereo/Warp Shader Not Loading

Post by Cetra »

Yeah that's what I figured, I spent a good day trundling through code to triple check to make sure that it's working OK and that that part of Vireio wasn't different per game. The only difference I could see was that for the Source engine proxy, it delays initialising the StereoView class by a few frames to prevent crashing. My current guess is a separate process actually owns the final scene. I will do some more experimentation and see if I can work it out. The game does allow you to "mod" existing shaders, but I couldn't find an obvious way of loading in new ones to the entire scene.

When I say the tracking works, I mean that I can change the roll/orientation of the scene with the SetVertexShaderConstantF function. As far as I know, the mouse emulation only affects pitch and yaw as per a standard FPS. It seems to be matching the right projection matrix and updating it correctly.
ChrisJD
Cross Eyed!
Posts: 176
Joined: Mon Feb 25, 2013 10:29 pm
Location: NZ

Re: Stereo/Warp Shader Not Loading

Post by ChrisJD »

I have a theory for this that I came up with when I was wondering why there was no effect at all in Deus EX HR in Dx9 mode.

A lot of DirectX objects have GetDevice methods that can return the device to the application. If the application gets a reference to a device this way then the application has got a reference to the actual device (not the proxy that was returned by CreateDevice).

So any calls the application makes on that pointer to the actual device don't go through the proxy and therefore the Perception code isn't run. Some calls going through the proxy and some not would explain why you have some stuff working but other stuff isn't.


I verified this the other day when I was testing the RenderToSurface interface from D3DX that is created with D3DXCreateRenderToSurface. It must use a returned device reference to call BeginScene and EndScene because none of the trace messages I had inserted were printing.

I think a lot of the D3DX methods can cause issues like this. Although any game that gets a device reference through anything other than CreateDevice is likely to have problems.


On the plus side, I'm wrapping all the Direct3D interfaces and overriding the GetDevice behaviour to return the proxy as part of the work I'm doing to get simultaneous rendering working. So once I have that working it should help with games that suffer due to this issue.

The downside is there is no quick fix.
Post Reply

Return to “Development / General Discussion”