diff options
Diffstat (limited to 'dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests')
21 files changed, 647 insertions, 0 deletions
diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.frag new file mode 100644 index 0000000000..ff3ef82b98 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.frag @@ -0,0 +1,19 @@ + +/* +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 sampler2D gtf_Texture0; +varying vec4 color; +varying vec4 gtf_TexCoord[1]; + +void main (void) +{ + gl_FragColor = texture2D(gtf_Texture0, gtf_TexCoord[0].st, 1.0) * color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.vert new file mode 100644 index 0000000000..9b8f753d58 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects.vert @@ -0,0 +1,144 @@ + +/* +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; +attribute vec3 gtf_Normal; +attribute vec4 gtf_MultiTexCoord0; + +uniform mat4 gtf_ModelViewProjectionMatrix; +uniform mat3 gtf_NormalMatrix; + +varying vec4 gtf_TexCoord[1]; +varying vec4 color; + +vec4 Ambient; +vec4 Diffuse; +vec4 Specular; + +const vec3 lightPosition = vec3(0.0, 0.0, 1.0); +const vec3 spotDirection = vec3(0.0, 0.0, -1.0); +const float spotCutoff = 180.0; +const float spotExponent = 0.0; + +const float lightAttenuationConstant = 1.0; +const float lightAttenuationLinear = 0.0; +const float lightAttenuationQuadratic = 0.0; + +const vec4 lightAmbient = vec4(0.0, 0.0, 0.0, 0.0); +vec4 lightDiffuse = vec4(1.0, 1.0, 1.0, 1.0); +vec4 lightSpecular = vec4(1.0, 1.0, 1.0, 1.0); + +const float materialShininess = 0.0; + +const vec4 sceneColor = vec4(0.0, 0.0, 0.0, 0.0); + +void spotLight(in int i, + in vec3 normal, + in vec3 eye, + in vec3 ecPosition3 + ) +{ + float nDotVP; // normal . light direction + float nDotHV; // normal . light half vector + float pf; // power factor + float spotDot; // cosine of angle between spotlight + float spotAttenuation; // spotlight attenuation factor + float attenuation; // computed attenuation factor + float d; // distance from surface to light source + vec3 VP; // direction from surface to light position + vec3 halfVector; // direction of maximum highlights + + // Compute vector from surface to light position + VP = lightPosition - ecPosition3; + + // Compute distance between surface and light position + d = length(VP); + + // Normalize the vector from surface to light position + VP = normalize(VP); + + // Compute attenuation + attenuation = 1.0 / (lightAttenuationConstant + + lightAttenuationLinear * d + + lightAttenuationQuadratic * d * d); + + // See if point on surface is inside cone of illumination + spotDot = dot(-VP, normalize(spotDirection)); + + if (spotDot < cos(radians(spotCutoff))) + spotAttenuation = 0.0; // light adds no contribution + else + spotAttenuation = pow(spotDot, spotExponent); + + // Combine the spotlight and distance attenuation. + attenuation *= spotAttenuation; + + halfVector = normalize(VP + eye); + + nDotVP = max(0.0, dot(normal, VP)); + nDotHV = max(0.0, dot(normal, halfVector)); + + if (nDotVP == 0.0) + pf = 0.0; + else + pf = pow(nDotHV, materialShininess); + + Ambient += lightAmbient * attenuation; + Diffuse += lightDiffuse * nDotVP * attenuation; + Specular += lightSpecular * pf * attenuation; +} + +vec3 fnormal(void) +{ + //Compute the normal + vec3 normal = gtf_NormalMatrix * gtf_Normal; + normal = normalize(normal); + + return normal; +} + +void flight(in vec3 normal, in vec4 ecPosition, float alphaFade) +{ + vec3 ecPosition3; + vec3 eye; + + ecPosition3 = (vec3 (ecPosition)) / ecPosition.w; + eye = vec3 (0.0, 0.0, 1.0); + + // Clear the light intensity accumulators + Ambient = vec4 (0.0); + Diffuse = vec4 (0.0); + Specular = vec4 (0.0); + + //lightSpecular = gtf_Color; + + spotLight(0, normal, eye, ecPosition3); + + color = sceneColor + + Ambient * gtf_Color + + Diffuse * gtf_Color; + color += Specular * gtf_Color; + color = clamp( color, 0.0, 1.0 ); + + color.a *= alphaFade; +} + +void main (void) +{ + vec3 transformedNormal; + float alphaFade = 1.0; + + vec4 ecPosition = gtf_Vertex; + + color = gtf_Color; + gtf_TexCoord[0] = gtf_MultiTexCoord0; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + transformedNormal = fnormal(); + flight(transformedNormal, ecPosition, alphaFade); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.frag new file mode 100644 index 0000000000..509c7c1f42 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.frag @@ -0,0 +1,22 @@ + +/* +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 sampler2D gtf_Texture0; +uniform sampler2D gtf_Texture1; + +varying vec4 color; +varying vec4 gtf_TexCoord[2]; + +void main (void) +{ + gl_FragColor = texture2D(gtf_Texture0, gtf_TexCoord[0].st, 1.0); + gl_FragColor += texture2D(gtf_Texture1, gtf_TexCoord[1].st, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.vert new file mode 100644 index 0000000000..e98a85ca14 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_multitexturing.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. +*/ + + +uniform mat4 gtf_ModelViewProjectionMatrix; + +attribute vec4 gtf_Color; +attribute vec4 gtf_Vertex; +attribute vec4 gtf_MultiTexCoord0; +attribute vec4 gtf_MultiTexCoord1; + +varying vec4 color; +varying vec4 gtf_TexCoord[2]; + +void main (void) +{ + color = gtf_Color; + gtf_TexCoord[0] = gtf_MultiTexCoord0; + gtf_TexCoord[1] = gtf_MultiTexCoord1; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.frag new file mode 100644 index 0000000000..48175cd07e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.frag @@ -0,0 +1,17 @@ + +/* +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) +{ + gl_FragColor = color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.vert new file mode 100644 index 0000000000..53ffa4bf18 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/buffer_objects/buffer_objects_pointSize.vert @@ -0,0 +1,20 @@ + +/* +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; +attribute float gtf_PointSize; +uniform mat4 gtf_ModelViewProjectionMatrix; +varying vec4 color; + +void main (void) +{ + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + gl_PointSize = gtf_PointSize; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/copy_texture/copy_texture.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/copy_texture/copy_texture.frag new file mode 100644 index 0000000000..51f59a41a0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/copy_texture/copy_texture.frag @@ -0,0 +1,22 @@ + +/* +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 sampler2D gtf_Texture0; +varying vec4 color; +varying vec4 gtf_TexCoord[1]; + +void main (void) +{ + if (gtf_TexCoord[0].s == 1.0) + gl_FragColor = color; + else + gl_FragColor = texture2D(gtf_Texture0, gtf_TexCoord[0].st, 1.0); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.frag new file mode 100644 index 0000000000..48175cd07e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.frag @@ -0,0 +1,17 @@ + +/* +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) +{ + gl_FragColor = color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.vert new file mode 100644 index 0000000000..319999cb93 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default.vert @@ -0,0 +1,19 @@ + +/* +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) +{ + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + gl_PointSize = 1.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.frag new file mode 100644 index 0000000000..48cd225675 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.frag @@ -0,0 +1,19 @@ + +/* +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 sampler2D gtf_Texture0; +varying vec4 color; +varying vec4 gtf_TexCoord[1]; + +void main (void) +{ + gl_FragColor = texture2D(gtf_Texture0, gtf_TexCoord[0].xy); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.vert new file mode 100644 index 0000000000..0088a62147 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/default_shaders/default_textured.vert @@ -0,0 +1,22 @@ + +/* +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 gtf_TexCoord[1]; +attribute vec4 gtf_MultiTexCoord0; +varying vec4 color; + +void main (void) +{ + color = gtf_Color; + gtf_TexCoord[0] = gtf_MultiTexCoord0; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + gl_PointSize = 1.0; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.frag new file mode 100644 index 0000000000..55ec693c20 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.frag @@ -0,0 +1,17 @@ + +/* +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) +{ + gl_FragColor = color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.vert new file mode 100644 index 0000000000..cdccf706ec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse.vert @@ -0,0 +1,132 @@ + +/* +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. +*/ + + +uniform mat4 gtf_ModelViewMatrix; +uniform mat4 gtf_ModelViewProjectionMatrix; +uniform mat3 gtf_NormalMatrix; + +attribute vec4 gtf_Vertex; +attribute vec4 gtf_Color; +attribute vec3 gtf_Normal; + +varying vec4 color; + +vec4 Ambient; +vec4 Diffuse; +vec4 Specular; + +const vec3 lightPosition = vec3(0.0, 0.0, 10.0); +const float lightAttenuationConstant = 1.0; +const float lightAttenuationLinear = 0.0; +const float lightAttenuationQuadratic = 0.0; + +const vec4 lightAmbient = vec4(0.0, 0.0, 0.0, 0.0); +vec4 lightDiffuse = vec4(1.0, 0.0, 0.0, 1.0); + +const vec4 materialAmbient = vec4(0.0, 0.0, 0.0, 1.0); +const vec4 materialDiffuse = vec4(1.0, 1.0, 1.0, 1.0); +const vec4 materialSpecular = vec4(0.0, 0.0, 0.0, 0.0); +const float materialShininess = 20.0; + +const vec4 sceneColor = vec4(0.0, 0.0, 0.0, 0.0); + + +void pointLight(in int i, in vec3 normal, in vec3 eye, in vec3 ecPosition3) +{ + float nDotVP; // normal . light direction + float nDotHV; // normal . light half vector + float pf; // power factor + float attenuation; // computed attenuation factor + float d; // distance from surface to light source + vec3 VP; // direction from surface to light position + vec3 halfVector; // direction of maximum highlights + + // Compute vector from surface to light position + VP = lightPosition - ecPosition3; + + // Compute distance between surface and light position + d = length(VP); + + // Normalize the vector from surface to light position + VP = normalize(VP); + + // Compute attenuation + attenuation = 1.0 / (lightAttenuationConstant + + lightAttenuationLinear * d + + lightAttenuationQuadratic * d * d); + + halfVector = normalize(VP + eye); + + nDotVP = max(0.0, dot(normal, VP)); + nDotHV = max(0.0, dot(normal, halfVector)); + + if (nDotVP == 0.0) + { + pf = 0.0; + } + else + { + pf = pow(nDotHV, materialShininess); + + } + Ambient += lightAmbient * attenuation; + Diffuse += lightDiffuse * nDotVP * attenuation; +// Specular += lightSpecular * pf * attenuation; +} + +vec3 fnormal(void) +{ + //Compute the normal + vec3 normal = gtf_Normal * gtf_NormalMatrix; + normal = normalize(normal); + + // This should change to "return normal" but for this test, we force a normal pointing towards the light + // return normal + return vec3(0.0, 0.0, 1.0); +} + +void flight(in vec3 normal, in vec4 ecPosition, float alphaFade) +{ + vec3 ecPosition3; + vec3 eye; + + ecPosition3 = (vec3 (ecPosition)) / ecPosition.w; + eye = vec3 (0.0, 0.0, 1.0); + + // Clear the light intensity accumulators + Ambient = vec4 (0.0); + Diffuse = vec4 (0.0); + Specular = vec4 (0.0); + + lightDiffuse = gtf_Color; + + pointLight(0, normal, eye, ecPosition3); + + color = sceneColor + + Ambient * materialAmbient + + Diffuse * materialDiffuse; + color += Specular * materialSpecular; + color = clamp( color, 0.0, 1.0 ); + + color.a *= alphaFade; +} + + +void main (void) +{ + vec3 transformedNormal; + float alphaFade = 1.0; + + // Eye-coordinate position of vertex, needed in various calculations + vec4 ecPosition = gtf_ModelViewMatrix * gtf_Vertex; + + // Do fixed functionality vertex transform + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + transformedNormal = fnormal(); + flight(transformedNormal, ecPosition, alphaFade); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.frag new file mode 100644 index 0000000000..48175cd07e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.frag @@ -0,0 +1,17 @@ + +/* +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) +{ + gl_FragColor = color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.vert new file mode 100644 index 0000000000..7d58312714 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/lighting_diffuse/lighting_diffuse_ref.vert @@ -0,0 +1,18 @@ + +/* +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) +{ + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.frag new file mode 100644 index 0000000000..48175cd07e --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.frag @@ -0,0 +1,17 @@ + +/* +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) +{ + gl_FragColor = color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.vert new file mode 100644 index 0000000000..b4e21c7d50 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_rasterization/point_rasterization.vert @@ -0,0 +1,20 @@ + +/* +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; +uniform float gtf_PointSize; +varying vec4 color; + +void main (void) +{ + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + gl_PointSize = gtf_PointSize; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.frag new file mode 100644 index 0000000000..f5da783f45 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.frag @@ -0,0 +1,14 @@ + +/* +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. +*/ + + +uniform sampler2D gtf_Texture0; + +void main (void) +{ + gl_FragColor = texture2D(gtf_Texture0, gl_PointCoord.st); +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.vert new file mode 100644 index 0000000000..8123bf829f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/point_sprites/point_sprites.vert @@ -0,0 +1,17 @@ + +/* +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 float gtf_PointSize; +uniform mat4 gtf_ModelViewProjectionMatrix; + +void main (void) +{ + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + gl_PointSize = gtf_PointSize; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.frag b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.frag new file mode 100644 index 0000000000..d332207839 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.frag @@ -0,0 +1,22 @@ + +/* +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; +varying float dotClip[2]; + +void main (void) +{ + if (dotClip[0] >= 0.0 || dotClip[1] >= 0.0) + discard; + + gl_FragColor = color; +} diff --git a/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.vert b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.vert new file mode 100644 index 0000000000..48d13d3d8a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/conformance/ogles/GL2FixedTests/user_clip_planes/user_clip_planes.vert @@ -0,0 +1,27 @@ + +/* +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; + +varying float dotClip[2]; + +void main (void) +{ + vec4 userClipPlanes[2]; + userClipPlanes[0] = vec4(0.0, 1.0, 0.0, 0.0); + userClipPlanes[1] = vec4(-1.0, 0.0, 0.0, 0.0); + + color = gtf_Color; + gl_Position = gtf_ModelViewProjectionMatrix * gtf_Vertex; + + dotClip[0] = dot(userClipPlanes[0], gl_Position); + dotClip[1] = dot(userClipPlanes[1], gl_Position); +} |