Skip to content

Commit

Permalink
1.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
vaneenige committed Nov 14, 2018
1 parent 8866e04 commit 1e5a9f7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Phenomenon is a very small, low-level WebGL library that provides the essentials
- Low-level & highly configurable
- Helper functions with options
- Add & destroy instances dynamically
- Dynamic attribute switching

*Want to see some magic right away? Have a look <a href="https://codepen.io/collection/AOpMrm/">here</a>!*

Expand Down Expand Up @@ -141,6 +142,14 @@ Remove an instance from the scene (and from memory) by its key.

Remove all instances and the renderer itself. The canvas element will remain in the DOM.

### .prepareAttribute(attribute)

Dynamically override an attribute with the same logic that is used during initial creation of the instance. The function requires an object with a name, size and data attribute.

> Note: The calculation of the data function is done on the CPU. Be sure to check for dropped frames with a lot of particles.
Attributes can also be switched. In the demo this is used to continue with a new start position identical to the end position. This can be achieved with `.prepareBuffer(attribute)` in which the data function is replaced with the final array.

## Examples

1. <a href="https://codepen.io/cvaneenige/full/odpVPW">Particles</a>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "phenomenon",
"version": "1.3.1",
"version": "1.4.0",
"description": "A fast 2kB low-level WebGL API.",
"main": "dist/phenomenon.mjs",
"unpkg": "dist/phenomenon.umd.js",
Expand Down

0 comments on commit 1e5a9f7

Please sign in to comment.