diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 17:32:43 +0000 |
commit | 6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch) | |
tree | a68f146d7fa01f0134297619fbe7e33db084e0aa /third_party/webkit/PerformanceTests/MotionMark/tests/3d/webgl.html | |
parent | Initial commit. (diff) | |
download | thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip |
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/webkit/PerformanceTests/MotionMark/tests/3d/webgl.html')
-rw-r--r-- | third_party/webkit/PerformanceTests/MotionMark/tests/3d/webgl.html | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/third_party/webkit/PerformanceTests/MotionMark/tests/3d/webgl.html b/third_party/webkit/PerformanceTests/MotionMark/tests/3d/webgl.html new file mode 100644 index 0000000000..cf6442a07a --- /dev/null +++ b/third_party/webkit/PerformanceTests/MotionMark/tests/3d/webgl.html @@ -0,0 +1,64 @@ +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8"> + <link rel="stylesheet" type="text/css" href="../resources/stage.css"> +</head> +<body> + <canvas id="stage"></canvas> + <script id="vertex" type="x-shader/x-glsl"> +attribute vec4 position; +attribute vec4 color; + +uniform float scale; +uniform float time; +uniform float offsetX; +uniform float offsetY; +uniform float scalar; +uniform float scalarOffset; + +varying vec4 v_color; + +void main() { + + float fade = mod(scalarOffset + time * scalar / 10.0, 1.0); + + if (fade < 0.5) { + fade = fade * 2.0; + } else { + fade = (1.0 - fade) * 2.0; + } + + float xpos = position.x * scale; + float ypos = position.y * scale; + + float angle = 3.14159 * 2.0 * fade; + float xrot = xpos * cos(angle) - ypos * sin(angle); + float yrot = xpos * sin(angle) + ypos * cos(angle); + + xpos = xrot + offsetX; + ypos = yrot + offsetY; + + v_color = vec4(fade, 1.0 - fade, 0.0, 1.0) + color; + gl_Position = vec4(xpos, ypos, 0.0, 1.0); +} + </script> + <script id="fragment" type="x-shader/x-glsl"> +#ifdef GL_ES +precision mediump float; +#endif + +varying vec4 v_color; + +void main() { + gl_FragColor = v_color; +} + </script> + <script src="../../resources/strings.js"></script> + <script src="../../resources/extensions.js"></script> + <script src="../../resources/statistics.js"></script> + <script src="../resources/math.js"></script> + <script src="../resources/main.js"></script> + <script src="resources/webgl.js"></script> +</body> +</html> |