aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-01-18 16:45:07 +0100
committerSamuel Fadel <samuelfadel@gmail.com>2016-01-18 16:45:07 +0100
commit47fa52be5f6ff645119eb1e6087d4f9d84822f5f (patch)
tree4dcadd861114c72c4e94a46d5be777ba6ee13127
parent8cc4c24249600392871cc802f3ac4dd27368d335 (diff)
VoronoiSplat: Fixed issue #8.
-rw-r--r--voronoisplat.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/voronoisplat.cpp b/voronoisplat.cpp
index 0a2894b..910f17f 100644
--- a/voronoisplat.cpp
+++ b/voronoisplat.cpp
@@ -245,7 +245,7 @@ void main() {
discard;
else {
vec4 accum = texelFetch(accumTex, ivec2(gl_FragCoord.xy), 0);
- float value = (accum.g == 0.0) ? 0.0 : accum.r / accum.g;
+ float value = (accum.g > 1.0) ? (accum.r - 1.0) / (accum.g - 1.0) : 0.0;
fragColor = vec4(getRGB(value), 1.0 - dt / rad_max);
}
}
@@ -366,14 +366,14 @@ void VoronoiSplatRenderer::render()
gl.glEnable(GL_POINT_SPRITE);
gl.glEnable(GL_PROGRAM_POINT_SIZE);
gl.glEnable(GL_BLEND);
- gl.glBlendFunc(GL_ONE, GL_ZERO);
+ gl.glBlendFunc(GL_ONE, GL_ONE);
// First, we draw to an intermediate texture, which is used as input for the
// second pass
gl.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D, m_textures[1], 0);
- gl.glClearColor(0, 0, 0, 1);
+ gl.glClearColor(1, 1, 1, 1);
gl.glClear(GL_COLOR_BUFFER_BIT);
m_sitesVAO.bind();