Skip to content

Simple text editor that lets you write Shadertoy shaders more comfortably, anytime, anywhere.

Notifications You must be signed in to change notification settings

iY0Yi/ShaderBoy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation




ShaderBoy is a simple text editor that lets you write Shadertoy shaders more comfortably, anytime, anywhere. I like writing shaders for Shadertoy, or analyzing other people's esoteric shaders, and I created this especially because I wanted to do that on my smartphone. Whether you're traveling by train or plane, staying in the toilet, fishing or camping, you can write a shader anywhere and anytime. Your power to go.

There are PC version and smartphone version. Both allow you to write shaders with the same variable/function name as Shadertoy. On the PC version, you can fine-tune your shaders with a rich debugging GUI. It also has a recording mode so you can easily save your shader as a movie. The smartphone version consists of a minimal GUI element that assumes the use of a physical keyboards, with a small screen as much coding space as possible.

ShaderBoy uses Google Drive to store your shaders. From any device on which you log in with your Google account, you can continue coding the shader that you last edited.

Enjoy ShaderBoy!

This is not an official Shadertoy application.
Bug reports, feature requests, and 🍺 are welcome.
*iOS ver is WIP. There are many bugs yet. (especially Keymaps, CSS)





App

ShaderBoy is a PWA(Progressive Web Apps). You can install the app from here.






Keymaps

Smartphone Windows Mac
Compile βŒ₯+ENTER βŒ₯+ENTER βŒ₯+ENTER
Play/Pause ctrl+⇧+UP ctrl+⇧+UP ctrl+⇧+UP
Reset time ctrl+⇧+DOWN ctrl+⇧+DOWN ctrl+⇧+DOWN
Move to neighbor buffer βŒ₯+LEFT/RIGHT βŒ₯+LEFT/RIGHT βŒ₯+LEFT/RIGHT
Resolution ctrl+1-4 ctrl+1-4 ctrl+1-4
Save shader ctrl+S ctrl+S ⌘+S
Open shader ctrl+O ctrl+O ⌘+O
Switch Info ctrl+⇧+I ctrl+⇧+I ⌘+⇧+I
Mute/Unmute ctrl+M ctrl+M ⌘+M
New shader ctrl+⇧+βŒ₯+N ctrl+⇧+βŒ₯+N ⌘+⇧+βŒ₯+N
Import shader ctrl+⇧+βŒ₯+I ctrl+⇧+βŒ₯+I ⌘+⇧+βŒ₯+I
Fork shader ctrl+⇧+βŒ₯+F ctrl+⇧+βŒ₯+F ⌘+⇧+βŒ₯+F
Show/Hide Knobs ctrl+⇧+βŒ₯+D ctrl+⇧+βŒ₯+D ⌘+⇧+βŒ₯+D
Show/Hide Assets ctrl+⇧+βŒ₯+A ctrl+⇧+βŒ₯+A ⌘+⇧+βŒ₯+A
Show/Hide Timeline ctrl+⇧+βŒ₯+T ctrl+⇧+βŒ₯+T ⌘+⇧+βŒ₯+T
Show/Hide Recording ctrl+⇧+βŒ₯+R ctrl+⇧+βŒ₯+R ⌘+⇧+βŒ₯+R
Show/Hide Editor ctrl+⇧+βŒ₯+H ctrl+⇧+βŒ₯+H ⌘+⇧+βŒ₯+H
Show/Hide Canvas ctrl+⇧+βŒ₯+V ctrl+⇧+βŒ₯+V ⌘+⇧+βŒ₯+V
Toggle Split View ctrl+⇧+βŒ₯+, ctrl+⇧+βŒ₯+, ⌘+⇧+βŒ₯+,
Increase Font Size ctrl++ ctrl++ ⌘++
Decrease Font Size ctrl+- ctrl+- ⌘+-

Note:ShaderBoy uses Monaco Editor (the same editor that powers VS Code), so you can use all the standard VS Code keyboard shortcuts and features.

Inline GUI Controls

Target Action Result
Number Double-click Show float slider
vec2 string Double-click Show 2D pad GUI
vec3 string/color marker Double-click Show HSV slider
Inside GUI area Double-click Confirm adjustment
Outside GUI area Double-click Cancel adjustment

Note: The inline GUI controls provide quick access to value adjustments directly in the code editor. Double-clicking specific elements will open their respective control interfaces, and you can either confirm or cancel your adjustments using double-clicks.

*And some of Sublime Text bindings by Codemirror.





Features

Compatibility

  • Shadertoy uniform variables
  • Multipass shader
  • Sound shader
  • Cubemap shader
  • Official assets(textures)
  • Official assets(sounds)
  • Display compilation time
  • Display number of chars
  • VR

Supported Shadertoy Uniforms

  • uniform vec3 iResolution; // viewport resolution (in pixels)
  • uniform float iTime; // shader playback time (in seconds)
  • uniform float iTimeDelta; // render time (in seconds)
  • uniform int iFrame; // shader playback frame
  • uniform float iFrameRate; // number of frames rendered per second
  • uniform vec4 iDate; // (year, month, day, time in seconds)
  • uniform vec4 iMouse; // mouse pixel coords. xy: current (if MLB down), zw: click
  • uniform float iChannelTime[4]; // channel playback time (in seconds)
  • uniform vec3 iChannelResolution[4]; // channel resolution (in pixels)
  • uniform samplerXX iChannel0..3; // input channel. XX = 2D/Cube
  • uniform float iSampleRate; // sound sample rate (i.e., 44100)

GUI/other usefuls

Other

  • GoogleDrive
  • Export Image shader(WebM/PNG/JPG/GIF)
  • Export Sound shader(WAV)
  • Witout Google account(Trial mode)
  • Syntax highlight
  • Import/Exprt JSON (for Shadertoy unofficial plugin)
  • Direct import from Shadertoy URL





Screenshots

















Build Your ShaderBoy

Install dependencies

If you want have your own ShaderBoy, Clone this repo and install dependencies.

$ npm install

Build

You then set up a local host for development.

$ npm start

or to build,

$ npm run build

Upload

And upload files in "dest" directory to your server. That's it! Good luck!




Dependencies

ShaderBoy depends on some awesome js libralies.
Codemirror
CCapture.js
keymaster
css_browser_selector
tested with jest




Contact

iY0Yi





Beer

Paypal.me🍺





About

Simple text editor that lets you write Shadertoy shaders more comfortably, anytime, anywhere.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published