Renderer simplification: Remove fixed-function shadowing. Remove now-unused diffuse-only model lighting mode.

This was SVN commit r9187.
This commit is contained in:
Ykkrosh
2011-04-06 22:07:13 +00:00
parent 8753f881ee
commit 7339a346e3
13 changed files with 96 additions and 761 deletions
+7 -22
View File
@@ -106,8 +106,7 @@ void ModelRenderer::BuildPositionAndNormals(
void ModelRenderer::BuildColor4ub(
CModel* model,
const VertexArrayIterator<CVector3D>& Normal,
const VertexArrayIterator<SColor4ub>& Color,
bool onlyDiffuse)
const VertexArrayIterator<SColor4ub>& Color)
{
PROFILE( "lighting vertices" );
@@ -117,27 +116,13 @@ void ModelRenderer::BuildColor4ub(
CColor shadingColor = model->GetShadingColor();
RGBColor tempcolor;
if (onlyDiffuse)
for (size_t j=0; j<numVertices; j++)
{
for (size_t j=0; j<numVertices; j++)
{
lightEnv.EvaluateDirect(Normal[j], tempcolor);
tempcolor.X *= shadingColor.r;
tempcolor.Y *= shadingColor.g;
tempcolor.Z *= shadingColor.b;
Color[j] = ConvertRGBColorTo4ub(tempcolor);
}
}
else
{
for (size_t j=0; j<numVertices; j++)
{
lightEnv.EvaluateUnit(Normal[j], tempcolor);
tempcolor.X *= shadingColor.r;
tempcolor.Y *= shadingColor.g;
tempcolor.Z *= shadingColor.b;
Color[j] = ConvertRGBColorTo4ub(tempcolor);
}
lightEnv.EvaluateUnit(Normal[j], tempcolor);
tempcolor.X *= shadingColor.r;
tempcolor.Y *= shadingColor.g;
tempcolor.Z *= shadingColor.b;
Color[j] = ConvertRGBColorTo4ub(tempcolor);
}
}