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

@@ -66,7 +66,8 @@ local sunstar = {
MagnitudeExponent = 6.2,
SizeComposition = "Distance Modulus",
RenderMethod = "Texture Based", -- or PSF
FadeInDistances = { 0.0001, 0.1 }
FadeInDistances = { 0.0001, 0.1 },
RenderableType = "PostDeferredTransparent"
},
GUI = {
Name = "Sun",

View File

@@ -101,7 +101,7 @@ Fragment getFragment() {
vec4 fullColor = vec4(color.rgb, textureColor.a);
fullColor.a *= alphaValue;
if (fullColor.a == 0) {
if (fullColor.a < 0.001) {
discard;
}

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();