Skip to content

着色器程序定义文件规范(Shader Program Defination File Specification)

Mouse edited this page Oct 7, 2019 · 2 revisions

shader.json

{
    "Parent": "<继承的着色器文件>",
    "Enable": ["<启用的GL功能>"],
    "Blend": {
        "SFactor": "",
        "DFactor": ""
    },
    "CullFace": "",
    "Vertex": "<顶点着色器文件名>",
    "Fragment": "<片元着色器文件名>",
    "PreProcessor": "<着色器预处理脚本>"
}

示例Shader(world.json):

{
    "Enable": ["CULL_FACE", "DEPTH_TEST", "BLEND", "TEXTURE0"],
    "Blend": {
        "SFactor": "SRC_ALPHA",
        "DFactor": "ONE_MINUS_SRC_ALPHA"
    },
    "CullFace": "BACK",
    "Vertex": "world.vert",
    "Fragment": "world.frag"
}