npm install vedajs
import Veda from 'vedajs';
const veda = new Veda();
veda.setCanvas(canvas);
veda.loadFragmentShader(code);
veda.play();
veda.loadFragmentShader(code);
This is equivalent to
veda.loadShader({ fs: code });
veda.loadVertexShader(code);
This is equivalent to
veda.loadShader({ vs: code });
Pass a shader object to loadShader
.
veda.loadShader({
vs: vertexShaderCode,
fs: fragmentShaderCode,
});
Pass an array of shaders to loadShader
.
veda.loadShader([
{
vs: vertexShaderFor1stPass,
fs: fragmentShaderFor1stPass,
},
{
fs: fragmentShaderFor2ndPass,
},
]);
veda.toggleAudio(true);
veda.loadShader(shader);
veda.toggleMidi(true);
veda.loadShader(shader);
veda.toggleCamera(true);
veda.loadShader(shader);
veda.toggleKeyboard(true);
veda.loadShader(shader);
veda.toggleGamepad(true);
veda.loadShader(shader);
veda.loadSoundShader(shader);
veda.playSound();
Takayosi Amagi
- Website: gmork.in
- Twitter: @amagitakayosi
- GitHub: fand
MIT