Loads and loads of small improvements I added while developing on my game
This commit is contained in:
parent
41421b1df9
commit
a7c71e7ea1
107 changed files with 2278 additions and 1023 deletions
19
SMCode/SM2D/Shader/ShaderCollection.cs
Normal file
19
SMCode/SM2D/Shader/ShaderCollection.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
using SM.Base.Drawing;
|
||||
using SM.Base.Windows;
|
||||
using SM.OGL.Shaders;
|
||||
using SM.Utility;
|
||||
|
||||
namespace SM2D.Shader
|
||||
{
|
||||
public class ShaderCollection
|
||||
{
|
||||
public static SimpleShader Basic = new SimpleShader("basic", AssemblyUtility.ReadAssemblyFile("SM2D.Shader.ShaderFiles.basic.glsl"), SetUniforms);
|
||||
public static SimpleShader Instanced = new SimpleShader("instanced", AssemblyUtility.ReadAssemblyFile("SM2D.Shader.ShaderFiles.basic.glsl"), SetUniforms);
|
||||
|
||||
static void SetUniforms(UniformCollection uniforms, DrawContext context)
|
||||
{
|
||||
uniforms["Tint"].SetUniform4(context.Material.Tint);
|
||||
uniforms["Texture"].SetTexture(context.Material.Texture, uniforms["UseTexture"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue