mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Update renderer design to be more flexible and data-driven based on material and shader definitions.
Support conditional expressions in shader effect XML files. Consolidate fixed-function model rendering into the shader system. Remove lots of now-obsolete renderer code. Move shader defines from std::map to new class with interned data, for performance. Move texture from model into material. Alleviate singletonitis. Remove obsolete lodbias setting. Remove unused terrain shadow transparency. This was SVN commit r11423.
This commit is contained in:
@@ -118,15 +118,15 @@ bool CObjectEntry::BuildVariation(const std::vector<std::set<CStr> >& selections
|
||||
CModel* model = new CModel(objectManager.GetSkeletonAnimManager());
|
||||
delete m_Model;
|
||||
m_Model = model;
|
||||
model->SetMaterial(g_MaterialManager.LoadMaterial(m_Base->m_Material));
|
||||
model->GetMaterial().SetTextureColor(m_Color);
|
||||
model->SetMaterial(g_Renderer.GetMaterialManager().LoadMaterial(m_Base->m_Material));
|
||||
model->GetMaterial().SetObjectColor(m_Color);
|
||||
model->InitModel(modeldef);
|
||||
|
||||
CTextureProperties textureProps(m_TextureName);
|
||||
textureProps.SetWrap(GL_CLAMP_TO_EDGE);
|
||||
CTexturePtr texture = g_Renderer.GetTextureManager().CreateTexture(textureProps);
|
||||
texture->Prefetch(); // if we've loaded this model we're probably going to render it soon, so prefetch its texture
|
||||
model->SetTexture(texture);
|
||||
model->GetMaterial().SetDiffuseTexture(texture);
|
||||
|
||||
// calculate initial object space bounds, based on vertex positions
|
||||
model->CalcStaticObjectBounds();
|
||||
|
||||
Reference in New Issue
Block a user