content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-smoothstep-float.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/canvas/test/webgl-conformance/conformance/glsl/functions/glsl-function-smoothstep-float.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,54 @@
     1.4 +<!--
     1.5 +Copyright (c) 2011 The Chromium Authors. All rights reserved.
     1.6 +Use of this source code is governed by a BSD-style license that can be
     1.7 +found in the LICENSE file.
     1.8 + -->
     1.9 +<!DOCTYPE html>
    1.10 +<html>
    1.11 +<head>
    1.12 +<meta charset="utf-8">
    1.13 +  <title>GLSL smoothstep-gentype function test</title>
    1.14 +  <link rel="stylesheet" href="../../../resources/js-test-style.css"/>
    1.15 +  <link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/>
    1.16 +  <script src="../../../resources/js-test-pre.js"></script>
    1.17 +  <script src="../../resources/webgl-test.js"> </script>
    1.18 +  <script src="../../resources/webgl-test-utils.js"> </script>
    1.19 +  <script src="../../resources/glsl-generator.js"> </script>
    1.20 +</head>
    1.21 +<body>
    1.22 +<div id="description"></div>
    1.23 +<div id="console"></div>
    1.24 +<script>
    1.25 +
    1.26 +
    1.27 +GLSLGenerator.runFeatureTest({
    1.28 +  feature: "smoothstep",
    1.29 +  args: "float edge0, float edge1, $(type) value",
    1.30 +  baseArgs: "edge0, edge1, value$(field)",
    1.31 +  testFunc: "$(func)(float, float, $(type))",
    1.32 +  emuFunc: ["float $(func)_base(float edge0, float edge1, float value) {",
    1.33 +            "  float t = clamp((value - edge0) / (edge1 - edge0), 0.0, 1.0);",
    1.34 +            "  return t * t * (3.0 - 2.0 * t);",
    1.35 +            "}"].join("\n"),
    1.36 +  gridRes: 8,
    1.37 +  tests: [
    1.38 +    ["$(output) = vec4(",
    1.39 +     "    $(func)(0.3, 0.7, $(input).x),",
    1.40 +     "    $(func)(0.2, 0.8, $(input).y),",
    1.41 +     "    0,",
    1.42 +     "    1);"].join("\n"),
    1.43 +    ["$(output) = vec4(",
    1.44 +     "    $(func)(0.4, 0.8, $(input).xy),",
    1.45 +     "    0, 1);"].join("\n"),
    1.46 +    ["$(output) = vec4(",
    1.47 +     "    $(func)(0.3, 0.7, $(input).xyz),",
    1.48 +     "    1);"].join("\n"),
    1.49 +    ["$(output) = ",
    1.50 +     "    $(func)(0.3, 0.9, $(input));"].join("\n")
    1.51 +  ]
    1.52 +});
    1.53 +successfullyParsed = true;
    1.54 +</script>
    1.55 +</body>
    1.56 +</html>
    1.57 +

mercurial