aboutsummaryrefslogtreecommitdiff
path: root/voronoisplat.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'voronoisplat.cpp')
-rw-r--r--voronoisplat.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/voronoisplat.cpp b/voronoisplat.cpp
index 1bcab69..749ec42 100644
--- a/voronoisplat.cpp
+++ b/voronoisplat.cpp
@@ -142,8 +142,8 @@ void main() {
discard;
} else {
vec4 accum = texelFetch(accumTex, ivec2(gl_FragCoord.xy), 0);
- float value = accum.g > 0.0 ? accum.r / accum.g : 0.0;
- // float value = (accum.g > 1.0) ? (accum.r - 1.0) / (accum.g - 1.0) : 0.0;
+ // float value = accum.g > 0.0 ? accum.r / accum.g : 0.0;
+ 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);
}
}
@@ -359,7 +359,8 @@ void VoronoiSplat::resizeTextures()
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, m_width, m_height, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, NULL);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, m_width, m_height, 0,
+ GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE, nullptr);
glBindTexture(GL_TEXTURE_2D, 0);
glBindTexture(GL_TEXTURE_2D, m_outTex);
@@ -470,7 +471,7 @@ void VoronoiSplat::draw()
// glEnable(GL_POINT_SPRITE);
glEnable(GL_PROGRAM_POINT_SIZE);
glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ZERO);
+ glBlendFunc(GL_ONE, GL_ONE);
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);