Compiling ...
Edit
Uniforms
Scene

Geometry
Placeholder

Settings

GLSL Editor
Editor Compile Log Help
Load Example...

Overview

ShaderPie is a shader development environment that runs as a web page that continuously loads / reloads a local shader file from your favourate editor. Everything in the scene is controlled via the single shader file, with all metadata stored in comments.

Built-in Defines, Uniforms & Attributes

Shaders are compiled with #version 300 es. Vertex, fragment and postprocess shaders are combined into the same GLSL file and separated via preprocess definition flags:

    #define IS_VERTEX_SHADER 1; // Only defined when compiling as vertex shader
    #define IS_FRAGMENT_SHADER 1; // Only defined when compiling as fragment shader
    #define IS_POSTPROCESS_SHADER 1; // Only defined when compiling as postprocess shader

Vertex shader uniforms:

    uniform mat4 modelMatrix; // = object.matrixWorld
    uniform mat4 modelViewMatrix; // = camera.matrixWorldInverse * object.matrixWorld
    uniform mat4 projectionMatrix; // = camera.projectionMatrix
    uniform mat4 viewMatrix; // = camera.matrixWorldInverse
    uniform mat3 normalMatrix; //  = inverse transpose of modelViewMatrix
    uniform mat3 cameraPosition; // = camera position in world space

Vertex shader attributes:

    vec3 position;
    vec3 normal;
    vec2 uv;

Fragment shader uniforms:

    uniform mat4 viewMatrix; // = camera.matrixWorldInverse
    uniform mat3 cameraPosition; // = camera position in world space
Close