14 Commits

Author SHA1 Message Date
Gregg Tavares
592b9e8112 test it does not delete existing shaders
fix async tests
2025-04-27 10:20:02 +09:00
Gregg Tavares
8e3447fb67 fix createProgram for getting passed WebGLShaders 2025-04-27 09:06:49 +09:00
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
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
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
cfabc653df fix uniform block setting 2021-09-23 17:00:48 -07:00