Add support for rendering tinted artwork.
This commit is contained in:
@@ -53,6 +53,8 @@ namespace OpenRA.Platforms.Default
|
||||
OpenGL.CheckGLError();
|
||||
OpenGL.glEnableVertexAttribArray(Shader.TexMetadataAttributeIndex);
|
||||
OpenGL.CheckGLError();
|
||||
OpenGL.glEnableVertexAttribArray(Shader.TintAttributeIndex);
|
||||
OpenGL.CheckGLError();
|
||||
}
|
||||
|
||||
public IVertexBuffer<Vertex> CreateVertexBuffer(int size)
|
||||
|
||||
@@ -21,6 +21,7 @@ namespace OpenRA.Platforms.Default
|
||||
public const int VertexPosAttributeIndex = 0;
|
||||
public const int TexCoordAttributeIndex = 1;
|
||||
public const int TexMetadataAttributeIndex = 2;
|
||||
public const int TintAttributeIndex = 3;
|
||||
|
||||
readonly Dictionary<string, int> samplers = new Dictionary<string, int>();
|
||||
readonly Dictionary<int, int> legacySizeUniforms = new Dictionary<int, int>();
|
||||
@@ -83,6 +84,8 @@ namespace OpenRA.Platforms.Default
|
||||
OpenGL.CheckGLError();
|
||||
OpenGL.glBindAttribLocation(program, TexMetadataAttributeIndex, "aVertexTexMetadata");
|
||||
OpenGL.CheckGLError();
|
||||
OpenGL.glBindAttribLocation(program, TintAttributeIndex, "aVertexTint");
|
||||
OpenGL.CheckGLError();
|
||||
|
||||
if (OpenGL.Profile != GLProfile.Legacy)
|
||||
{
|
||||
|
||||
@@ -101,6 +101,8 @@ namespace OpenRA.Platforms.Default
|
||||
OpenGL.CheckGLError();
|
||||
OpenGL.glVertexAttribPointer(Shader.TexMetadataAttributeIndex, 2, OpenGL.GL_FLOAT, false, VertexSize, new IntPtr(28));
|
||||
OpenGL.CheckGLError();
|
||||
OpenGL.glVertexAttribPointer(Shader.TintAttributeIndex, 3, OpenGL.GL_FLOAT, false, VertexSize, new IntPtr(36));
|
||||
OpenGL.CheckGLError();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
|
||||
Reference in New Issue
Block a user