mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-26 16:13:30 +00:00
Removes unused BuildColor4ub from ModelRenderer
We don't need to calculate shading on CPU since we always use shaders.
Refs: a9c27b412b
This commit is contained in:
@@ -156,29 +156,6 @@ void ModelRenderer::BuildPositionAndNormals(
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void ModelRenderer::BuildColor4ub(
|
||||
CModel* model,
|
||||
const VertexArrayIterator<CVector3D>& Normal,
|
||||
const VertexArrayIterator<SColor4ub>& Color)
|
||||
{
|
||||
PROFILE("lighting vertices");
|
||||
|
||||
CModelDefPtr mdef = model->GetModelDef();
|
||||
size_t numVertices = mdef->GetNumVertices();
|
||||
const CLightEnv& lightEnv = g_Renderer.GetSceneRenderer().GetLightEnv();
|
||||
CColor shadingColor = model->GetShadingColor();
|
||||
|
||||
for (size_t j = 0; j < numVertices; ++j)
|
||||
{
|
||||
RGBColor tempcolor = lightEnv.EvaluateUnitScaled(Normal[j]);
|
||||
tempcolor.X *= shadingColor.r;
|
||||
tempcolor.Y *= shadingColor.g;
|
||||
tempcolor.Z *= shadingColor.b;
|
||||
Color[j] = ConvertRGBColorTo4ub(tempcolor);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void ModelRenderer::GenTangents(const CModelDefPtr& mdef, std::vector<float>& newVertices, bool gpuSkinning)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user