Skip to content

NeaByteLab/WGSL-Generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WGSL Generator License: MIT

A WebGPU shader generator for creating procedural celestial wallpapers.

Aurora Night Sky
Aurora Borealis Night Sky

Requirements

  • Deno (v2.5.0 or higher recommended)
  • WebGPU Compatible Hardware (High-performance GPU recommended)
  • Git (for cloning the repository)

Installation

# Clone the repository
git clone https://github.com/NeaByteLab/WGSL-Generator.git

# Enter the project directory
cd WGSL-Generator/

Usage Example

import WGSLGenerator from '@app/index.ts'

// Image dimensions
const width = 1920
const height = 1080

// Output directory
const outPath = './output'

// Generate a procedural Aurora Borealis render
await WGSLGenerator.generate('auroraBorealis', width, height, outPath, 'aurora_borealis.png')

// Generate a Night Sky wallpaper render
await WGSLGenerator.generate('nightSky', width, height, outPath, 'night_sky.png')

Available Shader Templates

The generator provides a collection of procedurally generated celestial environments.

Template Name Description (Visual Style)
auroraBorealis Simulates northern lights using multi-layered noise and star fields.
nightSky Generates deep-space vistas with nebulae and star densities.

API Reference

WGSLGenerator.generate

WGSLGenerator.generate(templateName, canvasWidth, canvasHeight, outputDirectory, outputFilename)
  • templateName <string>: Target shader template identifier (auroraBorealis | nightSky)
  • canvasWidth <number>: Desired image width pixels
  • canvasHeight <number>: Desired image height pixels
  • outputDirectory <string>: Destination folder path for generated files
  • outputFilename <string>: Target filename string (e.g., output.png)
  • Returns: Promise<void> completion promise of image generation
  • Description: Handles the full WebGPU pipeline from shader creation to binary PNG export.

License

This project is licensed under the MIT license. See the LICENSE file for more info.