evanw / lightgl.js

A lightweight WebGL library
MIT License
1.52k stars 146 forks source link

Added GL.Shader.fromURL(vsURL, fsURL) and GL.create({canvas: myCanvas}) #10

Open toaarnio opened 12 years ago

toaarnio commented 12 years ago

I like to put my shaders into separate files and load them via XHR, so I added a Shader factory method for that. It's currently limited to synchronous XHR, which is of course not good performance-wise if you have lots of shaders, but it's a start.

Also added the ability to pass a pre-existing canvas to GL.create(), which I've found convenient.

rpsirois commented 11 years ago

+1 Add to master branch!

z3dev commented 7 years ago

+1 Please merge