diff options
-rw-r--r-- | voronoisplat.cpp | 6 |
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(); |