For each point that my OpenGL shader program executes, it creates a red ring that seamlessly transitions between opaque and fully transparent. My shader program works, but has grouping artifacts.
Fragment shader below.
#version 110 precision mediump float; void main() { float dist = distance(gl_PointCoord.xy, vec2(0.5, 0.5)); // Edge value is 0.5, it should be 1. // Inner most value is 0 it should stay 0. float inner_circle = 2.0 * dist; float circle = 1.0 - inner_circle; vec4 pixel = vec4(1.0, 0.0, 0.0, inner_circle * circle ); gl_FragColor = pixel; }
Here's a less interesting vertex shader, which I think is not the cause of the problem.
#version 110 attribute vec2 aPosition; uniform float uSize; uniform vec2 uCamera; void main() {
Please help me figure out why my OpenGL shader program has grouping artifacts?
PS By the way, this is for Android Acer Iconia.
source share