let opengl print an triangle

This commit is contained in:
Julian
2020-01-21 20:37:48 +01:00
parent 8aaf31c114
commit 1c6a499127
2 changed files with 142 additions and 11 deletions

View File

@@ -2,6 +2,21 @@
<html>
<header>
<title>Web Ocean</title>
<script id="shader-fs" type="x-shader/x-fragment">
precision mediump float;
void main(void) {
gl_FragColor = vec4(0.6,0.6,0.6,1.0);
}
</script>
<script id="shader-vs" type="x-shader/x-vertex">
attribute vec3 positionAttr;
void main(void) {
gl_Position = vec4(positionAttr, 1.0);
}
</script>
</header>
<body>
<canvas id="window" width="800" height="600" style="margin:0 auto; border: solid #000000 1px; display:block;"></canvas>