mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +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)
|
||||
{
|
||||
|
||||
@@ -141,22 +141,6 @@ public:
|
||||
const VertexArrayIterator<CVector3D>& Position,
|
||||
const VertexArrayIterator<CVector3D>& Normal);
|
||||
|
||||
/**
|
||||
* BuildColor4ub: Build lighting colors for the given model,
|
||||
* based on previously calculated world space normals.
|
||||
*
|
||||
* @param model The model that is to be lit.
|
||||
* @param Normal Array of the model's normal vectors, animated and
|
||||
* transformed into world space.
|
||||
* @param Color Points to the array that will receive the lit vertex color.
|
||||
* The array behind the iterator must large enough to hold
|
||||
* model->GetModelDef()->GetNumVertices() vertices.
|
||||
*/
|
||||
static void BuildColor4ub(
|
||||
CModel* model,
|
||||
const VertexArrayIterator<CVector3D>& Normal,
|
||||
const VertexArrayIterator<SColor4ub>& Color);
|
||||
|
||||
/**
|
||||
* BuildUV: Copy UV coordinates into the given vertex array.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user