#version 450 core in vec3 vPos; in vec4 vCol; in vec2 vControls; layout (location=0) out vec4 fCol; layout (location=1) out vec4 fPos; layout (location=2) out vec4 fNorm; void main() { float d = dot(vControls,vControls); if (d > 1) {discard;} // the following is an alternative without using discard // not sure how this would interact with bloom //float d = min(dot(vControls,vControls),1); float a = vCol.w*(1-d); fCol = vec4(vCol.xyz,a); fPos = vec4(vPos, a); //fNorm = vec4(-vControls, -0.1 + 0.2 * d ,fCol.w); fNorm = vec4(-vControls, -0.1 + 0.3 * d ,a); }