WebGL fragment shader

Above, you should see some concentric circles on the left, and some code on the right. The code is a “fragment shader”, and it generated the image on the left. You can edit it yourself to change the image.

For each pixel in the image, the fragment shader is run to get an output color. The shader has access to the current coordinate as gl_FragCoord. It puts its desired color in gl_FragColor.

This is implemented using WebGL, which gives this page access to your graphics card. Whenever you change the text in that textarea, the text is sent to your graphics driver, which compiles it to a program sitting on your graphics card. The webpage then tells the driver to draw a big square using this program.

I just released Vidrio, a free app for macOS and Windows to make your screen-sharing awesomely holographic. Vidrio shows your webcam video on your screen, just like a mirror. Then you just share or record your screen with Zoom, QuickTime, or any other app. Vidrio makes your presentations effortlessly engaging, showing your gestures, gazes, and expressions. #1 on Product Hunt. Available for macOS and Windows.

With Vidrio

With generic competitor

More by Jim

Tagged . All content copyright James Fisher 2017. This post is not associated with my employer. Found an error? Edit this page.