bug in Camera::setFarClipDistance

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
Post Reply
cyrfer
Orc
Posts: 424
Joined: Wed Aug 01, 2007 8:13 pm
Location: Venice, CA, USA
x 7

bug in Camera::setFarClipDistance

Post by cyrfer »

Hi,
I've checked both the GL and Dx9 render systems. My settings for setFarClipDistance are not being honored. However, setNearClipDistance is working fine. I have personally tested this behavior with the latest SVN, and a coworker is seeing this with one of the 1.6.X releases. Will someone confirm that this is a bug? Many thanks!
User avatar
Fish
Greenskin
Posts: 131
Joined: Fri Aug 22, 2008 6:12 pm

Re: bug in Camera::setFarClipDistance

Post by Fish »

It's working fine here (trunk and 1.6.3). Are you sure the far clip distance is not being reset somewhere else in your application?

-Fish
User avatar
mkultra333
Gold Sponsor
Gold Sponsor
Posts: 1894
Joined: Sun Mar 08, 2009 5:25 am
x 114

Re: bug in Camera::setFarClipDistance

Post by mkultra333 »

I don't know if this is relevant, but I had a problem at one stage with my FOVy settings not working. I was using the camera in a number of roles, moving it around with various funtions and changing all kinds of settings per frame. When it came to the final views, the FOVy just wouldn't alter.

When I changed the various functions to use a copy of the camera instead of the original camera, it started working fine, the altered FOVy settings took effect again.
"In theory there is no difference between practice and theory. In practice, there is." - Psychology Textbook.
cyrfer
Orc
Posts: 424
Joined: Wed Aug 01, 2007 8:13 pm
Location: Venice, CA, USA
x 7

Re: bug in Camera::setFarClipDistance

Post by cyrfer »

Ogre is a great toolkit. I wish my comments to sound constructive, to help improve it. I recognize that I might sound rushed- I am. :) Here's the situation:
If I use stencil shadows, then I can't control the far field of view. I found an offensive line of code in the Ogre source.

OgreSceneManager.cpp

Code: Select all

    if (isShadowTechniqueStencilBased() && 
        camera->getProjectionType() == PT_PERSPECTIVE &&
        camera->getFarClipDistance() != 0 && 
        mDestRenderSystem->getCapabilities()->hasCapability(RSC_INFINITE_FAR_PLANE) && 
        mShadowUseInfiniteFarPlane)
    {
        // infinite far distance
        camera->setFarClipDistance(0);
    }
I assume the camera instance is being used to hold state variables that the renderer needs to control. However, I would vote that the camera instance's state should not be changed because client code should set it up and it is not expected for those values to be changed. I'm not using stencil shadows anymore, but if Ogre wants to offer them as a feature, I'd recommend not changing the values the client code provides.
Post Reply