Advertisement
vitareinforce

index.html

Jan 25th, 2022
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>
  4. GPU IF
  5. </title>
  6. </head>
  7. <body>
  8. <canvas id="c"></canvas>
  9. <script id="vertex-shader-2d" type="notjs">
  10.  
  11. // an attribute will receive data from a buffer
  12. attribute vec4 a_position;
  13.  
  14. // all shaders have a main function
  15. void main() {
  16.  
  17. // gl_Position is a special variable a vertex shader
  18. // is responsible for setting
  19. gl_Position = a_position;
  20. }
  21.  
  22. </script>
  23.  
  24. <script id="fragment-shader-2d" type="notjs">
  25.  
  26. // fragment shaders don't have a default precision so we need
  27. // to pick one. mediump is a good default
  28. precision mediump float;
  29.  
  30. void main() {
  31. // gl_FragColor is a special variable a fragment shader
  32. // is responsible for setting
  33. gl_FragColor = vec4(1, 0, 0.5, 1); // return reddish-purple
  34. }
  35.  
  36. </script>
  37. <script src="https://webglfundamentals.org/webgl/resources/webgl-utils.js"></script>
  38. <script src="script.js"></script>
  39. </body>
  40. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement