Skip to main content

Material Sampler

Intro

The Material Sampler samples an Input Shape and then outputs values of between 0-1 depending on the value (lightness/darkness) of the shape (e.g. black = 0, white = 1). Alternatively it will output the color if connected to an attribute that supports it (e.g. Fill Color).

It can be used in combination with Shaders to control attributes for other shapes and is particular useful when used alongside a Duplicator.

Performance

The Material Sampler has some known performance issues, particularly when sampling many points (e.g. a Duplicator). If you are working with higher point counts consider using the Image Sampler instead.

UI

Common Attributes +

Value - A multiplier.

Input Path - Connect a Shape with a Material to sample from.

Graph - Use the graph to remap the output values.

Offset - Add/subtract a value to the output(s).

Example
  1. Import an image to the Assets Window.
  2. Drag the image into the Scene Window (this will create a Footage Shape).
  3. Create a Material Sampler.
  4. Connect footageShape.idmaterialSampler.inputShape.
  5. Create a Rectangle.
  6. With the Rectangle selected, click the Duplicator Shelf item.
  7. Connect materialSampler.idduplicator.shapeScale.

The shapes will be scaled dependent on the image.

caution

The Material Sampler does not currently support SkSL Shaders (this includes the Noise Shader).

caution

The Material Sampler does not currently support frame changes when used within a Pre-Comp. Please try and use a Group instead of a Composition if possible as a workaround.