OpenGL Fragment Shaders | How Do Fragment Shaders Work?

Pubblicato il: 16 dicembre 2019
sul canale di: An Object Is A
10,007
234

How are fragment shaders actually working?

More than one color on screen?

Why so difficult?

This series is based off of the free on-line book, "The Book Of Shaders", by Patricio Gonzalez Vivo and Jen Lowe.
https://thebookofshaders.com/

If you feel like donating, please donate to those two; a donation link is found on their website linked above.

Previous video:    • OpenGL Fragment Shaders | GLSL and Our Env...  

Editor used: https://patriciogonzalezvivo.github.i...


Subscribe to my channel:    / @anobj  

If you find value in what I do, think about supporting my channel:
Paypal: https://www.paypal.me/anobjisa
Bitcoin: 3H4NKKwPdbiE5Gtc3Uk2DiwszqHhrRbmKK
Ethereum: 0x48702412F448a27be03836fb6FE6456603668030
Litecoin: MNJ4uv3GD4r62VpQ8rHX1Pj1ihWCj74hCK

Find me here:
Bitchute: https://www.bitchute.com/channel/gPUm...
Twitter:   / anobjectisa1  
Minds: https://www.minds.com/an_object_is_a/
Instagram:   / an_object_is_a  

Code used:

1.

#ifdef GL_ES
precision mediump float;
#endif

uniform vec2 u_resolution;

void main() {
vec2 st = gl_FragCoord.xy/u_resolution;

// Youtube descriptions do not allow the angle brackets
// gteq = greater than or equal to
// lteq = less than or equal to
if (st.x gteq 0.500 && st.x lteq 0.503 &&
st.y gteq 0.500 && st.y lteq 0.503) {
gl_FragColor = vec4(1.,1.0,1.0,1.0);
} else {
gl_FragColor = vec4(0.,0.0,0.0,1.0);
}
}

2.

#ifdef GL_ES
precision mediump float;
#endif

uniform vec2 u_resolution;

void main() {
vec2 st = gl_FragCoord.xy/u_resolution;
vec3 canvas = vec3(1.0);

canvas = mix(canvas, vec3(1.0,0.0,0.0), st.x);
gl_FragColor = vec4(canvas, 1.0);
}


In questa pagina del sito puoi guardare il video online OpenGL Fragment Shaders | How Do Fragment Shaders Work? della durata di ore minuti seconda in buona qualità , che l'utente ha caricato An Object Is A 16 dicembre 2019, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 10,007 volte e gli è piaciuto 234 spettatori. Buona visione!