renderScene = (shadowFlag) => {
const eyePosition = m4.inverse(viewMatrix).slice(12, 15);
const uniforms = {
modelMatrix: m4.identity(),
eyePosition,
lightPosition,
tex,
viewMatrix: viewMatrix,
projectionMatrix: projectionMatrix,
shadowFlag: shadowFlag,
planeNormal: receiverNormal,
Q: receiverCenter
};
mutable debug = uniforms;
gl.useProgram(sceneProgramInfo.program);
twgl.setUniforms(sceneProgramInfo, uniforms);
sceneBufferInfoArray.forEach((bufferInfo) => {
twgl.setBuffersAndAttributes(gl, sceneProgramInfo, bufferInfo);
twgl.drawBufferInfo(gl, bufferInfo);
});
}