smrendererv3/SM_TEST/TestRenderPipeline.cs
Michel Fedde 71a22df8bd 2021-19-03
SM.Base:
~ Improved Keyboard.AreSpecificKeysPressed(int, int)
~ Made GenericTransformation.LastMaster's set public
~ Made the fixed update use the property "IsExiting" to determent if it should stop.
~ The MainFramebuffer of each RenderPipeline now has always a name.

SM2D:
~ Moved the checking code of Mouse2D.MouseOver into a own method.
2021-03-19 09:31:36 +01:00

43 lines
No EOL
1.2 KiB
C#

using OpenTK.Graphics.OpenGL4;
using SM.Base.PostEffects;
using SM.Base.Window;
using SM.OGL.Framebuffer;
namespace SM_TEST
{
public class TestRenderPipeline : RenderPipeline
{
private BloomEffect _bloom;
private Framebuffer _postBuffer;
public override void Initialization()
{
MainFramebuffer = CreateWindowFramebuffer(16);
_postBuffer = CreateWindowFramebuffer();
Framebuffers.Add(_postBuffer);
_bloom = new BloomEffect(MainFramebuffer, hdr: true, .5f)
{
Threshold = .5f,
};
_bloom.Initilize(this);
base.Initialization();
}
protected override void RenderProcess(ref DrawContext context)
{
MainFramebuffer.Activate(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
context.Scene.DrawBackground(context);
context.Scene.DrawMainObjects(context);
context.Scene.DrawHUD(context);
Framebuffer.Screen.Activate(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
_bloom.Draw(context);
context.Scene.DrawDebug(context);
}
}
}