summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--application.cpp2
-rw-r--r--bullet_fragment.glsl7
-rw-r--r--foo4.pngbin906 -> 5967 bytes
3 files changed, 6 insertions, 3 deletions
diff --git a/application.cpp b/application.cpp
index 38448ec..b9a6173 100644
--- a/application.cpp
+++ b/application.cpp
@@ -244,7 +244,7 @@ void Application::main_loop(unsigned int tick, unsigned int step) {
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE);
shader->use();
- glPointSize(16.0);
+ glPointSize(32.0);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture->tex());
diff --git a/bullet_fragment.glsl b/bullet_fragment.glsl
index 66f53a4..5e8becd 100644
--- a/bullet_fragment.glsl
+++ b/bullet_fragment.glsl
@@ -7,6 +7,9 @@ void main() {
l_uv -= l_offset;
l_uv = vec2(v_tex_rot * vec4(l_uv, 0.0, 1.0));
l_uv += l_offset;
- gl_FragColor = vec4(texture2D(tex, l_uv));
- gl_FragColor.xyz += gl_Color.xyz - gl_Color.xyz * gl_FragColor.x;
+ gl_FragColor = texture2D(tex, l_uv);
+ float M = max(max(gl_FragColor.x, gl_FragColor.y), gl_FragColor.z);
+ float C = M - min(min(gl_FragColor.x, gl_FragColor.y), gl_FragColor.z);
+ float S = C > 0.0 ? C / M : 0.0;
+ gl_FragColor.xyz = M * mix(vec3(1.0, 1.0, 1.0), gl_Color.xyz, S);
}
diff --git a/foo4.png b/foo4.png
index b9a0e05..7c9b56f 100644
--- a/foo4.png
+++ b/foo4.png
Binary files differ