2 fatal CVS bugs + patches for them

hellcatv

31-01-2008 16:38:21

These bugs took me way too long to track down, so I'd appreciate it if you applied them to CVS to prevent others from having to duplicate my efforts

The first bug only happens under certain compilers...but when PagingLandScapeOctreeCamera casts a OctreeSceneManager to PagingLandScapeOctreeSceneManager on line 120 of OgrePagingLandScapeOctreeCamera.cpp and then uses a member of the wrong class, the whole program crashes. I believe OctreeSceneManager layout changed in Ogre CVS (as compared with the 1-4 branch) either way it's messy code...I've worked around it by making PagingLandScapeCamera inherit directly from OctreeCamera instead of the other

http://graphics.stanford.edu/~danielrh/ ... ngBug.diff

There might be better solutions

Second bug:
in OpenGL shaders are no longer allowed to be placed on terrain.
This is because OgrePagingLandScapeOptions.cpp has been modified to look for DirectX specific support!
bool bIsVSsupported = caps->isShaderProfileSupported("vs_1_1");
is always false
likewise
hasFragmentShader2 = hasFragmentShader && caps->isShaderProfileSupported("vs_2_0");
is also always false--and is buggy to begin with...vs_2_0 is *not* the same as fragment shader 2.0
my recommendations are to change the lines to
bool bIsVSsupported = true;
and eliminating the second check as well.
Ogre's shader fallback mechanisms should take care of the rest...

hellcatv

31-01-2008 16:44:45

After reading this thread:
http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=5619
it seems that my patch should only change the camera to inherit from the OctreeCamera in the event that
_PLSM_OCTREE
is *not* defined

so yes--I'd recommend changing the inheritance chain depending on the #ifdef...

are there plans to eliminate PLSM_OCTREE altogether, or what's the impetus for having 2 copies of the same code (which makes building on the mac incredibly difficult since symbols from one "bundle" can't reference symbols from another "bundle"