Skip to content

Instantly share code, notes, and snippets.

@ngokevin
Created September 14, 2018 23:42
Show Gist options
  • Save ngokevin/fc3e3a6be9d06b377cddb20bab1766ec to your computer and use it in GitHub Desktop.
Save ngokevin/fc3e3a6be9d06b377cddb20bab1766ec to your computer and use it in GitHub Desktop.
fade shader
void main() {
float alpha = 1.0 - smoothstep(2.25, 3.75, length(vWorldPosition.xz));
vec4 tex = texture2D(src, vUv) * vec4(color, 1.0);
gl_FragColor = vec4(tex.xyz, min(1.0, tex.w * alpha * opacity));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment