ForwardClustered and Camera::setFrustumExtents

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

ForwardClustered and Camera::setFrustumExtents

Post by xrgo »

Hello! I am trying to use ForwardClustered in VR, for that I need to use Camera::setFrustumExtents, and this breaks ForwardClustered (not forward3D :D )

I couldn't find how to fixed it =(

The values I use are this:

Code: Select all

    Ogre::Vector4 eyeFrustumExtents = Ogre::Vector4(-0.964926, 0.715264, -1.11093, 0.889498); //values for left eye
    mMainCamera->setFrustumExtents( eyeFrustumExtents.x, eyeFrustumExtents.y, eyeFrustumExtents.w, eyeFrustumExtents.z, true );

Code: Select all

    int forwardPlusParams[6];

    forwardPlusParams[0] = 4; //width
    forwardPlusParams[1] = 4; //height
    forwardPlusParams[2] = 24; //numSlices
    forwardPlusParams[3] = 20; //lightsPerCell
    forwardPlusParams[4] = 5; //minDistance
    forwardPlusParams[5] = 500; //maxDistance
    mSceneManager->setForwardClustered(true, forwardPlusParams[0], forwardPlusParams[1], forwardPlusParams[2], forwardPlusParams[3], forwardPlusParams[4], forwardPlusParams[5]);
al2950
OGRE Expert User
OGRE Expert User
Posts: 1227
Joined: Thu Dec 11, 2008 7:56 pm
Location: Bristol, UK
x 157

Re: ForwardClustered and Camera::setFrustumExtents

Post by al2950 »

I have fixed these issues, but waiting on pull request to be merged :(. Feel free to to pester dark_sylinc ;).

You can see my changes here.
https://bitbucket.org/sinbad/ogre/pull- ... fixes/diff

It also fixes VR issues when using one texture for both eyes. Ie not full screen viewports.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: ForwardClustered and Camera::setFrustumExtents

Post by dark_sylinc »

@xrgo:
Could you test al2950 changes?
If all is ok, I'll merge the PR.

You can check it out by manually pulling from https://bitbucket.org/al2950/ogre-2.x-updates-fixes
xrgo
OGRE Expert User
OGRE Expert User
Posts: 1148
Joined: Sat Jul 06, 2013 10:59 pm
Location: Chile
x 168

Re: ForwardClustered and Camera::setFrustumExtents

Post by xrgo »

Yes it works!!!!
thank you both!
Post Reply