public void UpdateAutoParamsNoLights( AutoParamDataSource source )
{
// return if no constants
if ( !this.HasAutoConstantType )
{
return;
}
PassIterationNumberIndex = int.MaxValue;
// loop through and update all constants based on their type
for ( int i = 0; i < autoConstantList.Count; i++ )
{
AutoConstantEntry entry = autoConstantList[ i ];
Matrix4[] matrices = null;
int numMatrices = 0;
int index = 0;
switch ( entry.Type )
{
case AutoConstantType.WorldMatrix:
SetConstant( entry.PhysicalIndex, source.WorldMatrix );
break;
case AutoConstantType.WorldMatrixArray:
SetConstant( entry.PhysicalIndex, source.WorldMatrixArray, source.WorldMatrixCount );
break;
case AutoConstantType.WorldMatrixArray3x4:
matrices = source.WorldMatrixArray;
numMatrices = source.WorldMatrixCount;
index = entry.PhysicalIndex;
for ( int j = 0; j < numMatrices; j++ )
{
Matrix4 m = matrices[ j ];
SetConstant( index++, m.m00, m.m01, m.m02, m.m03 );
SetConstant( index++, m.m10, m.m11, m.m12, m.m13 );
SetConstant( index++, m.m20, m.m21, m.m22, m.m23 );
}
break;
case AutoConstantType.ViewMatrix:
SetConstant( entry.PhysicalIndex, source.ViewMatrix );
break;
case AutoConstantType.ProjectionMatrix:
SetConstant( entry.PhysicalIndex, source.ProjectionMatrix );
break;
case AutoConstantType.ViewProjMatrix:
SetConstant( entry.PhysicalIndex, source.ViewProjectionMatrix );
break;
case AutoConstantType.WorldViewMatrix:
SetConstant( entry.PhysicalIndex, source.WorldViewMatrix );
break;
case AutoConstantType.WorldViewProjMatrix:
SetConstant( entry.PhysicalIndex, source.WorldViewProjMatrix );
break;
case AutoConstantType.InverseWorldMatrix:
SetConstant( entry.PhysicalIndex, source.InverseWorldMatrix );
break;
case AutoConstantType.InverseViewMatrix:
SetConstant( entry.PhysicalIndex, source.InverseViewMatrix );
break;
case AutoConstantType.InverseTransposeViewMatrix:
SetConstant( entry.PhysicalIndex, source.InverseTransposeViewMatrix );
break;
case AutoConstantType.InverseWorldViewMatrix:
SetConstant( entry.PhysicalIndex, source.InverseWorldViewMatrix );
break;
case AutoConstantType.InverseTransposeWorldViewMatrix:
SetConstant( entry.PhysicalIndex, source.InverseTransposeWorldViewMatrix );
break;
case AutoConstantType.AmbientLightColor:
SetConstant( entry.PhysicalIndex, source.AmbientLight );
break;
case AutoConstantType.CameraPositionObjectSpace:
SetConstant( entry.PhysicalIndex, source.CameraPositionObjectSpace );
break;
case AutoConstantType.CameraPosition:
SetConstant( entry.PhysicalIndex, source.CameraPosition );
break;
case AutoConstantType.TextureViewProjMatrix:
SetConstant( entry.PhysicalIndex, source.TextureViewProjectionMatrix );
break;
case AutoConstantType.Custom:
case AutoConstantType.AnimationParametric:
source.Renderable.UpdateCustomGpuParameter( entry, this );
break;
case AutoConstantType.FogParams:
SetConstant( entry.PhysicalIndex, source.FogParams );
break;
case AutoConstantType.ViewDirection:
SetConstant( entry.PhysicalIndex, source.ViewDirection );
break;
case AutoConstantType.ViewSideVector:
SetConstant( entry.PhysicalIndex, source.ViewSideVector );
break;
case AutoConstantType.ViewUpVector:
SetConstant( entry.PhysicalIndex, source.ViewUpVector );
break;
case AutoConstantType.NearClipDistance:
SetConstant( entry.PhysicalIndex, source.NearClipDistance, 0f, 0f, 0f );
break;
case AutoConstantType.FarClipDistance:
SetConstant( entry.PhysicalIndex, source.FarClipDistance, 0f, 0f, 0f );
break;
case AutoConstantType.MVShadowTechnique:
SetConstant( entry.PhysicalIndex, source.MVShadowTechnique );
break;
case AutoConstantType.Time:
SetConstant( entry.PhysicalIndex, source.Time * entry.FData, 0f, 0f, 0f );
break;
case AutoConstantType.Time_0_X:
SetConstant( entry.PhysicalIndex, source.Time % entry.FData, 0f, 0f, 0f );
break;
case AutoConstantType.SinTime_0_X:
SetConstant( entry.PhysicalIndex, Utility.Sin( source.Time % entry.FData ), 0f, 0f, 0f );
break;
case AutoConstantType.Time_0_1:
SetConstant( entry.PhysicalIndex, (float)( source.Time % 1 ), 0f, 0f, 0f );
break;
case AutoConstantType.RenderTargetFlipping:
SetIntConstant( entry.PhysicalIndex, source.RenderTarget.RequiresTextureFlipping ? -1 : 1 );
break;
case AutoConstantType.PassNumber:
SetIntConstant( entry.PhysicalIndex, source.PassNumber );
break;
case AutoConstantType.PassIterationNumber:
SetConstant(entry.PhysicalIndex, 0.0f);
PassIterationNumberIndex = entry.PhysicalIndex;
break;
}
}
}