Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Sep 27, 2021
1 parent 81fef12 commit a181dd3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ twgl.setUniforms(progInfo, {
{ intensity: 5.0, shininess: 100, color: [1, 0, 0, 1] },
{ intensity: 2.0, shininess: 50, color: [0, 0, 1, 1] },
],
})
});
```

WebGL
Expand All @@ -421,6 +421,16 @@ gl.uniform1f(light1ShininessLoc, 50);
gl.uniform4fv(light1ColorLoc, [0, 0, 1, 1]);
```

If you just want to set the 2nd light in TWGL you can do this

```javascript
const progInfo = twgl.createProgramInfo(gl, [vs, fs]);
...
twgl.setUniforms(progInfo, {
lights[1]: { intensity: 5.0, shininess: 100, color: [1, 0, 0, 1] },
});
```

### Compare

[TWGL example](http://twgljs.org/examples/twgl-cube.html) vs [WebGL example](http://twgljs.org/examples/webgl-cube.html)
Expand Down

0 comments on commit a181dd3

Please sign in to comment.