OLD | NEW |
(Empty) | |
| 1 <!-- |
| 2 Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 Use of this source code is governed by a BSD-style license that can be |
| 4 found in the LICENSE file. |
| 5 --> |
| 6 <!DOCTYPE html> |
| 7 <html> |
| 8 <head> |
| 9 <meta charset="utf-8"> |
| 10 <title>GLSL faceforward function test</title> |
| 11 <link rel="stylesheet" href="../../../resources/js-test-style.css"/> |
| 12 <link rel="stylesheet" href="../../resources/glsl-feature-tests.css"/> |
| 13 <script src="../../../resources/js-test-pre.js"></script> |
| 14 <script src="../../resources/webgl-test.js"> </script> |
| 15 <script src="../../resources/webgl-test-utils.js"> </script> |
| 16 <script src="../../resources/glsl-generator.js"> </script> |
| 17 </head> |
| 18 <body> |
| 19 <div id="description"></div> |
| 20 <div id="console"></div> |
| 21 <script> |
| 22 |
| 23 GLSLGenerator.runFeatureTest({ |
| 24 feature: "faceforward", |
| 25 args: "$(type) N, $(type) I, $(type) Nref", |
| 26 baseArgs: "value$(field)", |
| 27 testFunc: "$(func)($(type),$(type),$(type))", |
| 28 simpleEmu: [ |
| 29 "$(type) $(func)_emu($(args)) {", |
| 30 " return dot(Nref, I) < 0.0 ? N : -N;", |
| 31 "}"].join("\n"), |
| 32 gridRes: 8, |
| 33 tests: [ |
| 34 ["$(output) = vec4(", |
| 35 " $(func)(", |
| 36 " $(input).x * 2.0 - 1.0,", |
| 37 " $(input).y * 2.0 - 1.0,", |
| 38 " $(input).z * 2.0 - 1.0),", |
| 39 " 0,", |
| 40 " 0,", |
| 41 " 1);"].join("\n"), |
| 42 ["$(output) = vec4(", |
| 43 " $(func)(", |
| 44 " $(input).xy * 2.0 - 1.0,", |
| 45 " $(input).yz * 2.0 - 1.0,", |
| 46 " $(input).zw * 2.0 - 1.0),", |
| 47 " 0, 1);"].join("\n"), |
| 48 ["$(output) = vec4(", |
| 49 " $(func)(", |
| 50 " $(input).xyz * 2.0 - 1.0,", |
| 51 " $(input).yzw * 2.0 - 1.0,", |
| 52 " $(input).zwx * 2.0 - 1.0),", |
| 53 " 1);"].join("\n"), |
| 54 ["$(output) = ", |
| 55 " $(func)(", |
| 56 " $(input).xyzw * 2.0 - 1.0,", |
| 57 " $(input).yzwx * 2.0 - 1.0,", |
| 58 " $(input).zwxy * 2.0 - 1.0);" |
| 59 ].join("\n") |
| 60 ] |
| 61 }); |
| 62 successfullyParsed = true; |
| 63 </script> |
| 64 </body> |
| 65 </html> |
| 66 |
| 67 |
OLD | NEW |