Added initial position (far away) in the g-Buffer position. (#1360)

* Added initial position (far away) in the g-Buffer position.
* Fixed bug with Sun's star and atmosphere.
This commit is contained in:
Jonathas Costa
2020-11-12 16:10:01 -05:00
committed by GitHub
parent af5ea6ad3a
commit 8ad757263f
3 changed files with 5 additions and 2 deletions

View File

@@ -73,6 +73,7 @@ namespace {
}
};
constexpr const glm::vec4 PosBufferClearVal = { 1e32, 1e32, 1e32, 1.f };
constexpr const std::array<const char*, 7> HDRUniformNames = {
"hdrFeedingTexture", "blackoutFactor", "hdrExposure", "gamma",
@@ -1170,6 +1171,7 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac
glBindFramebuffer(GL_FRAMEBUFFER, _gBuffers.framebuffer);
glDrawBuffers(3, ColorAttachmentArray);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glClearBufferfv(GL_COLOR, 1, glm::value_ptr(PosBufferClearVal));
}
Time time = global::timeManager->time();