0.6.2 • Published 6 years ago

taiyaki v0.6.2

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

taiyaki

npm.io npm version code style: prettier

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

6 years ago

0.6.1

7 years ago

0.6.0

7 years ago

0.5.13

7 years ago

0.5.12

8 years ago

0.5.11

8 years ago

0.5.10

8 years ago

0.5.9

8 years ago

0.5.8

8 years ago

0.5.7

8 years ago

0.5.6

8 years ago

0.5.2

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.0

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.2.0

8 years ago

0.1.9

9 years ago

0.1.8

10 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago