Skip to content

Commit de3ac78

Browse files
committed
build
1 parent 3e0065a commit de3ac78

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

webgl/lessons/webgl-fundamentals.html

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,16 +82,22 @@ <h1>WebGL Fundamentals</h1>
8282
<p>Nearly all of the entire WebGL API is about setting up state for these pairs of functions to run. You setup
8383
a bunch of state then execute a pair of functions by calling <code>gl.drawArrays</code> or <code>gl.drawElements</code> which
8484
executes your shaders on the GPU.</p>
85-
<p>Any data you want those functions to have accessed to must be provided to the GPU. There are 4 ways
85+
<p>Any data you want those functions to have accesse to must be provided to the GPU. There are 4 ways
8686
a shader can receive data.</p>
8787
<ol>
8888
<li><p>Attributes and Buffers</p>
89-
<p>Buffers are arrays of binary data you upload to the GPU. Attributes are used to specify how to
89+
<p>Buffers are arrays of binary data you upload to the GPU. Usually buffers contain
90+
things like positions, normals, texture coordinates, vertex colors, etc although
91+
you&#39;re free to put anything you want in them.</p>
92+
<p>Attributes are used to specify how to
9093
pull data how of your buffers and provide them to your vertex shader.
9194
For example you might put positions in a buffer as three 32bit floats
92-
per position. You would tell a particular attribute which buffer to pull the data out of, what type
93-
of data it shoudl pull out (3 component 32 bit floating point numbers), what offset
95+
per position. You would tell a particular attribute which buffer to pull the positions out of, what type
96+
of data it should pull out (3 component 32 bit floating point numbers), what offset
9497
in the buffer the positions start, and how many bytes to get from one position to the next.</p>
98+
<p>Buffers are not random access. Instead a vertex shaders is executed a specified number
99+
of times. Each time it&#39;s executed the next value from each specified buffers is pulled
100+
out assigned to an attribute.</p>
95101
</li>
96102
<li><p>Uniforms</p>
97103
<p>Uniforms are effectively global variables you set before you execute your shader program.</p>
@@ -110,7 +116,7 @@ <h1>WebGL Fundamentals</h1>
110116
<h2 id="webgl-hello-world">WebGL Hello World</h2>
111117
<p>WebGL only cares about 2 things. Clipspace coordinates and colors.
112118
Your job as a programmer using WebGL is to provide WebGL with those 2 things.
113-
You provide 2 &quot;shaders&quot; to do this. A Vertex shader which provides the
119+
You provide your 2 &quot;shaders&quot; to do this. A Vertex shader which provides the
114120
clipspace coordinates and a fragment shader that provides the color.</p>
115121
<p>Clipspace coordinates always go from -1 to +1 no matter what size your
116122
canvas is. Here is a simple WebGL example that shows WebGL in its simplest form.</p>

0 commit comments

Comments
 (0)