Project

A project defines a series of one or more passes (an Image pass, and optional Buffer# passes), each with source files references, and Channel# binding definition. A project can also define common source files that should be included with all the passes.

A project file should contain a single json object, with a Project definition, for example:

{
    "Common": "Common.glsl",
    "Buffer1": "Buffer1.glsl",
    "Image": {
        "Source": "Image.glsl",
        "Channel0": "Buffer1"
    }
}

See Project Templates for more project definition examples.

Note

All of the properties described below are optional, except the ones marked as (required).

Project Definition

An object with the following properties:

Image:

Image Pass definition (required).

Buffer#:

Buffers Pass definition (where # is a number, or an uppercase letter (A-Z)).

Common:

A common Source definition, that should be included with other passes sources (not included by default with Viewer passes).

Viewer:

A single Viewer Pass definition.

Viewers:

One of:

Paused:

Start paused (boolean), could be used when the shader has the same output on every frame, the default value is false.

RenderSize:

A global RenderSize definition, that is applied to all the passes (can be overridden individually), when not specified, the viewport size is used.

Scalable:

A global Scalable definition (boolean), that is applied to all the passes (can be overridden individually).

Uniforms:

Project uniforms values path, the default value is alongside the project file, with a .uniforms.json suffix.

Pass Definition

  • Can be a Source definition (such as a single source file path or an array of paths).

  • Can be an object with the following properties:

    Source:

    Source definition (required).

    Channel#:

    Binding definition (where # is a number between 0 and 7).

    DisplayName:

    Pass display name (string).

    DefaultViewer:

    A key (string) of a Viewer Pass that should be selected by default. Viewers keys should match the Project’s Viewers object properties name.

    IncludeCommon:

    Include common sources (boolean), the default value is true.

    RenderSize:

    RenderSize definition.

    Scalable:

    Scalable definition.

Viewer Pass Definition

  • Can be a Source definition (such as a single source file path or an array of paths).

  • Can be an object with the following properties:

    Source:

    Source definition (required).

    Channel#:

    Binding definition (where # is a number between 0 and 7).

    DisplayName:

    Pass display name (string).

    IncludeCommon:

    Include common sources (boolean), the default value is false.

Source Definition

  • Can be a single source file path (string), for example: "Source": "Image.glsl".

  • Can be an array of paths, for example:
    "Source": ["Image-include.glsl", "Image-main.glsl"].

    • The source files are concatenated at the same order as they appear on the array, a correct functions declaration and implementation order is assumed.

Notes

Paths are relative to the project file, can contain forward / or backward slashes \\ (escaped), and can contain environment variables in the form of %VAR_NAME%, for example:
"Source": "%SHADERS_COMMON%/Include/BlendModes.glsl".

Source files with a .cs extension, are converted to GLSL using Conversion Rules.

Binding Definition

  • Can be a string value, one of:

    • Image, Buffer# - A defined pass framebuffer.

    • Viewer - Current selected pass framebuffer (from the viewport menu: Buffers ‣ …).

    • Keyboard - A Keyboard Texture.

    • A path to an image file (with a supported extension).

  • Can be an object with the following properties:

    Type:

    A string value, one of Framebuffer (default), Texture or TextureSequence.

    Source:

    A string value (required), depends on Type:

    • For Framebuffer, the value should be a pass name (Image, Buffer#, or Viewer).

    • For Texture, the value should be a path to an image file (with a supported extension), or Keyboard.

    • For TextureSequence, the value should be a search pattern for image files (for example: "Animation/Frame*.png"). A FrameRate property is also required.

    FrameRate:

    Frames per second (integer), used with TextureSequence type.

    TextureFilter:

    Texture sampling mode (string), one of Nearest (default), or Linear.

    MipmapFilter:

    Mipmap sampling mode (string), one of None (default), Nearest, Linear (string). If None is selected, a mipmap would not be generated.

    Wrap:

    Texture wrapping mode (string), one of ClampToEdge (default), Repeat, MirroredRepeat (string).

    WrapS / WrapT can be used for different X / Y wrapping modes.

RenderSize Definition

A string value of the format "<width>, <height>" (for example "800, 600"), defines a buffer size that should be used instead of the viewport size.
When specified at project level, defines a default size for all the passes.

To allow downscaling, the Scalable property should be set to true.

Scalable Definition

A boolean value, allows RenderSize, if specified, to be downscaled when selecting a lower viewer resolution (from the viewport menu: Resolution ‣ …), the default value is false.
When specified at project level, defines a default behavior for all the passes.