mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-09 21:21:19 -06:00
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:
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user