Depth of Field shader for points/strokes in Processing
问题 Recently I've been using the Depth of Field shader below (originally from the ofxPostProcessing library for OpenFrameworks) for my Processing sketches. depth.glsl uniform float maxDepth; void main() { float depth = gl_FragCoord.z / gl_FragCoord.w; gl_FragColor = vec4(vec3(1.0 - depth/maxDepth), 1.0); } dof.glsl uniform sampler2D texture; varying vec4 vertexture; varying vec4 vertTexCoord; uniform sampler2D tDepth; uniform float maxBlur; // max blur amount uniform float aperture; // aperture -