44 Commits

Author SHA1 Message Date
Zack Gomez
aed92542c6 allow setting null textures to sampler arrays 2023-03-17 01:01:23 +09:00
Gregg Tavares
f113b4dcca Allow binding null for texture via setUniforms 2022-11-28 07:59:43 -08:00
Gregg Tavares
a5cf37cd0f add createPrograms, createProgramInfos, createProgramsAsync, and createProgramInfosAsync 2022-10-21 22:22:36 -07:00
Gregg Tavares
aec377cf66 fix types 2022-10-18 14:54:25 -07:00
Gregg Tavares
20a2d8016a cleanup 2022-10-18 09:42:43 -07:00
Gregg Tavares
6bab1b51ed test examples 2022-09-30 20:44:17 -07:00
Gregg Tavares
1e81747d9a fix isX so passing in a non-object returns false 2022-09-30 16:45:19 -07:00
Gregg Tavares
22ca57dcaa add helper tests 2022-09-27 10:20:24 -07:00
Gregg Tavares
2cd51db876 4.x => 5.x 2022-09-10 23:05:13 -07:00
Gregg Tavares
675f9253e9 set drawBuffers 2022-07-07 14:26:40 -07:00
Gregg Tavares
412535bdf8 handle only value attributes 2022-07-03 17:20:07 -07:00
Gregg Tavares
dda1603785 update mocha 2022-06-23 00:07:48 -07:00
Gregg Tavares
81908bacf9 add timeout support 2022-06-12 18:23:09 -07:00
Gregg Tavares
c95eb78e43 fix bugs in programs.js that async introduced 2022-06-12 18:22:55 -07:00
Gregg Tavares
14917f801a add async compilation 2022-06-11 20:36:52 -07:00
Gregg Tavares
297e0d15de add samples to AttachmentOptions 2022-03-24 21:49:45 -07:00
Gregg Tavares
f8141e996f move old tests to new test harness 2021-09-27 13:32:02 -07:00
Gregg Tavares
438fb4a117 typo 2021-09-27 12:04:47 -07:00
Gregg Tavares
81fef1221b add support for partial uniform paths 2021-09-26 18:26:42 -07:00
Gregg Tavares
4853c9eed0 add support uniform structs/arrays 2021-09-26 16:28:09 -07:00
Gregg Tavares
18829680ee Experiment with uniform-tree support
This is just an experiement. I haven't decided if this is going to be added or not

Trying out, given uniforms like this.

```
    struct Extra {
      float f;
      vec4 v4;
      vec3 v3;
    };
    struct Light {
      float intensity;
      vec4 color;
      float nearFar[2];
      Extra extra[2];
    };
    uniform Light lights[2];
```

You can set them like this

```
twgl.setUniformTree(programInfo, {
  lights:[
    { intensity: 1.5, color: [1, 0, 0, 1], nearFar: [0.1, 1.0], extra: [ f: 0.1, v4: [1.2, 3.4, 1.2, 1.4], v3: [0, 1, 2], },
    { intensity: 2.3, color: [0, 0, 1, 1], nearFar: [0.1, 1.0], extra: [ f: 0.7, v4: [3.1, 7.9, 0.6, 5.8], v3: [4, 5, 6], },
  ],
});
```
2021-09-25 02:57:55 -07:00
Gregg Tavares
7a8890299f add itWebGL and itWebGL2 test helpers 2021-09-24 12:38:46 -07:00
Gregg Tavares
d766db311a remove console.log 2021-09-24 11:47:35 -07:00
Gregg Tavares
2340129465 fix issue with Uniform blocks and built in uniforms 2021-09-24 11:43:40 -07:00
Gregg Tavares
b033805847 add puppeteer test 2021-09-24 08:49:49 -07:00
Gregg Tavares
cfabc653df fix uniform block setting 2021-09-23 17:00:48 -07:00
Gregg Tavares
c554abb544 lint more files 2021-09-23 14:39:27 -07:00
Gregg Tavares
d01443f38b test that AttachmentOptions uses TextureOptions in ts 2019-11-03 14:22:45 +09:00
Sophie Kirschner
c4b19520a0 Put Vec3 and Mat4 type declarations in module scope
Previously in the global scope (e.g. twgl.Vec3) and now in module scope (e.g. twgl.v3.Vec3)
2019-01-15 21:52:40 +09:00
Sophie Kirschner
80706d0dae Create a TypeScript test ("npm run testts")
"npm run test" will now run both the pre-existing "js" tests as well as the new "ts" test. Use "npm run testjs" to run only the earlier tests.

Borrows a handful of lines from code in the examples/ directory. It doesn't need to do anything interesting, it just needs to successfully compile.

The TS test is not very thorough at this point, but it's a very solid start imo.
2019-01-15 21:52:40 +09:00
Gregg Tavares
04e0cc713d fix tests 2019-01-13 02:41:13 +09:00
Gregg Tavares
2114edcdf9 hack node to test es6 modules
I really wish more was written around why node decided files must be named .mjs for node es6 modules.

They list the requirement that both `require` and `import` should be able to load both kinds of modules. Why that requirement? Why not `require` loads CJS and `import` loads ESM!??!

As it is, if you want to use modules in both node and the browser you're going to have to rename all your files to .mjs
2017-10-26 12:23:27 +09:00
Gregg Tavares
37292f1251 fix test 2017-10-07 17:54:36 +09:00
Gregg Tavares
a8bf58ceab add ortho test 2017-10-07 16:52:06 +09:00
Gregg Tavares
09f5b73fc3 fix tests to test destination same as source 2017-04-27 10:35:18 +09:00
Gregg Tavares
e0f1c2ee3a make multiply do b on the right 2016-10-21 10:59:43 +09:00
Gregg Tavares
2b585baeca add setAxis test 2016-03-03 01:13:42 +09:00
Gregg Tavares
cc5c6543f9 add more tests 2016-01-23 01:20:02 +08:00
Gregg Tavares
3f6e37ee5b add more tests 2016-01-23 00:49:04 +08:00
Gregg Tavares
9fad494c46 add more tests 2016-01-22 23:53:15 +08:00
Gregg Tavares
df397968d5 add more tests 2016-01-22 23:47:56 +08:00
Gregg Tavares
af4ec69648 add more tests 2016-01-22 05:06:58 +08:00
Gregg Tavares
2ce342d075 add more tests 2016-01-22 04:24:51 +08:00
Gregg Tavares
dd4c2e7c1f add testing infrustructure 2016-01-22 03:31:07 +08:00