mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2025-02-16 13:58:26 +00:00
Disable vertex colors on certain gfbmdls.
This commit is contained in:
parent
5a4a994bc8
commit
7740ae93bf
2 changed files with 11 additions and 0 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue