Skip to content
Arsen Tufankjian edited this page Apr 30, 2016 · 49 revisions

Scene

Render Pass

{
    //The layout of this pass's possible shader resources
    //Passes with the same layout are considered "Compatible"
    "RootLayout": "MyRootLayout.json",

     // List of render textures
    "Input": [
        {"Path":"PATH", "Set": 0, "Binding": 0},
        {"Path":"PATH", "Set": 0, "Binding": 1},
        {"Path":"PATH", "Set": 1, "Binding": 0}    
    ],

    "Output": [
        "PATH",
        "PATH"
    ]
}

Render Target

{
    "Width": ...,               //Unsigned int (uint32_t); Use 0 to specify that it should match the screen's width
    "Height": ...,              //Unsigned int (uint32_t); Use 0 to specify that it should match the screen's height
    "Format": "BGRA"            //"BGRA" and "RGBA" available for now
    "ClearColor": [0, 0, 0, 1]  //Clear color as 4 floats between 0 and 1; use null if you want to use the renderer's clear color (as defined in the ini file)
    "Blending" : {              //Optional; set to null if you don't want blending on this target
        "ColorBlendOp": "ADD",  //Options are ADD, SUB, REV_SUB, MIN, MAX, NONE
        "AlphaBlendOp": "NONE"  //Options are ADD, SUB, REV_SUB, MIN, MAX, NONE
    }
}

Pipeline

{
    "RenderPass" : "PATH",        //Path to a compatible render pass for this pipeline
    "Shaders": {
        "spv": {
            "Vertex":"raptor_VS.spv",
            "Fragment":"raptor_FS.spv",
            "Geometry":"",
            "Tess_Control":"",
            "Tess_Eval":"",
            "Compute":""
        },
        "cso": {
            "Vertex":"",
            "Fragment": "",
            "Geometry":"",
            "Tess_Control":"",
            "Tess_Eval":"",
            "Compute":""
        }
    },
    "ShaderVariables": [
        
    ],
    "VertexLayout": [
        {
            "SemanticName": "POSITION",
            "SemanticIndex": 0,
            "Type": "FLOAT3",
            "Slot": 0,
        }
        {
            "SemanticName": "NORMAL",
            "SemanticIndex": 1,
            "Type": "FLOAT3",
            "Slot": 0,
        }
        {
            "SemanticName": "COLOR",
            "SemanticIndex": 2,
            "Type": "FLOAT4",
            "Slot": 0,
        }
    ], 
    "InstanceLayout": 
    [
        {
            "SemanticName": "MODELMATRIX",
            "SemanticIndex": 3,
            "Type": "MAT4",
            "Slot": 1,
        }
    ],
    "DepthStencilState": {
        "TestDepth": true,
        "WriteDepth": true
    }
    "RasterState": {
        "PolygonMode": "Solid",
        "CullMode": "Back",
        "FrontCounterClockwise": true,
        "DepthClampEnable": true,
        "DiscardEnable": false,
        "LineWidth": 1.0
    },
    "MultisampleState": {
        "SampleCount": 1,            
        "MinSamples": 1.0,
        "PerSampleShading": false      
    }    
}

Material

{
    // This is the GUID of the parent pipeline
    "Pipeline": "PATH",

    // The path to the render passes that this material will render to
    "RenderPasses": ["PATH", "PATH"],

    "ShaderVariables": [ //Optional
    {
        "Vars": [{
            "Name": "Offset",
            "Type" : "FLOAT4",
            "Value" : [0, 1, 2, 3]
        }],
        "Set": 0,
        "Binding": 0
    },
    {
        "Vars": [{
            "Name": "DistortionMatrix",
            "Type" : "MAT4",
            "Value" : [1, 0, 0, 0,
                       0, 1, 0, 0,
                       0, 0, 1, 0,
                       0, 0, 0, 1]
        }],
        "Set": 0,
        "Binding" : 1
    }]

    "Textures" : [ //Optional
        {"Path": "PATH", "Set": 0, "Binding": 0},
        {"Path": "PATH", "Set": 1, "Binding": 1}
    ]
}

Sampler

{
    "FilterMode" : {
        "Mag": "NEAREST",
        "Min": "NEAREST"
    }, //Options are NEAREST and BILINEAR
    "WrapMode" : {
        "U": "WRAP",
        "V": "WRAP",
        "W": "WRAP"
    },//Options are WRAP, CLAMP, BORDER, MIRROR, and MIRROR_ONCE
    "MipMode": "LINEAR",  
    "MipLODBias": 0.0, 
    "MinLOD": 0.0,
    "MaxLOD": 0.0,
    "MaxAnistropy": 8,
    "CompareOp": "COMPARE_OP_NEVER",     //Options are COMPARE_OP_NEVER, COMPARE_OP_LESS, COMPARE_OP_EQUAL, COMPARE_OP_LESS_EQUAL, COMPARE_OP_GREATER, COMPARE_OP_NOT_EQUAL, COMPARE_OP_GREATER_EQUAL, COMPARE_OP_ALWAYS
    "BorderColor": "COLOR_OPAQUE_WHITE", //Options are COLOR_OPAQUE_WHITE, COLOR_OPAQUE_BLACK, COLOR_TRANSPARENT_BLACK
    "ColorSpace" : "LINEAR",             //Options are LINEAR and GAMMA
     
    "Immutable": { //Optional
        "Register": 0,
        "Space": 0,
        "Visibility": "VERTEX"    //Options are ALL, VERTEX, FRAGMENT, GEOMETRY, TESS_CONTROL, TESS_EVAL
    }
}

Root Descriptor

Describes the layout of all data available in any shader at any time. This is an abstraction of the D3D12 Root Layout and the Vulkan Pipeline layout. There is only one of these per application. We do not recommend writing one by hand.

{
    //Immutable samplers; exactly like the previous Sampler file spec
    "Samplers": [{
        "Filter": {
            "Mag": "BILINEAR",
            "Min": "BILINEAR"
        },
        "Address": {
            "U": "WRAP",
            "V": "WRAP",
            "W": "WRAP"
        },

        "MipLODBias": 0.0,
        "MinLOD": 0.0,
        "MaxLOD": 0.0,
        "MaxAnisotropy": 8,
        "CompareOp": "COMPARE_OP_NEVER",
        "BorderColor": "COLOR_OPAQUE_WHITE",
        "Immutable": {
            "Register": 0,
            "Space": 0,
            "Visibility": "VERTEX"
        }
    }],
    //Only D3D12 flags for now
    "Flags": [
        "LAYOUT_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT",
        "LAYOUT_DENY_TESS_CONTROL_SHADER_ROOT_ACCESS",
        "LAYOUT_DENY_TESS_EVAL_SHADER_ROOT_ACCESS",
        "LAYOUT_DENY_GEOMETRY_SHADER_ROOT_ACCESS",
        "LAYOUT_DENY_FRAGMENT_SHADER_ROOT_ACCESS",
        "LAYOUT_ALLOW_STREAM_OUTPUT"
    ],
    "ParameterCount": 2,
    "Parameters": [
        {
            "Type": "TABLE",                     //Options are TABLE, CONSTANT or a data type (CONSTANT_BUFFER, etc)
            "Visibility": "VERTEX",              //Options are VERTEX, FRAGMENT, GEOMETRY, TESS_CONTROL and TESS_EVAL
            "RangeCount": 1,
            "Ranges": [
                {
                    "Type": "CONSTANT_BUFFER",   //Options are CONSTANT_BUFFER, SAMPLER, SHADER_RESOURCE and UNORDERED_ACCESS; Cannot be CONSTANT or TABLE
                    "DescriptorCount": 1,
                    "BaseRegister": 0,
                    "RegisterSpace": 0
                }
            ]
        },
        {
            "Type": "CONSTANTS",
            "Visibility": "VERTEX",
            "ShaderRegister": 0,
            "RegisterSpace": 0,
            "DataType": "MAT4",        //Options are MAT4, FLOAT4, FLOAT3, FLOAT2, FLOAT, DOUBLE and INT
            "ValueCount": 1
        }
    ]
}
Clone this wiki locally