dark_sylinc wrote:Mmm... interesting problem.
Does the problem get fixed if you modify it to use vp->getActualWidth() and getActualHeight()? Or it still breaks because the right eye shader needs to consider left and top?
Yes and no! First off you dont have access to the VP so I just multiple the width by 0.5 for my tests.
- for Forward3D it seems to fix the issues (although the example I put together still seems to have issues, but works fine in my real app

!)
- for ForwardClustered it does not. However if I also ensure the camera FoV, aspectRatio & frustrm offset are sensible AND ensure ForwardClustered uses frustrum offset, the left viewport works and the right hand viewport does not. I assumed this was down to some assumptions about gl_fragCoord in the shaders..??
The big issue with VR frustrums are that they are asymmetric, creating mathematical headaches everywhere!
dark_sylinc wrote:
Interesting. It sounds like adding:
CODE: SELECT ALL
camera->setCustomProjectionMatrix( mCurrentCamera->isCustomProjectionMatrixEnabled(),
mCurrentCamera->getProjectionMatrix() );
When we clone the FOVs and other settings should fix it
This might work for Forward3D but ForwardClustered seems to create a number of its own frustums based on slice near & far distances. As a result, at least the current way its written you cant do this. I dont understand the maths enough to know how it might be changed to work with custom frustrums.
dark_sylinc wrote:plus you need to modify ForwardPlusBase::getCachedGridFor so that it considers comparing projections matrices; otherwise Ogre will attempt to reuse cached results when it shouldn't (because the custom projection matrix is different / doesn't use custom proj. matrix)
I shall go and check that now, sounds like something I may have overlooked
