by justusthane · 3y ago · 0 comments
My understanding from looking at the worksheet is the person who created the target image has created three separate formulas (depending on the area of the image), that when you feed in the X and the Y coordinates, it spits out the correct RGB value for that pixel. Is that correct? That’s wild.
So a simple shader would be something like (in pseudo code):
function shader( x, y ) { if( x > 0.5 ) return white; else return black; }
would color one half of the screen black, and the other white.
A really basic one returning red for every pixel would make a red screen. The most common use would be rendering a textured mesh and determining how lighting should effect it (is it skin? A metal surface?).
Then you can look at crazy things like https://www.shadertoy.com/ which are all purely made in pixel shaders (also that site is run by the creator of the Human Shader)