Introduction to WebGL Shaders

Share this video with your friends

Send Tweet

In this lesson we learn about the two types of shaders required in WebGL - vertex shaders and fragment shaders. We create one of each and see how those shader programs affect what is drawn on the screen.

Fisker Karma
Fisker Karma
~ 7 years ago

I pretty much followed all the steps, yet cannot see that dot. Is it possible for u to figure out the bug? https://codepen.io/priyankamalviya/pen/YEzPeX?editors=1010

Fisker Karma
Fisker Karma
~ 7 years ago

ok after hours of struggle I figured a semicolon was missing here: vs+=" gl_Position = vec4(0.0, 0.0, 0.0, 1.0);"; & here: fs+=" gl_FragColor = vec4(0.0, 0.0, 0.0, 1.0);";

Tommaso Poletti
Tommaso Poletti
~ 5 years ago

I pretty much followed all the steps, yet cannot see that dot. Is it possible for u to figure out the bug? https://codepen.io/priyankamalviya/pen/YEzPeX?editors=1010

Me too, i see the problem only in Safari. the error is drawArrays: attempt to access out of bounds arrays.

I read online for search the fix, is a problem with unused attribute but here seems all good.

Anyone have a fix ? ;)