0.6.2 • Published 5 years ago
taiyaki v0.6.2
taiyaki
Overview
taiyaki
is a lightweight library of WebGL.
The origin of the name is the famous song in Japan.
Example
import { RenderingContext } from 'taiyaki'
const ctx = new RenderingContext('canvas')
const program = ctx.createProgram(['vs', 'fs'])
ctx.useProgram(program)
ctx.bindVbos([
{ name: 'positions', value: positions, stride: 3 },
{ name: 'colors', value: colors, stride: 4 },
{ name: 'normals', value: normals, stride: 3 },
])
ctx.bindIbo(index)
ctx.toggleDepthFunc(true)
ctx.depthFunc()
// ...
ctx.bindUniforms([
{ name: 'mvpMatrix', type: 'matrix4fv', value: mvpMatrix },
{ name: 'invMatrix', type: 'matrix4fv', value: invMatrix },
{ name: 'lightDirection', type: '3fv', value: lightDirection },
{ name: 'eyePosition', type: '3fv', value: eyePosition },
{ name: 'centerPoint', type: '3fv', value: centerPosition },
{ name: 'ambientColor', type: '4fv', value: ambientColor },
])
ctx.clear({ r: 0.3, g: 0.3, b: 0.3, a: 1 }, 1.0)
ctx.viewport({ x: 0, y: 0, width: 512, height: 512 })
ctx.drawElements(ctx.gl.TRIANGLES, indexes.length)
Licence
The MIT License (MIT) Copyright (c) 2015 dorayakikun
0.6.2
5 years ago
0.6.1
5 years ago
0.6.0
6 years ago
0.5.13
6 years ago
0.5.12
6 years ago
0.5.11
6 years ago
0.5.10
6 years ago
0.5.9
6 years ago
0.5.8
6 years ago
0.5.7
6 years ago
0.5.6
6 years ago
0.5.2
7 years ago
0.5.1
7 years ago
0.5.0
7 years ago
0.4.0
7 years ago
0.3.1
7 years ago
0.3.0
7 years ago
0.2.0
7 years ago
0.1.9
8 years ago
0.1.8
9 years ago
0.1.7
9 years ago
0.1.6
9 years ago
0.1.5
9 years ago
0.1.4
9 years ago
0.1.3
9 years ago
0.1.2
9 years ago
0.1.1
9 years ago
0.1.0
9 years ago