Skip to content

fand/vedajs

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
logo

VEDA.js

Shader Art Framework


screenshot

npm version license MIT Greenkeeper badge hashtag #vedajs



Install

npm install vedajs

Usage

import Veda from 'vedajs';

const veda = new Veda();

veda.setCanvas(canvas);
veda.loadFragmentShader(code);

veda.play();

Advanced Usage

Fragment shader

veda.loadFragmentShader(code);

This is equivalent to

veda.loadShader({ fs: code });

Vertex shader

veda.loadVertexShader(code);

This is equivalent to

veda.loadShader({ vs: code });

Using both

Pass a shader object to loadShader.

veda.loadShader({
  vs: vertexShaderCode,
  fs: fragmentShaderCode,
});

Multipath rendering

Pass an array of shaders to loadShader.

veda.loadShader([
  {
    vs: vertexShaderFor1stPass,
    fs: fragmentShaderFor1stPass,
  },
  {
    fs: fragmentShaderFor2ndPass,
  },
]);

Audio input

veda.toggleAudio(true);
veda.loadShader(shader);

MIDI input

veda.toggleMidi(true);
veda.loadShader(shader);

WebCam input

veda.toggleCamera(true);
veda.loadShader(shader);

Keyboard input

veda.toggleKeyboard(true);
veda.loadShader(shader);

Gamepad input

veda.toggleGamepad(true);
veda.loadShader(shader);

Sound shader

veda.loadSoundShader(shader);
veda.playSound();

Author

Takayosi Amagi

LICENSE

MIT