Loads and loads of small improvements I added while developing on my game

This commit is contained in:
Michel Fedde 2021-03-02 19:54:19 +01:00
parent 41421b1df9
commit a7c71e7ea1
107 changed files with 2278 additions and 1023 deletions

View file

@ -42,45 +42,23 @@ namespace SM.Base.PostProcess
fragment.GLSLExtensions.Add(_fragExtensions);
}
/// <summary>
/// Draws the shader without special uniforms.
/// </summary>
/// <param name="color"></param>
public void Draw(ColorAttachment color)
{
GL.UseProgram(this);
GL.BindVertexArray(Plate.Object);
Uniforms["MVP"].SetMatrix4(PostProcessEffect.Mvp);
Uniforms["ModelMatrix"].SetMatrix4(PostProcessEffect.Model);
Uniforms["renderedTexture"].SetTexture(color);
GL.DrawArrays(PrimitiveType.Quads, 0, 4);
CleanUp();
GL.UseProgram(0);
}
/// <summary>
/// Draws the shader with special uniforms.
/// </summary>
/// <param name="color"></param>
/// <param name="setUniformAction"></param>
public void Draw(ColorAttachment color, Action<UniformCollection> setUniformAction)
public void Draw(Action<UniformCollection> setUniformAction)
{
GL.UseProgram(this);
GL.BindVertexArray(Plate.Object);
Activate();
Plate.Object.Activate();
Uniforms["MVP"].SetMatrix4(PostProcessEffect.Mvp);
Uniforms["ModelMatrix"].SetMatrix4(PostProcessEffect.Model);
Uniforms["renderedTexture"].SetTexture(color);
setUniformAction(Uniforms);
GL.DrawArrays(PrimitiveType.Quads, 0, 4);
CleanUp();
GL.UseProgram(0);
}
}
}