diff options
| -rw-r--r-- | application.cpp | 2 | ||||
| -rw-r--r-- | bullet_fragment.glsl | 7 | ||||
| -rw-r--r-- | foo4.png | bin | 906 -> 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);  } Binary files differ | 
