No description, website, or topics provided.
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
extensions
ir
library
output
parser
preprocessor
.gitignore
LICENSE
README.md
event.js
glsl.js
gulpfile.js
index.js
package.json
state.js

README.md

glsl2js

Install

npm install
gulp build

Usage

var state = glsl.compile(src, {target : glsl.target.fragment});

if (!state.getStatus()) {
	console.log(state.getErrors());
} else {
	var prgm = new glsl.program();
	prgm.addObjectCode(state.getIR(), glsl.target.fragment);
	prgm.build();
	
	prgm.setUniformData('someVec4Uniform', [1, 2, 3, 4]);
	progm.setAttributeData('someVec4Attr', [1, 2, 3, 4])
	
	prgm.fragment();
	
	console.log(prgm.context.result_f32.slice(0, 4));
}

License

The MIT License (http://opensource.org/licenses/MIT)