4 ms·
I don’t know anything about shaders, so forgive the question. My understanding from looking at the worksheet is the person who created the target image has cre
by justusthane 3y ago
I don’t know anything about shaders, so forgive the question.
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.
- luaKmua 3y agoAt their heart, that's what pixel/fragment shaders are. They're calculations for determining what color a pixel should be. 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/ https://www.shadertoy.com/ which are all purely made in pixel shaders (also that site is run by the creator of the Human Shader)
- balloonthief 3y agoHmmm, this looks kinda familiar.... https://www.shadertoy.com/view/ddjBRK https://www.shadertoy.com/view/ddjBRK
- Tehdasi 3y agoBasically, yes. A shader is basically a function which passes in the x,y coords and spits out a color, and this is done for every pixel on the screen. 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.