Disable vertex colors on certain gfbmdls.

This commit is contained in:
KillzXGaming 2020-05-09 20:28:16 -04:00
parent 5a4a994bc8
commit 7740ae93bf
2 changed files with 11 additions and 0 deletions

View file

@ -283,6 +283,12 @@ namespace FirstPlugin
}
}
public bool HasVertexColors()
{
//A quick hack. Maps typically have no switches but have vertex colors as diffuse.
return Material.Switches.Count == 0;
}
public GFLXMaterialData(GFLXModel parent, Material mat)
{
ParentModel = parent;

View file

@ -267,6 +267,11 @@ namespace FirstPlugin
private static void SetTextureUniforms(GFLXMaterialData mat, GFLXMesh m, ShaderProgram shader)
{
if (!mat.HasVertexColors())
shader.SetBoolToInt("renderVertColor", false);
else
shader.SetBoolToInt("renderVertColor", Runtime.renderVertColor);
SetDefaultTextureAttributes(mat, shader);
GL.ActiveTexture(TextureUnit.Texture0 + 1);