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.
The Material Sampler has some known performance issues, particularly when sampling many points (e.g. a Duplicator). Consider using the Image Sampler when working with higher point counts.
UI
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).
- Import an image to the Assets Window.
- Drag the image into the Scene Window (this will create a Footage Shape).
- Create a Material Sampler.
- Connect footageShape.id→materialSampler.inputShape.
- Create a Rectangle.
- With the Rectangle selected, click the Duplicator Shelf item.
- Connect materialSampler.id→duplicator.shapeScale.
The shapes will be scaled dependent on the image.
The Material Sampler does not currently support SkSL Shaders this includes the Noise Shader.
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.