Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
111 changes: 102 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,111 @@
# Lightward AURA
# Lightward Aura

Aura generative visual system for Lightward
A WebGL-powered generative visual library for creating beautiful, animated plasma clouds.

## Live Demo
[Hosted on github pages](https://lightward.github.io/aura/)

## To Build
[https://aura.lightward.io/](https://aura.lightward.io/)

This project uses [rollup.js](https://rollupjs.org/guide/en/) as a bundle system.
## Usage

There is no dev server included, you will need your own. I use [Live Server for VSCode](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) but any dev server capable of serving static files should do.
### Quick Start

To build and watch for changes
```html
<script src="https://aura.lightward.io/aura.js"></script>
<script>
const container = document.getElementById('my-container');
const canvas = document.createElement('canvas');
container.appendChild(canvas);

(note: if you don't see your changes when saving, try extending the refresh time of live server, which is also watching for changes)
const gl = canvas.getContext('webgl2', { preserveDrawingBuffer: true });

npm install && npm run watch
const aura = new LightwardAura(gl, {
...LightwardAura.defaultParams,
width: window.innerWidth,
height: window.innerHeight,
});

aura.start();
</script>
```

### Custom Colors

```javascript
const aura = new LightwardAura(gl, {
...LightwardAura.defaultParams,
width: window.innerWidth,
height: window.innerHeight,
colors: [
[100, 150, 255], // RGB values 0-255
[255, 100, 150],
],
});
```

### API

#### `new LightwardAura(gl, params)`

- `gl`: WebGL2 rendering context
- `params`: Configuration object (see below)

#### Methods

- `start(play = true)` - Start the render loop
- `play()` - Resume animation
- `pause()` - Pause animation
- `shutdown()` - Clean up resources

#### Static Properties

- `LightwardAura.defaultParams` - Default configuration object (excludes `width` and `height`)

#### Configuration

```typescript
{
width: number; // Canvas width
height: number; // Canvas height
animTime: number; // Initial animation time
seed: number; // Random seed for reproducibility
colors: [r, g, b][]; // Array of RGB color tuples (0-255)

globalParams: {
contrast: number; // Default: 1.37
saturation: number; // Default: 1.69
speed: number; // Default: 0.13
noise: number; // Default: 0.5
targetFps: number; // Default: 60
// ... (see defaultParams for full list)
};
// ... (see defaultParams for complete structure)
}
```

## Development

### Build

```bash
npm install
npm run build
```

### Watch Mode

```bash
npm run watch
```

Use any static file server (like [Live Server for VSCode](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer)) to view `index.html` during development.

### Test

```bash
npm test
```

## License

[UNLICENSE](./UNLICENSE) - Public domain