webgl-demo fragment shader now has uniform uTime
This commit is contained in:
parent
d7daf6a391
commit
e0bc5aab8b
2 changed files with 45 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
function drawScene(gl, programInfo, buffers) {
|
||||
function drawScene(gl, programInfo, buffers, time) {
|
||||
gl.clearColor(0.0, 0.0, 0.0, 1.0); // Clear to black, fully opaque
|
||||
gl.clearDepth(1.0); // Clear everything
|
||||
gl.enable(gl.DEPTH_TEST); // Enable depth testing
|
||||
|
|
@ -56,6 +56,12 @@ function drawScene(gl, programInfo, buffers) {
|
|||
modelViewMatrix,
|
||||
);
|
||||
|
||||
// Time since page loaded in seconds
|
||||
gl.uniform1f(
|
||||
programInfo.uniformLocations.time,
|
||||
time,
|
||||
);
|
||||
|
||||
{
|
||||
const offset = 0;
|
||||
const vertexCount = 4;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue