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
It puts its desired color in
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.
More by Jim
- The inception bar: a new phishing method
- The hacker hype cycle
- Project C-43: the lost origins of asymmetric crypto
- How Hacker News stays interesting
- My parents are Flat-Earthers
- The dots do matter: how to scam a Gmail user
- The sorry state of OpenSSL usability
- I hate telephones
- The Three Ts of Time, Thought and Typing: measuring cost on the web
- Granddad died today
- Your syntax highlighter is wrong
Tagged . All content copyright James Fisher 2017. This post is not associated with my employer. Found an error? Edit this page.