Fixed MSAA

This commit is contained in:
Michel Fedde 2021-03-24 13:53:29 +01:00
parent 7ea788534c
commit ddd2171da2
5 changed files with 21 additions and 9 deletions

View file

@ -133,7 +133,7 @@ namespace SM.Base.PostEffects
/// <inheritdoc/>
protected override void InitProcess()
{
_source = Pipeline.MainFramebuffer;
_source ??= Pipeline.MainFramebuffer;
_source.ColorAttachments["color"].PixelInformation = PixelInformation.RGBA_HDR;

View file

@ -28,6 +28,7 @@ namespace SM.Base.PostEffects
/// <summary>
/// This resolves a multisampled framebuffer to a non-multisampled renderbuffer.
/// <para>This removes the depth buffer.</para>
/// </summary>
/// <param name="multisampledBuffers"></param>
/// <param name="target"></param>
@ -36,7 +37,7 @@ namespace SM.Base.PostEffects
multisampledBuffers.Activate(FramebufferTarget.ReadFramebuffer);
target.Activate(FramebufferTarget.DrawFramebuffer);
GL.BlitFramebuffer(0, 0, (int) multisampledBuffers.Size.X, (int) multisampledBuffers.Size.Y, 0, 0,
(int) target.Size.X, (int) target.Size.Y, ClearBufferMask.ColorBufferBit | ClearBufferMask.DepthBufferBit,
(int) target.Size.X, (int) target.Size.Y, ClearBufferMask.ColorBufferBit,
BlitFramebufferFilter.Nearest);
target.Activate();

View file

@ -55,6 +55,8 @@ namespace SM.OGL.Framebuffer
/// </summary>
public Dictionary<RenderbufferAttachment, int> RenderbufferAttachments { get; } = new Dictionary<RenderbufferAttachment, int>();
public ColorAttachment this[string colorName] => ColorAttachments[colorName];
/// <summary>
/// Creates a buffer without any options.
/// </summary>