OLD | NEW |
---|---|
1 <!-- | 1 <!-- |
2 Copyright 2009, Google Inc. | 2 Copyright 2009, Google Inc. |
3 All rights reserved. | 3 All rights reserved. |
4 | 4 |
5 Redistribution and use in source and binary forms, with or without | 5 Redistribution and use in source and binary forms, with or without |
6 modification, are permitted provided that the following conditions are | 6 modification, are permitted provided that the following conditions are |
7 met: | 7 met: |
8 | 8 |
9 * Redistributions of source code must retain the above copyright | 9 * Redistributions of source code must retain the above copyright |
10 notice, this list of conditions and the following disclaimer. | 10 notice, this list of conditions and the following disclaimer. |
(...skipping 350 matching lines...) Loading... | |
361 <form name="default_form" action="#" method="get"> | 361 <form name="default_form" action="#" method="get"> |
362 <p> | 362 <p> |
363 Primitive type: | 363 Primitive type: |
364 <select onchange="changePrimitive(this.options[this.selectedIndex].value);"> | 364 <select onchange="changePrimitive(this.options[this.selectedIndex].value);"> |
365 <option value="PointList">PointList</option> | 365 <option value="PointList">PointList</option> |
366 <option value="LineList" selected>LineList</option> | 366 <option value="LineList" selected>LineList</option> |
367 <option value="LineStrip">LineStrip</option> | 367 <option value="LineStrip">LineStrip</option> |
368 <option value="TriangleList">TriangleList</option> | 368 <option value="TriangleList">TriangleList</option> |
369 <option value="TriangleStrip">TriangleStrip</option> | 369 <option value="TriangleStrip">TriangleStrip</option> |
370 <option value="TriangleFan">TriangleFan</option> | 370 <option value="TriangleFan">TriangleFan</option> |
371 </select> (PointList might be hard to see.) | 371 </select> |
372 </p> | 372 </p> |
373 | 373 |
374 <p> | 374 <p> |
375 Fill mode: | 375 Fill mode: |
376 <select onchange="changeFillMode(this.options[this.selectedIndex].value);"> | 376 <select onchange="changeFillMode(this.options[this.selectedIndex].value);"> |
377 <option value="Point">Point</option> | 377 <option value="Point">Point</option> |
378 <option value="Wireframe">Wireframe</option> | 378 <option value="Wireframe">Wireframe</option> |
379 <option value="Solid" selected>Solid</option> | 379 <option value="Solid" selected>Solid</option> |
380 </select> | 380 </select> |
381 </p> | 381 </p> |
(...skipping 13 matching lines...) Loading... | |
395 | 395 |
396 varying vec4 pos; | 396 varying vec4 pos; |
397 | 397 |
398 /** | 398 /** |
399 * The vertex shader simply transforms the input vertices to screen space. | 399 * The vertex shader simply transforms the input vertices to screen space. |
400 */ | 400 */ |
401 void main() { | 401 void main() { |
402 // Multiply the vertex positions by the worldViewProjection matrix to | 402 // Multiply the vertex positions by the worldViewProjection matrix to |
403 // transform them to screen space. | 403 // transform them to screen space. |
404 gl_Position = projection * view * world * position; | 404 gl_Position = projection * view * world * position; |
405 // Make points larger, so they can been seen. | |
406 gl_PointSize = 5.0; | |
petersont
2010/07/27 21:49:09
You can do that?
| |
405 pos = position; | 407 pos = position; |
406 } | 408 } |
407 </textarea> | 409 </textarea> |
408 <textarea id="pshader"> | 410 <textarea id="pshader"> |
409 varying vec4 pos; | 411 varying vec4 pos; |
410 | 412 |
411 /** | 413 /** |
412 * The fragment shader derives color based on the position. | 414 * The fragment shader derives color based on the position. |
413 */ | 415 */ |
414 void main() { | 416 void main() { |
415 gl_FragColor = pos; | 417 gl_FragColor = pos; |
416 } | 418 } |
417 </textarea> | 419 </textarea> |
418 <!-- End of effect --> | 420 <!-- End of effect --> |
419 </div> | 421 </div> |
420 </body> | 422 </body> |
421 </html> | 423 </html> |
422 | 424 |
OLD | NEW |