Skip to content
No description, website, or topics provided.
JavaScript
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
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)

You can’t perform that action at this time.