Skip to content
Snippets Groups Projects
Commit b0f0a197 authored by ah3472's avatar ah3472
Browse files

html stuff

parent 1403267d
No related branches found
No related tags found
No related merge requests found
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Sample Project</title>
</head>
<body>
<script id="vertex-shader" type="x-shader/x-vertex">
attribute vec2 aVertexPosition;
uniform vec2 uScalingFactor;
uniform vec2 uRotationVector;
void main() {
vec2 rotatedPosition = vec2(
aVertexPosition.x * u.RotationVector.y + aVertexPosition.y * uRotationVector.x,
aVertexPosition.y * uRotationVector.y - aVertexPosition.x * uRotationVector.x,
);
gl_Position = vec4(rotatedPosition * uScalingFactor, 0, 1);
}
</script>
<script id="fragment-shader" type="x-shader/x-fragment">
#ifdef GL_ES
precision highp float;
#endif
uniform vec4 uGlobalColor;
void main() {
gl_FragColor = uGlobalColor;
}
</script>
<canvas id="glCanvas" width="640" height="480"></canvas>
<script src="webgl_test.js">
</script>
</body>
</html>
\ No newline at end of file
/*const vsSource = `
attribute vec4 aVertexPosition;
uniform mat4 uModelViewMatrix;
uniform mat4 uProjectionMatrix;
void main() {
gl_Position = uProjectionMatrix * uModelViewMatrix * aVertexPosition;
}
`
function main() {
const canvas = document.querySelector("#glCanvas");
const gl = canvas.getContext("webgl");
if (gl === null) {
alert("Unable to initialize WebGL. Your browser or machine may not support it.");
return;
}
gl.clearColor(0, 0, 0, 1)
gl.clear(gl.COLOR_BUFFER_BIT);
}
window.onload = main;*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment