Skip to content

Commit

Permalink
Release 1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pissang committed Mar 29, 2018
1 parent d327cd4 commit d35bec5
Show file tree
Hide file tree
Showing 6 changed files with 19,228 additions and 19,148 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ It's easy to use, configurable for high-quality graphics. Benefit from the modul
</html>
```

#### Minimum example code
#### Minimum bundle example

This example is about 28k(gzipped) after bundled by webpack 4.0.
This example is about 28k(gzipped) after bundled by webpack 4.0. It draws a triangle on the screen.

```js
import { Renderer, Geometry, Shader, Material } from 'claygl';

const vsCode = `
attribute vec3 position: POSITION;
void main() {
Expand All @@ -99,7 +101,7 @@ void main() {
gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0);
}
`;
import { Renderer, Geometry, Shader, Material } from 'claygl';

const renderer = new Renderer({
canvas: document.getElementById('main')
});
Expand All @@ -114,7 +116,7 @@ geometry.attributes.position.fromArray([
const material = new Material({
shader: new Shader(vsCode, fsCode)
});
renderer.renderPass([{ geometry, material }]);
renderer.renderPass([ { geometry, material } ]);
```


Expand Down
Loading

0 comments on commit d35bec5

Please sign in to comment.