Skip to content

Instantly share code, notes, and snippets.

@AlexTiTanium
Created February 21, 2016 15:01
Show Gist options
  • Save AlexTiTanium/042f47be7973391c54c9 to your computer and use it in GitHub Desktop.
Save AlexTiTanium/042f47be7973391c54c9 to your computer and use it in GitHub Desktop.
programStars = loadProgram(gl, fs.readFileSync(__dirname + "/stars.glsl", "utf8"));
programNebula = loadProgram(gl, fs.readFileSync(__dirname + "/nebula.glsl", "utf8"));
programSun = loadProgram(gl, fs.readFileSync(__dirname + "/sun.glsl", "utf8"));
var position = [
-1, -1, 0,
1, -1, 0,
1, 1, 0,
-1, -1, 0,
1, 1, 0,
-1, 1, 0
];
var attribs = webgl.buildAttribs(gl, {
aPosition: 3
});
attribs.aPosition.buffer.set(new Float32Array(position));
var count = position.length / 9;
renderableStars = new webgl.Renderable(gl, programStars, attribs, count);
renderableNebula = new webgl.Renderable(gl, programNebula, attribs, count);
renderableSun = new webgl.Renderable(gl, programSun, attribs, count);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment