Overview


If you've ever used Unity's Shader Graph or Unreal's Material Graph, you're already familiar with the general idea of the Image Pipeline. In essence, when importing an image from KKL, it will run through a pipeline or series of steps that manipulate it before finally being saved to disk as an image file. By default, the pipeline is extremely simple (load an image from a KKL code -> save it to disk), but you can program your own custom pipelines using the Pipeline Editor.

Accessing Pipelines

Pipelines are a feature limited to the Pose Matrix. Pipelines can be linked to either an entire row (i.e. a clothing stage) or an individual cell (i.e. a pose in a stage). Only one pipeline can be set for a pose. If one exists for both a cell and its row, the pipeline on the cell will be used. To create a pipeline, either click the dedicated "Edit Pipeline" button in the Pose Matrix screen, fill in a name and click create, or select the row or cell you wish to assign the pipeline to and use the Edit button in the edit form.


The Edit Pipeline button


Pipeline Assigment Field for a pose or stage

Basics

A pipeline consists of a series of nodes connected to each other via their inputs and outputs. All pipelines contain a Result node, which is the node that produces the final image. Let's take an example pipeline and break it down:

Here we have 4 nodes:
  1. A Cell node pulls an image from KKL using the code of the current cell in the pose matrix. It feeds this image into the "base" input of a Blend node, and a "key" into a Cell Reference node.
  2. A Cell Reference node is a reference to another cell in the Pose Matrix and imports that cell's KKL code. This node is pulling a version of the pose with no T-shirt. The imported image is fed into the "blend" input of the Blend node.
  3. The blend node takes the two imported images, one with a shirt and one without, and blends them together. The strength is at 50%, so the resulting image is a 50-50 blend of the two input images to produce a transparent T-shirt. This is passed to the Result node.
  4. The Result node is the end of the pipeline. Whatever is passed into this is what will be saved for the cell's pose.

Working with the UI


This UI is not robust as professional shader editors, so you may have to reposition nodes a lot to make it clear what is connected to what.

Node Types

What follows is a description of each node type available and how it works.

Apply Mask

Draws only the pixels of the source image that are part of the mask.

Inputs

Outputs

Properties


Brightness/Contrast

Adjusts an image's brightness and/or contrast.

Inputs

Outputs

Properties


Cell

A pipeline is run for each cell in the Pose Matrix. The Cell node is for obtaining a reference to the image produced by that cell's code. If your pipeline is linked to an entire stage, it will run once for each pose in that stage, so if you have three columns: calm, happy, and sad, the pipeline will run 3 times. The Cell node will provide the calm pose for the first run, the happy pose for the second, and the sad pose for the third.

Inputs

Outputs

Properties


Cell Reference

Whereas a Cell node refers to the Pose Matrix cell currently being processed, a Cell Reference node refers to a node elsewhere in the matrix (including another sheet).

Inputs

Outputs

Properties


Blend

Summary

Inputs

Outputs

Properties


Branch

Selects between True and False inputs based on a Predicate.

Inputs

Outputs

Properties


Channel Mixer

Controls how much of the RGB channels to include in the output. For example, to extract only the blue from an image.

Inputs

Outputs

Properties


Color

Emits a color value

Inputs

Outputs

Properties


Color Mask

Creates a mask from values in input In enqual to input Mask Color.

Inputs

Outputs

Properties


Cookie Cutter

Compares two images and either keep the similar pixels or discards them

Inputs

Outputs

Properties


Decimal

Emits a constant floating point value

Inputs

Outputs

Properties


Desaturate

Desaturates (removes the color) from an image.

Inputs

Outputs

Properties


Image

Obtains an image from a file path (as opposed to a KKL code).

Inputs

Outputs

Properties


Integer

Emits a constant integer between 0-255

Inputs

Outputs

Properties


Invert Colors

Inverts the colors of the input on a per channel basis.

Inputs

Outputs

Properties


Note

For internal comments and annotation.

Inputs

Outputs

Properties


Parameter

Outputs a parameter from the parameter list for the current cell or stage being processed.

Inputs

Outputs

Properties


Pipeline

Runs an image through another pipeline

Inputs

Outputs

Properties


Replace Color

Replaces colors that fall within a range with another color.

Inputs

Outputs

Properties


Result

Node whose only purpose is to indicate the final result of the pipeline. You cannot delete this node nor add more than one.

Inputs

Outputs

Properties


Slider

Emits a constant value between 0-1

Inputs

Outputs

Properties


Splitter

Splits the RGBA channels of an image into their numeric values which can be provided to an numeric input such as the Amount input of a Blend node.

Inputs

Outputs

Properties


Swizzle

Creates a color by flipping around channels of other colors

Inputs

Outputs

Properties


Text

Emits a constant text string.

Inputs

Outputs

Properties


Threshold

Converts pixels to grayscale, then compares them to a threshold value. If the value is beneath the threshold, the pixel is turned off. Otherwise it's turned on.

Inputs

Outputs

Properties

Pipeline Assets

Since the power of pipelines comes from combining multiple cells, you may find yourself creating sheets in your matrix whose sole purpose is to create intermediate images to apply to other poses. Such images have no reason to be retained on disk and waste your character's file space. To prevent such images from being saved to disk, you can mark them as a "Pipeline Asset." This can be done when selecting either an entire sheet or a row in the sheet.

Parameters

Each cell or row that has a pipeline can also list zero or more free text parameters, which are made available in the pipeline via the Parameter Node. This allows customization of pipeline behavior between different poses using the pipeline, most usefully as a way to redirect Cell Reference nodes to a different row.