Skip to content

Commit

Permalink
Use post buffer for bfres rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
KillzXGaming committed Nov 19, 2023
1 parent 92abfc6 commit 3111264
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Fushigi/ui/widgets/LevelViewport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ internal class LevelViewport(CourseArea area, GL gl, CourseAreaScene areaScene)

public Camera Camera = new Camera();
public GLFramebuffer Framebuffer; //Draws opengl data into the viewport
public HDRScreenBuffer HDRScreenBuffer = new HDRScreenBuffer();

public object? HoveredObject;
public CourseLink? CurCourseLink = null;
Expand Down Expand Up @@ -228,9 +229,13 @@ public void DrawScene3D(Vector2 size, IDictionary<string, bool> layersVisibility

ImGui.SetCursorScreenPos(mTopLeft);

//Draw final output in post buffer
HDRScreenBuffer.Render(gl, (int)size.X, (int)size.Y, (GLTexture2D)Framebuffer.Attachments[0]);

Framebuffer.Unbind();

//Draw framebuffer
ImGui.Image((IntPtr)((GLTexture)Framebuffer.Attachments[0]).ID, new Vector2(size.X, size.Y),
new Vector2(0, 1), new Vector2(1, 0));
ImGui.Image((IntPtr)HDRScreenBuffer.GetOutput().ID, new Vector2(size.X, size.Y));

ImGui.SetNextItemAllowOverlap();

Expand Down Expand Up @@ -282,9 +287,6 @@ private void RenderActor(CourseActor actor, ModelInfo modelInfo)
model.Render(gl, render, mat, this.Camera);
break;
}



}

public void Draw(Vector2 size, double deltaSeconds, IDictionary<string, bool> layersVisibility)
Expand Down Expand Up @@ -320,7 +322,6 @@ public void Draw(Vector2 size, double deltaSeconds, IDictionary<string, bool> la
this.DrawScene3D(size, mLayersVisibility);

DrawGrid();

DrawAreaContent();

if (!mouseHover)
Expand Down

0 comments on commit 3111264

Please sign in to comment.