Skip to content

image

Image parameter.

It can be either a bundled image in your effect (e.g. a font map to draw text),a file input in the filter properties, or both.

Shader Equivalent

uniform texture2d parameter_name;

Example

{
  "name": "grid_pattern",
  "label": "Pattern",
  "type": "image",
  "values": [
    {
      "label": "Pattern1",
      "value": "pattern1.png"
    },
    {
      "label": "Pattern2",
      "value": "pattern2.png"
    },
    {
      "label": "Pattern3",
      "value": "pattern3.png"
    },
    {
      "label": "Pattern4",
      "value": "pattern4.png"
    }
  ],
  "default": "pattern1.png",
  "allow_custom": true,
  "hidden": false
}

Properties

Property
Type Required If absent Description
default string Yes - -
name string Yes - Name of the field. It must be the same as the associated variable in the shader.
type "image" Yes - -
allow_custom boolean No true Allow to select an image with a file picker in the effect properties UI.
description string No - Description of the field. It will be shown in the UI.
devmode boolean No false If set to true, this field will only be available in the property UI if the developer mode is active.
hidden boolean No false Hide the UI field
label string No "Same as name" The label of the field in the UI. If not set, the name will be used.
values array of object No null Optional list of pre-defined images.

These files must be in the same folder of you effect, or in the same packaged .shadertastic file to be valid.

If allowed_custom is true, another pick "Use custom file" will also be available in the UI.