Skip to main content

A local shader development environment

Project description

Shader Workshop

This tool is a local HTTP/WebSocket server monitoring the specified shader fragment directory. It allows live coding fragment shaders with your preferred code editor, and having them rendered in your browser through WebGL2.

screenshot

Features

  • Hot reload
  • Live controls for basic uniforms
  • #include directive
  • Play/Pause/Reset time
  • Screenshot
  • Resolution and aspect ratio controls
  • Lightweight, no web dependencies

Install

pipx install shader-workshop

pip can also be used.

Usage

sw-server /path/to/fragment/shaders

If unspecified, sw-server will use the examples directory.

All the .frag files in that directory will be tracked and accessible through the web interface.

Fragment inputs and outputs

Every fragment gets the following uniforms as input:

  • float time: the time in seconds
  • vec2 resolution: the canvas resolution in pixels

They must write on the vec4 out_color output to produce a color.

The compatibility is currently set to 300 es.

Live controls

To expose controls to the web UI, declare a uniform in your fragment shader. Optionally, in the comment beside, you can specify the default value and ranges. For example:

uniform float angle; // def:0.7 min:0.6 max:0.9
uniform int steps;   // def:7 min:0 max:10
uniform bool debug;  // def:1

Currently, only float, int and bool are supported.

Includes

It is possible to include .glsl files using an #include directive: #include name (no quote nor explicit .glsl). Recursive includes (.glsl including .glsl) are supported, as well as including multiple times the same file (through recursion or not). Their changes are also monitored by the file watcher.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shader_workshop-0.4.0.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shader_workshop-0.4.0-py3-none-any.whl (25.4 kB view details)

Uploaded Python 3

File details

Details for the file shader_workshop-0.4.0.tar.gz.

File metadata

  • Download URL: shader_workshop-0.4.0.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for shader_workshop-0.4.0.tar.gz
Algorithm Hash digest
SHA256 3cb550d2667afc4ab47d364a4f69b2c618e7b9e8316a20b04830cb734b060981
MD5 50d426928e8522c133c1869c3d06d232
BLAKE2b-256 552e5e4c7f904de9e2ab606980ca7675b392552a4fcceee97bbc86b573b28167

See more details on using hashes here.

Provenance

The following attestation bundles were made for shader_workshop-0.4.0.tar.gz:

Publisher: python-publish.yml on ubitux/ShaderWorkshop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file shader_workshop-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for shader_workshop-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71db679b2a822873f1c47c77632c6302f5fb3d3caf024054d65b727ab96b4fdc
MD5 f9e5542c72d15e740b8d0f4a46ad251a
BLAKE2b-256 f84a0d1543871e218260f2307a0dbc622347ee3c42a0f70e6a84287741554dc9

See more details on using hashes here.

Provenance

The following attestation bundles were made for shader_workshop-0.4.0-py3-none-any.whl:

Publisher: python-publish.yml on ubitux/ShaderWorkshop

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page