summaryrefslogtreecommitdiffstats
path: root/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick.frag46
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat2.vert45
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat3.vert45
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat4.vert45
-rw-r--r--dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_vec.vert48
5 files changed, 229 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick.frag
new file mode 100644
index 0000000000..b251b07f03
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick.frag
@@ -0,0 +1,46 @@
+
+/*
+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
+uniform float mortarThickness;
+uniform vec3 brickColor;
+uniform vec3 mortarColor;
+
+uniform float brickMortarWidth;
+uniform float brickMortarHeight;
+uniform float mwf;
+uniform float mhf;
+
+varying vec3 Position;
+varying float lightIntensity;
+
+void main (void)
+{
+ vec3 ct;
+ float ss, tt, w, h;
+
+ vec3 pos = Position;
+
+ ss = pos.x / brickMortarWidth;
+ tt = pos.z / brickMortarHeight;
+
+ if (fract (tt * 0.5) > 0.5)
+ ss += 0.5;
+
+ ss = fract (ss);
+ tt = fract (tt);
+
+ w = step (mwf, ss) - step (1.0 - mwf, ss);
+ h = step (mhf, tt) - step (1.0 - mhf, tt);
+
+ ct = clamp(mix (mortarColor, brickColor, w * h) * lightIntensity, 0.0, 1.0);
+
+ gl_FragColor = vec4 (ct, 1.0);
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat2.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat2.vert
new file mode 100644
index 0000000000..17102a01c5
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat2.vert
@@ -0,0 +1,45 @@
+
+/*
+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_Vertex;
+attribute vec3 gtf_Normal;
+attribute mat2 myAttrib2m;
+
+uniform mat3 gtf_NormalMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ float f = myAttrib2m[0][0];
+
+ float spec = clamp(dot(reflectVec, viewVec), f, 1.0);
+ //float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat3.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat3.vert
new file mode 100644
index 0000000000..d6fea1125b
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat3.vert
@@ -0,0 +1,45 @@
+
+/*
+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_Vertex;
+attribute vec3 gtf_Normal;
+attribute mat3 myAttrib3m;
+
+uniform mat3 gtf_NormalMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ float f = myAttrib3m[0][0];
+
+ float spec = clamp(dot(reflectVec, viewVec), f, 1.0);
+ //float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat4.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat4.vert
new file mode 100644
index 0000000000..5c28d78aaf
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_mat4.vert
@@ -0,0 +1,45 @@
+
+/*
+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_Vertex;
+attribute vec3 gtf_Normal;
+attribute mat4 myAttrib4m;
+
+uniform mat3 gtf_NormalMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ float f = myAttrib4m[0][0];
+
+ float spec = clamp(dot(reflectVec, viewVec), f, 1.0);
+ //float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_vec.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_vec.vert
new file mode 100644
index 0000000000..c36a4e1133
--- /dev/null
+++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2Tests/get_active_attribute/brick_vec.vert
@@ -0,0 +1,48 @@
+
+/*
+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_Vertex;
+attribute vec3 gtf_Normal;
+attribute float myAttrib1f;
+attribute vec2 myAttrib2f;
+attribute vec3 myAttrib3f;
+attribute vec4 myAttrib4f;
+
+uniform mat3 gtf_NormalMatrix;
+varying float lightIntensity;
+varying vec3 Position;
+uniform vec3 LightPosition;
+
+uniform mat4 gtf_ModelViewMatrix;
+uniform mat4 gtf_ModelViewProjectionMatrix;
+
+const float specularContribution = 0.7;
+const float diffuseContribution = (1.0 - specularContribution);
+
+void main(void) {
+ vec4 pos = gtf_ModelViewMatrix * gtf_Vertex;
+ Position = vec3(gtf_Vertex);
+ vec3 tnorm = normalize(gtf_NormalMatrix * gtf_Normal);
+ vec3 lightVec = normalize(LightPosition - vec3(pos));
+ vec3 reflectVec = reflect(lightVec, tnorm);
+ vec3 viewVec = normalize(vec3(pos));
+
+ float f = myAttrib1f + myAttrib2f[0] + myAttrib3f[0] + myAttrib4f[0];
+
+ float spec = clamp(dot(reflectVec, viewVec), f, 1.0);
+ //float spec = clamp(dot(reflectVec, viewVec), myAttribute1, myAttribute2);
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+ spec = spec * spec;
+
+ lightIntensity = diffuseContribution * dot(lightVec, tnorm) +
+ specularContribution * spec;
+
+ gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex;
+}