aboutsummaryrefslogtreecommitdiff
path: root/voronoisplat.cpp
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2015-12-19 18:17:55 +0100
committerSamuel Fadel <samuelfadel@gmail.com>2015-12-19 18:17:55 +0100
commitf9621a05755714decd59859fabbb1ffd8bd8eef8 (patch)
tree8303082e688717df3e3ab739af761e9797895901 /voronoisplat.cpp
parent22cf125302f293070662caa1aba68aaa44e4f5bd (diff)
Fixed VoronoiSplat implementation. Might still need some work.
Diffstat (limited to 'voronoisplat.cpp')
-rw-r--r--voronoisplat.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/voronoisplat.cpp b/voronoisplat.cpp
index dc37a55..da30d3c 100644
--- a/voronoisplat.cpp
+++ b/voronoisplat.cpp
@@ -55,8 +55,6 @@ layout (location = 0) out vec4 fragColor;
void main() {
float dt = texelFetch(siteDT, ivec2(gl_FragCoord.xy), 0).r;
- fragColor = vec4(0.25, 0.5, 0, 0);
- return;
if (dt > rad_max)
discard;
else {
@@ -89,15 +87,15 @@ void main() {
R"EOF(
#version 440
-layout (location = 0) out vec4 fragColor;
-
uniform sampler2D siteDT;
uniform sampler2D accumTex;
uniform sampler2D colormap;
uniform float rad_max;
+layout (location = 0) out vec4 fragColor;
+
vec3 getRGB(float value) {
- return texture2D(colormap, vec2(mix(0.005, 0.995, value), 1)).rgb;
+ return texture(colormap, vec2(mix(0, 1, value), 0)).rgb;
}
void main() {
@@ -330,7 +328,7 @@ void VoronoiSplatRenderer::render()
m_program1->bind();
m_program1->setUniformValue("rad_max", 20.0f);
m_program1->setUniformValue("rad_blur", RAD_BLUR);
- m_program1->setUniformValue("fb_size", m_size.width());
+ m_program1->setUniformValue("fb_size", float(m_size.width()));
gl.glActiveTexture(GL_TEXTURE0);
gl.glBindTexture(GL_TEXTURE_2D, m_textures[0]);