Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>
- GPU IF
- </title>
- </head>
- <body>
- <canvas id="c"></canvas>
- <script id="vertex-shader-2d" type="notjs">
- // an attribute will receive data from a buffer
- attribute vec4 a_position;
- // all shaders have a main function
- void main() {
- // gl_Position is a special variable a vertex shader
- // is responsible for setting
- gl_Position = a_position;
- }
- </script>
- <script id="fragment-shader-2d" type="notjs">
- // fragment shaders don't have a default precision so we need
- // to pick one. mediump is a good default
- precision mediump float;
- void main() {
- // gl_FragColor is a special variable a fragment shader
- // is responsible for setting
- gl_FragColor = vec4(1, 0, 0.5, 1); // return reddish-purple
- }
- </script>
- <script src="https://webglfundamentals.org/webgl/resources/webgl-utils.js"></script>
- <script src="script.js"></script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement