27 Sep 2021

+ Added Amount Map to the new Bloom system.

~ Moved all projects to .NetFramework 4.5.2
~ Made sure, you can't get a higher multisampling as 8.
This commit is contained in:
Nineto Nine 2021-09-27 17:17:38 +02:00
parent 2c0517ca48
commit 17cbebcf6a
15 changed files with 125 additions and 21 deletions

View file

@ -1,6 +1,7 @@
using OpenTK.Graphics.OpenGL4;
using SM.Base.Legacy.PostProcessing;
using SM.Base.PostEffects;
using SM.Base.Textures;
using SM.Base.Window;
using SM.Intergrations.ShaderTool;
using SM.OGL.Framebuffer;
@ -10,20 +11,19 @@ namespace SM_TEST
{
public class TestRenderPipeline : RenderPipeline
{
private BloomEffectOld _bloomObsolete;
private BloomEffect _bloom;
private STPostProcessEffect _vittage;
private Framebuffer _postBuffer;
public override void Initialization()
{
MainFramebuffer = CreateWindowFramebuffer(0, PixelInformation.RGBA_HDR, true);
MainFramebuffer = CreateWindowFramebuffer(8, PixelInformation.RGBA_HDR, true);
_postBuffer = CreateWindowFramebuffer(0, PixelInformation.RGB_HDR, false);
_bloom = new BloomEffect(true)
{
Radius = 20,
AmountMap = new Texture(new System.Drawing.Bitmap("bloom_amountMap.png"))
};
PostProcessEffects.Add(_bloom);
@ -52,17 +52,13 @@ namespace SM_TEST
context.Scene.DrawHUD(context);
GL.Disable(EnableCap.DepthTest);
//_postBuffer.Activate(ClearBufferMask.ColorBufferBit);
//PostProcessUtility.ResolveMultisampledBuffers(MainFramebuffer, _postBuffer);
_postBuffer.Activate(ClearBufferMask.ColorBufferBit);
PostProcessUtility.ResolveMultisampledBuffers(MainFramebuffer, _postBuffer);
//_vittage.Draw(MainFramebuffer["color"], context);
//_bloom.Draw(MainFramebuffer["color"], context);
_bloomObsolete.Draw(MainFramebuffer["color"], context);
_bloom.Draw(_postBuffer["color"], context);
Framebuffer.Screen.Activate(ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit);
PostProcessUtility.FinalizeHDR(MainFramebuffer["color"], 1f);
//context.Scene.DrawDebug(context);
PostProcessUtility.FinalizeHDR(_postBuffer["color"], 1f);
}
}
}