summaryrefslogtreecommitdiffstats
path: root/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan
diff options
context:
space:
mode:
Diffstat (limited to 'dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan')
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/input.run.txt2
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_001_to_006.html109
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary.frag25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary_ref.frag24
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary.vert26
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary_ref.vert25
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary.frag30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary_ref.frag30
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary.vert31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary_ref.vert31
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary.frag35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary_ref.frag35
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary.vert36
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary_ref.vert36
14 files changed, 475 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/input.run.txt b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/input.run.txt
new file mode 100644
index 0000000000..443a00f700
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/input.run.txt
@@ -0,0 +1,2 @@
+# this file is auto-generated. DO NOT EDIT.
+tan_001_to_006.html
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_001_to_006.html b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_001_to_006.html
new file mode 100644
index 0000000000..25451bfc5c
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_001_to_006.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<!-- this file is auto-generated. DO NOT EDIT. -->
+<!--
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+-->
+<html>
+<head>
+<meta charset="utf-8">
+<title>WebGL GLSL conformance test: tan_001_to_006.html</title>
+<link rel="stylesheet" href="../../../../resources/js-test-style.css" />
+<link rel="stylesheet" href="../../../../resources/ogles-tests.css" />
+<script src="../../../../js/js-test-pre.js"></script>
+<script src="../../../../js/webgl-test-utils.js"></script>
+<script src="../../ogles-utils.js"></script>
+</head>
+<body>
+<canvas id="example" width="500" height="500" style="width: 16px; height: 16px;"></canvas>
+<div id="description"></div>
+<div id="console"></div>
+</body>
+<script>
+"use strict";
+OpenGLESTestRunner.run({
+ "tests": [
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "tan_float_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "tan_float_frag_xvary.frag"
+ },
+ "name": "tan_float_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "tan_vec2_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "tan_vec2_frag_xvary.frag"
+ },
+ "name": "tan_vec2_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "tan_vec3_frag_xvary_ref.frag"
+ },
+ "model": null,
+ "testProgram": {
+ "vertexShader": "../default/default.vert",
+ "fragmentShader": "tan_vec3_frag_xvary.frag"
+ },
+ "name": "tan_vec3_frag_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "tan_float_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "tan_float_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "tan_float_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "tan_vec2_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "tan_vec2_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "tan_vec2_vert_xvary.test.html",
+ "pattern": "compare"
+ },
+ {
+ "referenceProgram": {
+ "vertexShader": "tan_vec3_vert_xvary_ref.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "model": "grid",
+ "testProgram": {
+ "vertexShader": "tan_vec3_vert_xvary.vert",
+ "fragmentShader": "../default/default.frag"
+ },
+ "name": "tan_vec3_vert_xvary.test.html",
+ "pattern": "compare"
+ }
+ ]
+});
+var successfullyParsed = true;
+</script>
+</html>
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary.frag
new file mode 100644
index 0000000000..6235d05d08
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary.frag
@@ -0,0 +1,25 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 0.5 * M_PI * 2.0 * (color.r - 0.5);
+ float o;
+
+ if(abs(c) < 0.5) // -45..45
+ o = 0.5 * tan(c) + 0.5;
+ else // 45..90, -45..-90
+ o = 0.5 / tan(c) + 0.5;
+ gl_FragColor = vec4(o, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary_ref.frag
new file mode 100644
index 0000000000..308e399685
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_frag_xvary_ref.frag
@@ -0,0 +1,24 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 0.5 * M_PI * 2.0 * (color.r - 0.5);
+ float o;
+ if(abs(c) < 0.5) // -45..45
+ o = 0.5 * (sin(c) / cos(c)) + 0.5;
+ else // 45..90, -45..-90
+ o = 0.5 * (cos(c) / sin(c)) + 0.5;
+ gl_FragColor = vec4(o, 0.0, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary.vert
new file mode 100644
index 0000000000..3a2bfc0968
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary.vert
@@ -0,0 +1,26 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 0.5 * M_PI * 2.0 * (gtf_Color.r - 0.5);
+ float o;
+
+ if(abs(c) < 0.5) // -45..45
+ o = 0.5 * tan(c) + 0.5;
+ else // 45..90, -45..-90
+ o = 0.5 / tan(c) + 0.5;
+ color = vec4(o, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary_ref.vert
new file mode 100644
index 0000000000..074502f61d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_float_vert_xvary_ref.vert
@@ -0,0 +1,25 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ float c = 0.5 * M_PI * 2.0 * (gtf_Color.r - 0.5);
+ float o;
+ if(abs(c) < 0.5) // -45..45
+ o = 0.5 * (sin(c) / cos(c)) + 0.5;
+ else // 45..90, -45..-90
+ o = 0.5 * (cos(c) / sin(c)) + 0.5;
+ color = vec4(o, 0.0, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary.frag
new file mode 100644
index 0000000000..523a66208b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary.frag
@@ -0,0 +1,30 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 0.5 * M_PI * 2.0 * (color.rg - 0.5);
+ vec2 o;
+ if(abs(c.r) < 0.5) // -45..45
+ o.r = 0.5 * tan(c.r) + 0.5;
+ else // 45..90, -45..-90
+ o.r = 0.5 / tan(c.r) + 0.5;
+
+ if(abs(c.g) < 0.5) // -45..45
+ o.g = 0.5 * tan(c.g) + 0.5;
+ else // 45..90, -45..-90
+ o.g = 0.5 / tan(c.g) + 0.5;
+
+ gl_FragColor = vec4(o, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary_ref.frag
new file mode 100644
index 0000000000..5cf357da34
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_frag_xvary_ref.frag
@@ -0,0 +1,30 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 0.5 * M_PI * 2.0 * (color.rg - 0.5);
+ vec2 o;
+ if(abs(c.r) < 0.5) // -45..45
+ o.r = 0.5 * (sin(c.r) / cos(c.r)) + 0.5;
+ else // 45..90, -45..-90
+ o.r = 0.5 * (cos(c.r) / sin(c.r)) + 0.5;
+
+ if(abs(c.g) < 0.5) // -45..45
+ o.g = 0.5 * (sin(c.g) / cos(c.g)) + 0.5;
+ else // 45..90, -45..-90
+ o.g = 0.5 * (cos(c.g) / sin(c.g)) + 0.5;
+
+ gl_FragColor = vec4(o, 0.0, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary.vert
new file mode 100644
index 0000000000..7c04171302
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary.vert
@@ -0,0 +1,31 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 0.5 * M_PI * 2.0 * (gtf_Color.rg - 0.5);
+ vec2 o;
+ if(abs(c.r) < 0.5) // -45..45
+ o.r = 0.5 * tan(c.r) + 0.5;
+ else // 45..90, -45..-90
+ o.r = 0.5 / tan(c.r) + 0.5;
+
+ if(abs(c.g) < 0.5) // -45..45
+ o.g = 0.5 * tan(c.g) + 0.5;
+ else // 45..90, -45..-90
+ o.g = 0.5 / tan(c.g) + 0.5;
+
+ color = vec4(o, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary_ref.vert
new file mode 100644
index 0000000000..01b0079917
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec2_vert_xvary_ref.vert
@@ -0,0 +1,31 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec2 c = 0.5 * M_PI * 2.0 * (gtf_Color.rg - 0.5);
+ vec2 o;
+ if(abs(c.r) < 0.5) // -45..45
+ o.r = 0.5 * (sin(c.r) / cos(c.r)) + 0.5;
+ else // 45..90, -45..-90
+ o.r = 0.5 * (cos(c.r) / sin(c.r)) + 0.5;
+
+ if(abs(c.g) < 0.5) // -45..45
+ o.g = 0.5 * (sin(c.g) / cos(c.g)) + 0.5;
+ else // 45..90, -45..-90
+ o.g = 0.5 * (cos(c.g) / sin(c.g)) + 0.5;
+
+ color = vec4(o, 0.0, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary.frag
new file mode 100644
index 0000000000..4f1c5cdad7
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary.frag
@@ -0,0 +1,35 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 0.5 * M_PI * 2.0 * (color.rgb - 0.5);
+ vec3 o;
+ if(abs(c.r) < 0.5) // -45..45
+ o.r = 0.5 * tan(c.r) + 0.5;
+ else // 45..90, -45..-90
+ o.r = 0.5 / tan(c.r) + 0.5;
+
+ if(abs(c.g) < 0.5) // -45..45
+ o.g = 0.5 * tan(c.g) + 0.5;
+ else // 45..90, -45..-90
+ o.g = 0.5 / tan(c.g) + 0.5;
+
+ if(abs(c.b) < 0.5) // -45..45
+ o.b = 0.5 * tan(c.b) + 0.5;
+ else // 45..90, -45..-90
+ o.b = 0.5 / tan(c.b) + 0.5;
+
+ gl_FragColor = vec4(o, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary_ref.frag
new file mode 100644
index 0000000000..4e3f7bd792
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_frag_xvary_ref.frag
@@ -0,0 +1,35 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+#ifdef GL_ES
+precision mediump float;
+#endif
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 0.5 * M_PI * 2.0 * (color.rgb - 0.5);
+ vec3 o;
+ if(abs(c.r) < 0.5) // -45..45
+ o.r = 0.5 * (sin(c.r) / cos(c.r)) + 0.5;
+ else // 45..90, -45..-90
+ o.r = 0.5 * (cos(c.r) / sin(c.r)) + 0.5;
+
+ if(abs(c.g) < 0.5) // -45..45
+ o.g = 0.5 * (sin(c.g) / cos(c.g)) + 0.5;
+ else // 45..90, -45..-90
+ o.g = 0.5 * (cos(c.g) / sin(c.g)) + 0.5;
+
+ if(abs(c.b) < 0.5) // -45..45
+ o.b = 0.5 * (sin(c.b) / cos(c.b)) + 0.5;
+ else // 45..90, -45..-90
+ o.b = 0.5 * (cos(c.b) / sin(c.b)) + 0.5;
+
+ gl_FragColor = vec4(o, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary.vert
new file mode 100644
index 0000000000..0fdecde16d
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary.vert
@@ -0,0 +1,36 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 0.5 * M_PI * 2.0 * (gtf_Color.rgb - 0.5);
+ vec3 o;
+ if(abs(c.r) < 0.5) // -45..45
+ o.r = 0.5 * tan(c.r) + 0.5;
+ else // 45..90, -45..-90
+ o.r = 0.5 / tan(c.r) + 0.5;
+
+ if(abs(c.g) < 0.5) // -45..45
+ o.g = 0.5 * tan(c.g) + 0.5;
+ else // 45..90, -45..-90
+ o.g = 0.5 / tan(c.g) + 0.5;
+
+ if(abs(c.b) < 0.5) // -45..45
+ o.b = 0.5 * tan(c.b) + 0.5;
+ else // 45..90, -45..-90
+ o.b = 0.5 / tan(c.b) + 0.5;
+
+ color = vec4(o, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary_ref.vert
new file mode 100644
index 0000000000..8f38b30f87
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL/tan/tan_vec3_vert_xvary_ref.vert
@@ -0,0 +1,36 @@
+
+/*
+Copyright (c) 2019 The Khronos Group Inc.
+Use of this source code is governed by an MIT-style license that can be
+found in the LICENSE.txt file.
+*/
+
+
+attribute vec4 gtf_Color;
+attribute vec4 gtf_Vertex;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+varying vec4 color;
+
+void main (void)
+{
+ const float M_PI = 3.14159265358979323846;
+ vec3 c = 0.5 * M_PI * 2.0 * (gtf_Color.rgb - 0.5);
+ vec3 o;
+ if(abs(c.r) < 0.5) // -45..45
+ o.r = 0.5 * (sin(c.r) / cos(c.r)) + 0.5;
+ else // 45..90, -45..-90
+ o.r = 0.5 * (cos(c.r) / sin(c.r)) + 0.5;
+
+ if(abs(c.g) < 0.5) // -45..45
+ o.g = 0.5 * (sin(c.g) / cos(c.g)) + 0.5;
+ else // 45..90, -45..-90
+ o.g = 0.5 * (cos(c.g) / sin(c.g)) + 0.5;
+
+ if(abs(c.b) < 0.5) // -45..45
+ o.b = 0.5 * (sin(c.b) / cos(c.b)) + 0.5;
+ else // 45..90, -45..-90
+ o.b = 0.5 * (cos(c.b) / sin(c.b)) + 0.5;
+
+ color = vec4(o, 1.0);
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}