{
"name": "PipelineName",
"permutations": {
},
"imports": {
},
"options": {
},
"useVariables": {
},
"inputs": {
},
"outputs": {
},
"resources": {
},
"tasks": {
}
}
Unique name for the pipeline.
Not used. Sometimes set to 'Full'.
The imports section may contained named imported pipelines, which may in turn be used like tasks.
Imports are defined as "key": "value"
pairs, where the key is a unique identifier used to reference the pipeline, and the value is the path to a valid pipeline file.
{
"imports": {
"Imported": "Pipelines/Other.pipeline"
}
// ...
"tasks": {
"MyImportedTask": {
"type": "$Imported",
// ...
}
}
}
The options section may contain per pipeline options that control resource availability and task flow. The following example shows how to use the Cogs runtime variable mysettings.value to change the pipeline behaviour depending on its value at the pipeline startup.
{
"options": {
"MyOption": {
"values": [ "MyValueA", "MyValueB" ],
"setting": "mysettings.value"
},
},
// ...
"tasks": {
"$MyOption==MyValueA": {
"MyTask": {
// ...
}
},
"$MyOption==MyValueB": {
"MyOtherTask": {
// ...
}
},
}
}
The useVariables section defines variables which will be bound to Cogs runtime variables, including their default values (if variable was not defined).
{
"useVariables": {
"lightScale": "renderer.lightScale 1.0",
"radius": "renderer.postProcess.bloom.radius 5.0",
"rampThreshold": "renderer.postProcess.bloom.rampThreshold 3.0",
"rampWidth": "renderer.postProcess.bloom.rampWidth 2.0",
"intensity": "renderer.postProcess.bloom.intensity 0.2"
}
}
The inputs section defines named input slots used to bind input resources to the pipeline.
Input slots are defined as "key": "value"
pairs where the key is an identifier used to refer to the resource and value is a resource type.
{
"inputs": {
"Color": "Texture2D",
"Depth": "Texture2D",
}
}
The outputs section defines named output slots used to bind output resources to the pipeline.
Output slots are defined as "key": "value"
pairs where the key is an identifier used to refer to the resource and value is a resource type.
{
"outputs": {
"Color": "RenderTarget",
"Compute": "RenderBuffer"
}
}
The resources section defines resources and resource aliases to be used by tasks.
{
"resources": {
"MyTexture": {
"type": "Texture2D",
"format": "R8G8B8A8_UNORM_SRGB",
"width": 1024,
"height": 1024
},
"MyRenderTarget": {
"type": "RenderTarget",
"textures": [ "MyTexture" ],
},
"MyAliasTexture": "Texture2D MyTexture"
}
}
Resource types {#resourceTypes}
The tasks section defines the set of tasks that should be instantiated for the pipeline.
{
"tasks": {,
"MyFilterTask": {
"type": "Filter",
"input": [ "Cogs.RenderList" ],
"output": "MyRenderList",
"bucketMask": "All",
"permutation": "Forward"
},
"MyRenderTask": {
"type": "RenderList",
"input": "MyRenderList",
"output": "MyRenderTarget",
"permutation": "Forward"
}
}
}
Where type
can be an application defined value (defined by the key parameter specified when calling Cogs::Core::addTaskType
to register a Cogs::Core::RenderTask
derived class), or one of the following:
Type names are case sensitive.
Filter render items based on state in a render list.
Execute a render list. This will setup the render targets, buffers, and other state before doing the draw calls for render items in the render list.