Skip to content

Commit

Permalink
Fix post processing rendering after images
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaTheFoxgirl committed May 1, 2023
1 parent dfdcc95 commit 81ad7db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/inochi2d/core/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,9 @@ void inEndScene() {
void inPostProcessScene() {
bool targetBuffer;

float r, g, b, a;
inGetClearColor(r, g, b, a);

// Render area
vec4 area = vec4(
0, 0,
Expand Down Expand Up @@ -342,6 +345,8 @@ void inPostProcessScene() {
// We want to be able to post process all the attachments
glBindFramebuffer(GL_FRAMEBUFFER, cfBuffer);
glDrawBuffers(3, [GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2].ptr);
glClear(GL_COLOR_BUFFER_BIT);

glBindFramebuffer(GL_FRAMEBUFFER, fBuffer);
glDrawBuffers(3, [GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2].ptr);

Expand All @@ -357,7 +362,6 @@ void inPostProcessScene() {

// Composite buffer -> Main buffer
glBindFramebuffer(GL_FRAMEBUFFER, fBuffer); // dst
glDrawBuffers(3, [GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1, GL_COLOR_ATTACHMENT2].ptr);
renderScene(area, shader, cfAlbedo, cfEmissive, cfBump); // src
}
}
Expand Down

0 comments on commit 81ad7db

Please sign in to comment.