Introduction

Shadron is a shader-based procedural asset generation and reprocessing software. You can use it to design graphics, 3D models, cube maps, particle systems, and even sound using special Shadron scripts. Adjustable parameters and automatic reloading of the script allow users to fine-tune the results in real time.

Check out the examples bundled with the program or create a text file in your favorite text editor and start writing your own. You may also want to watch the video tutorial online for a quick start.

The Shadron scripting language is based on GLSL (OpenGL Shading Language). It has C-like directives (#something) and declarations of objects, variables, and other constructs. Shadron objects are typically displayed in their own window and represent media content such as an input image file, shader output, etc. In most cases, they can be referred to by their name as textures in subsequent shader functions.

Also available is a set of builtin constants and a library of commonly used functions which can be #included.

Function declarations are the same as in GLSL or C, starting with the return type, followed by the function name and argument types and names in parentheses.

Declarations of objects start with:

Declarations of variables start with:

  • const – a constant value
  • parameter (or param) – an adjustable parameter
  • var – a modifiable state variable
  • let and defer – a read-only expression variable

The remaining declarations are:

  • struct – a structure type
  • template – a C++ style template
  • export – specification for producing output files
  • event – an event handler
  • generator – a recursive generator of vertex data
  • vertex_list – a sequence of vertex data
  • watch – a live view of an expression's value
  • glsl – a GLSL-only block
  • stream – specification for streaming output to extensions
  • set – a parameter setter
  • comment – a user comment

Please see the reference page for the element you want to use in your script.

Command line version

Shadron is distributed with a command line version of the program, Shadrun.exe. This utility allows you to perform pre-defined exports or run streams without interaction with the GUI. To run all exports in a given script, simply launch Shadrun.exe with the filename of the script as the argument. You can also use any of the optional parameters:

  • -s (stream) – run streams instead of exports
  • -f (force) – do not require confirmation to overwrite files, no user interaction
  • -m (mute) – only print errors and user queries
  • -D – macro definition, defines a macro that will be available throughout the script. The macro name must follow immediately, and optionally its value after an equal sign, e.g. -DHIGH_QUALITY or -D"FRAME_SIZE=ivec2(640, 480)"

ShadronPlayer.exe is another version, a barebones redistributable player that can be used to run scripts in a standalone window. Make sure to package Shadron Player together with the library folder.

Keyboard shortcuts

The following keyboard shortcuts can be used in the Shadron GUI:

NOTE: In the macOS version, Ctrl is replaced by Command.

Main program window:

  • Hold Ctrl – finer parameter control
  • Ctrl+V – load script from clipboard (file or text code)
  • Ctrl+O – load script through "Open file" dialog
  • F5 – reload current script (or startup tip)
  • Ctrl+F5 – reload current script and reset all user states (parameter values, input images)
  • Alt+F5 – toggle autoreload (current script will be reloaded every time it changes)
  • F6 – start/cancel export/stream
  • Ctrl+F6 – start export/stream, overwrite files without asking
  • Alt+F6 – toggle between export and stream (if applicable)
  • Ctrl+F7 – reset all parameters
  • F1 – open documentation
  • Alt+F1 – open examples directory
  • R – restart from the beginning
  • P – pause/resume animation
  • Ctrl+Z – undo last parameter change
  • Ctrl+Y – redo parameter change
  • Alt+F – bring all windows to front
  • Ctrl+F4 – unload current script
  • Ctrl+Q – quit

Object windows:

  • Ctrl+C – copy output to clipboard (if applicable)
  • Ctrl+V – load input from clipboard (input windows only)
  • Ctrl+O – load input from file (input windows only)
  • Ctrl+S – save output as... (if applicable)
  • F5 – reload input file (input windows only)
  • Ctrl+F5 – reload original input file (input windows only)
  • Alt+F5 – toggle autoreload (input windows only)
  • Spacebar – pause/resume animation or play/stop sound
  • F11 – toggle fullscreen mode (or Escape to exit)
  • Ctrl+0/+/- – reset/increase/decrease view scale (if window is not resizable)
  • Tab – toggle white/black alpha background
  • G – toggle alpha background grid
  • A – toggle alpha channel blending (useful to inspect the color channels where alpha is low)
  • R – reinvoke initialization (particle system and feedback only)
  • Ctrl+F4 – unload input image (input windows only)
  • F8 – show/hide framerate counter (if animated)
  • Alt+R – restart from the beginning globally
  • Alt+Spacebar – pause/resume globally