From Brede Johansen, changed osg_InverseViewMatrix to osg_ViewMatrixInverse to bring

into line with OpenGL shader languague conventions.

From Robert Osfield, changed the SceneView::ActiveUnforms enum to from INVERSE_VIEW_MATRIX_UNIFORM
VIEW_MATRIX_INVERSE_UNIFORM to be convistent with the above change.
This commit is contained in:
Robert Osfield 2005-10-25 09:23:21 +00:00
parent 758ee8ed80
commit 285418d6f8
2 changed files with 4 additions and 4 deletions

View File

@ -129,12 +129,12 @@ class OSGUTIL_EXPORT SceneView : public osg::Referenced, public osg::CullSetting
FRAME_TIME_UNIFORM = 0x2, FRAME_TIME_UNIFORM = 0x2,
DELTA_FRAME_TIME_UNIFORM = 0x4, DELTA_FRAME_TIME_UNIFORM = 0x4,
VIEW_MATRIX_UNIFORM = 0x8, VIEW_MATRIX_UNIFORM = 0x8,
INVERSE_VIEW_MATRIX_UNIFORM = 0x10, VIEW_MATRIX_INVERSE_UNIFORM = 0x10,
DEFAULT_UNIFORMS = FRAME_NUMBER_UNIFORM | DEFAULT_UNIFORMS = FRAME_NUMBER_UNIFORM |
FRAME_TIME_UNIFORM | FRAME_TIME_UNIFORM |
DELTA_FRAME_TIME_UNIFORM | DELTA_FRAME_TIME_UNIFORM |
VIEW_MATRIX_UNIFORM | VIEW_MATRIX_UNIFORM |
INVERSE_VIEW_MATRIX_UNIFORM, VIEW_MATRIX_INVERSE_UNIFORM,
ALL_UNIFORMS = 0xFFFFFFFF ALL_UNIFORMS = 0xFFFFFFFF
}; };

View File

@ -226,9 +226,9 @@ void SceneView::updateUniforms()
uniform->set(_viewMatrix); uniform->set(_viewMatrix);
} }
if (_activeUniforms & INVERSE_VIEW_MATRIX_UNIFORM) if (_activeUniforms & VIEW_MATRIX_INVERSE_UNIFORM)
{ {
osg::Uniform* uniform = _localStateSet->getOrCreateUniform("osg_InverseViewMatrix",osg::Uniform::FLOAT_MAT4); osg::Uniform* uniform = _localStateSet->getOrCreateUniform("osg_ViewMatrixInverse",osg::Uniform::FLOAT_MAT4);
uniform->set(osg::Matrix::inverse(_viewMatrix)); uniform->set(osg::Matrix::inverse(_viewMatrix));
} }