So if you're in to VR this can be very interesting for you.
But I've encountered some problems...
first some context. I've downloaded the VRWorks Graphics SDK 2.5, there's a sample on single pass stereo rendering with a pdf. Not sure if I can post the whole code/doc here since you need an account to download... so I'll be posting just the relevant stuffs.
BTW, you can test all this stuffs without any HMD, you just need a recent nvidia card, I have a 1070.
there are two options to do this, one is rendering each eye in to a separate layer of a texture array, but I don't think Ogre supports this... so the second option is to render each eye side by side in the same texture, I am trying this last one.
I am using OpenGL, so to enable the feature you just have to add the extensions to your vertex shader:
(I just added them to a @piece( custom_vs_uniformDeclaration ))
Code: Select all
#extension GL_NV_viewport_array2: require
#extension GL_NV_stereo_view_rendering: require
Code: Select all
@property( !hlms_dual_paraboloid_mapping )
gl_Position = worldPos * passBuf.viewProj + vec4(0.2, 0, 0, 0);
gl_SecondaryPositionNV = worldPos * passBuf.viewProj - vec4(0.2, 0, 0, 0);
gl_ViewportMask[0] = 1;
gl_SecondaryViewportMaskNV[0] = 2;
@end
so, the instance part seems to be working, very easy!
but they are in the same "space", so you need to render each eye in to a different viewport of the texture, this is suppose to be done with this:
Code: Select all
glViewportIndexedf(0, 0, 0, width, height);
glViewportIndexedf(1, width, 0, width, height);
I need help! maybe someone that's also interested in VR want to try to integrate this? seems reeaaally easy, I must be doing something stupid. I can send the relevant files via private message if you don't care to make an nvidia developer account.
Also noticed glViewportIndexedf needs opengl 4.1, and ogre says it uses 3.3, but I asked dark_sylinc and says that opengl works that way and it should work anyways, but just in case I forced version 430 in the file CrossPlatformSettings_piece_all.glsl of the hlms shader templates.
Cheers!!