跳转到正文

10 · 验证与分发 ​

将完整 Amber 包交给另一个作者,并能从零解压、验证、加载与退回 BuiltIn。前置:09。完成后形成带文件清单、哈希、运行范围和已知限制的分发包。

本章修改与完整包 ​

保留 09 的运行功能与 fragment 结构,建立独立 10-distribution 身份和完整 README。ZIP 包含全部源文件及三个预设,不附带宿主二进制、工具、Mod、存档、WorldFinal 或原始驱动日志。下载页提供独立 inventory 与静态收据。

上一章完整下载 · 本章完整 ZIP、源码清单与收据

资源流 ​

registered source bytes → deterministic ZIP + inventory → fresh extraction → static branch checks → actual game lifecycle → documented distribution

第一步:下载完整 ZIP 和 inventory,在 PowerShell 用 Get-FileHash -Algorithm SHA256 核对下载页哈希。解压到一个新目录,确认 shaderpack.json 直接在根。按 inventory 核对每个文件的路径、长度和 SHA-256;不要只检查根 JSON。这里的 source fingerprint、ZIP hash 与 Loader manifestHash 分别描述源码字节、压缩包与解析后合同。

第二步:运行 pack、scene、各 Program interface、data/materials 与带选项的 graph 分支验证。至少覆盖默认、grade-off、glow-off、all-off、strength-max 与 economy。CLI graph dump 只验证默认配置;本网站脚本通过 JSON-RPC dawnlight/dumpGraph 的 inputs.options 逐分支解析。打开 includeInactive 时,图保留非活动声明,统计必须过滤 active=true。

第三步:在兼容宿主的创造测试世界加载,应用各预设,改一次 gain/strength,重载同名包,改变真实窗口尺寸,导出 driver/data report,再切回 BuiltIn。对同一世界 content-export 后执行材料解析;driverStatus=matched 只证明报告身份/接口匹配,仍需观察实际画面。保存测试版本、GPU、API、尺寸、条件与失败回退结果。

本轮复现由代理在隔离游戏副本中执行,不等于独立人类新手测试。下方运行记录绑定本章最终 ZIP 及源码指纹,并列明实际完成项;Android、VR、多 view、设备丢失恢复、其他驱动和性能门仍需专项验收。分发教学包不代表满足上游 release publish 的 P11 acceptance matrix。

活动分支矩阵 ​

每行均已对照源码与新解压 ZIP。数量只统计活动节点;资源数包含存在的材质 buffer。

分支覆盖值资源命令
default{}57
grade-off{"course:grade":false}35
strength-max{"course:strength":1,"course:gain":1.2}57
glow-off{"course:glow":false}46
all-off{"course:grade":false,"course:glow":false}35
economy{"course:grade":true,"course:glow":false,"course:strength":0.4,"course:gain":1}46
精确活动闭包

default

resource:course:materials, resource:course:post/color, resource:course:post/glow, resource:course:scene/color, resource:course:scene/depth

command:course:glow:0, command:course:grade:0, command:course:present-glow:0, command:course:terrain_alpha_tested:0, command:course:terrain_opaque:0, command:course:terrain_sorted_translucent:0, command:course:terrain_transparent:0

program:course:post/glow, program:course:post/grade, program:course:post/present, program:course:scene/terrain, program:dawnlight:scene_fallback/terrain_alpha_tested, program:dawnlight:scene_fallback/terrain_sorted_translucent, program:dawnlight:scene_fallback/terrain_transparent

活动 services: 0

grade-off

resource:course:materials, resource:course:scene/color, resource:course:scene/depth

command:course:present-raw:0, command:course:terrain_alpha_tested:0, command:course:terrain_opaque:0, command:course:terrain_sorted_translucent:0, command:course:terrain_transparent:0

program:course:post/present, program:course:scene/terrain, program:dawnlight:scene_fallback/terrain_alpha_tested, program:dawnlight:scene_fallback/terrain_sorted_translucent, program:dawnlight:scene_fallback/terrain_transparent

活动 services: 0

strength-max

resource:course:materials, resource:course:post/color, resource:course:post/glow, resource:course:scene/color, resource:course:scene/depth

command:course:glow:0, command:course:grade:0, command:course:present-glow:0, command:course:terrain_alpha_tested:0, command:course:terrain_opaque:0, command:course:terrain_sorted_translucent:0, command:course:terrain_transparent:0

program:course:post/glow, program:course:post/grade, program:course:post/present, program:course:scene/terrain, program:dawnlight:scene_fallback/terrain_alpha_tested, program:dawnlight:scene_fallback/terrain_sorted_translucent, program:dawnlight:scene_fallback/terrain_transparent

活动 services: 0

glow-off

resource:course:materials, resource:course:post/color, resource:course:scene/color, resource:course:scene/depth

command:course:grade:0, command:course:present-grade:0, command:course:terrain_alpha_tested:0, command:course:terrain_opaque:0, command:course:terrain_sorted_translucent:0, command:course:terrain_transparent:0

program:course:post/grade, program:course:post/present, program:course:scene/terrain, program:dawnlight:scene_fallback/terrain_alpha_tested, program:dawnlight:scene_fallback/terrain_sorted_translucent, program:dawnlight:scene_fallback/terrain_transparent

活动 services: 0

all-off

resource:course:materials, resource:course:scene/color, resource:course:scene/depth

command:course:present-raw:0, command:course:terrain_alpha_tested:0, command:course:terrain_opaque:0, command:course:terrain_sorted_translucent:0, command:course:terrain_transparent:0

program:course:post/present, program:course:scene/terrain, program:dawnlight:scene_fallback/terrain_alpha_tested, program:dawnlight:scene_fallback/terrain_sorted_translucent, program:dawnlight:scene_fallback/terrain_transparent

活动 services: 0

economy

resource:course:materials, resource:course:post/color, resource:course:scene/color, resource:course:scene/depth

command:course:grade:0, command:course:present-grade:0, command:course:terrain_alpha_tested:0, command:course:terrain_opaque:0, command:course:terrain_sorted_translucent:0, command:course:terrain_transparent:0

program:course:post/grade, program:course:post/present, program:course:scene/terrain, program:dawnlight:scene_fallback/terrain_alpha_tested, program:dawnlight:scene_fallback/terrain_sorted_translucent, program:dawnlight:scene_fallback/terrain_transparent

活动 services: 0

预设配方 ​

配方gradeglowstrengthgain
balancedtruetrue0.651.0
economytruefalse0.41.0
neutralfalsefalse0.651.0

完整着色器 ​

shaders/fullscreen.vsh
glsl
#version 320 es
precision highp float;
out vec2 v_uv;
void main() {
    const vec2 corners[4] = vec2[4](vec2(-1.0, -1.0), vec2(1.0, -1.0), vec2(-1.0, 1.0), vec2(1.0, 1.0));
    vec2 position = corners[gl_VertexID & 3];
    v_uv = position * 0.5 + 0.5;
    gl_Position = vec4(position, 0.0, 1.0);
}
shaders/glow.psh
glsl
#version 320 es
precision highp float;
uniform sampler2D u_source;
in vec2 v_uv;
layout(location = 0) out vec4 o_color;
void main() {
    vec2 pixel = 1.0 / vec2(textureSize(u_source, 0));
    vec3 center = texture(u_source, v_uv).rgb;
    vec3 blur = center * 0.4;
    blur += texture(u_source, v_uv + vec2(pixel.x * 2.0, 0.0)).rgb * 0.15;
    blur += texture(u_source, v_uv - vec2(pixel.x * 2.0, 0.0)).rgb * 0.15;
    blur += texture(u_source, v_uv + vec2(0.0, pixel.y * 2.0)).rgb * 0.15;
    blur += texture(u_source, v_uv - vec2(0.0, pixel.y * 2.0)).rgb * 0.15;
    o_color = vec4(clamp(center + max(blur - 0.55, 0.0) * 0.16, 0.0, 1.0), 1.0);
}
shaders/grade.psh
glsl
#version 320 es
precision highp float;
uniform sampler2D u_sceneColor;
uniform float u_gain;
uniform float u_day;
uniform float u_rain;
in vec2 v_uv;
layout(location = 0) out vec4 o_color;
void main() {
    vec3 source = texture(u_sceneColor, v_uv).rgb;
    vec3 amber = (source - 0.5) * 1.06 + 0.5;
    amber *= vec3(1.06, 1.0, 0.93);
    float daylight = 0.5 + 0.5 * sin(6.2831853 * (u_day - 0.25));
    amber *= mix(vec3(0.91, 0.96, 1.04), vec3(1.03, 1.01, 0.97), daylight);
    amber = mix(amber, amber * vec3(0.91, 0.95, 1.0), u_rain * 0.45) * u_gain;
    o_color = vec4(clamp(mix(source, amber, float(GRADE_STRENGTH)), 0.0, 1.0), 1.0);
}
shaders/present.psh
glsl
#version 320 es
precision highp float;
uniform sampler2D u_postColor;
in vec2 v_uv;
layout(location = 0) out vec4 o_color;
void main() {
    o_color = texture(u_postColor, v_uv);
}
shaders/terrain.psh
glsl
#version 320 es
// <Sampler Name='u_samplerState' Texture='u_texture' />
precision highp float;
precision highp int;
#include "/dawnlight/materials-v1.glsl"
uniform sampler2D u_texture;
in vec2 v_texcoord;
in vec4 v_color;
flat in highp uint v_identifier;
layout(location = 0) out vec4 o_sceneColor;
void main() {
    vec4 albedo = texture(u_texture, v_texcoord) * v_color;
    highp uint record = LookupMaterial(v_identifier);
    vec3 tint = AmberTint(record).rgb;
    float response = AmberResponse(record);
    if (MaterialHasTag(record, AMBER_MINERAL) && MaterialShaderId(record) == 1u)
        response *= 0.75;
    o_sceneColor = vec4(albedo.rgb * mix(vec3(1.0), tint, response), albedo.a);
}
shaders/terrain.vsh
glsl
#version 320 es
// <Semantic Name='TEXCOORD' Attribute='a_texcoord' />
// <Semantic Name='POSITION' Attribute='a_position' />
// <Semantic Name='COLOR' Attribute='a_color' />
// <Semantic Name='IDENTIFIER' Attribute='a_identifier' />
// <Semantic Name='NORMAL' Attribute='a_normal' />
// <Semantic Name='LIGHTLEVEL' Attribute='a_lightLevel' />
// <Semantic Name='PURELIGHT' Attribute='a_pureLight' />
// <Semantic Name='HEIGHTDATA' Attribute='a_heightData' />
uniform mat4 u_viewProjectionMatrix;
uniform vec2 u_origin;
uniform float u_lightTable[96];
layout(location = 0) in vec2 a_texcoord;
layout(location = 1) in vec3 a_position;
layout(location = 2) in vec4 a_color;
layout(location = 3) in uint a_identifier;
layout(location = 4) in vec3 a_normal;
layout(location = 5) in float a_lightLevel;
layout(location = 6) in float a_pureLight;
layout(location = 7) in float a_heightData;
out vec2 v_texcoord;
out vec4 v_color;
out vec3 v_normalEncoded;
flat out highp uint v_identifier;
void main() {
    int lightIndex = clamp(int(a_lightLevel) - 1, 0, 95);
    float light = clamp(u_lightTable[lightIndex], 0.0, 1.0);
    v_texcoord = a_texcoord;
    v_color = vec4(a_color.rgb * light, a_color.a);
    v_normalEncoded = clamp(a_normal / 255.0, 0.0, 1.0);
    v_identifier = a_identifier;
    vec3 relativePosition = vec3(a_position.x - u_origin.x, a_position.y, a_position.z - u_origin.y);
    gl_Position = u_viewProjectionMatrix * vec4(relativePosition, 1.0);
    OPENGL_POSITION_FIX;
}

完整 Manifest 与设置 ​

manifest/data.json
json
{
  "materials": {
    "abiVersion": 1,
    "fallback": "course:neutral",
    "properties": [
      {
        "id": "course:tint",
        "type": "vec4",
        "default": [
          1,
          1,
          1,
          1
        ],
        "glsl": "AmberTint"
      },
      {
        "id": "course:response",
        "type": "float",
        "default": 0,
        "range": [
          0,
          1
        ],
        "glsl": "AmberResponse"
      }
    ],
    "tags": [
      {
        "id": "course:mineral",
        "glsl": "AMBER_MINERAL"
      }
    ],
    "definitions": [
      {
        "id": "course:neutral",
        "shaderId": 0
      },
      {
        "id": "course:stone",
        "shaderId": 1,
        "tags": [
          "course:mineral"
        ],
        "values": {
          "course:tint": [
            1.08,
            1.01,
            0.92,
            1
          ],
          "course:response": 0.25
        }
      },
      {
        "id": "course:sand",
        "shaderId": 2,
        "values": {
          "course:tint": [
            1.06,
            1.02,
            0.94,
            1
          ],
          "course:response": 0.4
        }
      }
    ],
    "contentGroups": [
      {
        "id": "course:stones",
        "ids": [
          "survivalcraft:GraniteBlock",
          "survivalcraft:BasaltBlock"
        ]
      }
    ],
    "mappings": [
      {
        "id": "course:stone-map",
        "match": {
          "groups": [
            "course:stones"
          ]
        },
        "material": "course:stone",
        "priority": 10,
        "onMissing": "skip"
      },
      {
        "id": "course:sand-map",
        "match": {
          "ids": [
            "survivalcraft:SandBlock"
          ]
        },
        "material": "course:sand",
        "priority": 10,
        "onMissing": "skip"
      },
      {
        "id": "course:optional-mod-stone",
        "match": {
          "ids": [
            "amberdemo:MarbleBlock"
          ]
        },
        "material": "course:stone",
        "priority": 20,
        "onMissing": "skip"
      }
    ]
  },
  "customData": {
    "abiVersion": 1,
    "variables": [
      {
        "id": "course:gain",
        "type": "float",
        "frequency": "generation",
        "default": 1,
        "onError": "useDefault",
        "expression": {
          "option": "course:gain",
          "as": "float"
        }
      },
      {
        "id": "course:day",
        "type": "float",
        "frequency": "frame",
        "unit": "day_fraction",
        "default": 0.5,
        "onError": "useDefault",
        "expression": {
          "input": "dawnlight:data/day_time",
          "version": 1
        }
      },
      {
        "id": "course:rain",
        "type": "float",
        "frequency": "frame",
        "unit": "dimensionless",
        "default": 0,
        "onError": "useDefault",
        "expression": {
          "call": "clamp",
          "args": [
            {
              "input": "dawnlight:data/weather_precipitation",
              "version": 1
            },
            {
              "literal": 0,
              "type": "float"
            },
            {
              "literal": 1,
              "type": "float"
            }
          ]
        }
      }
    ]
  }
}
manifest/options.json
json
{
  "options": [
    {
      "id": "course:grade",
      "type": "boolean",
      "default": true,
      "impact": [
        "pipeline",
        "resources"
      ]
    },
    {
      "id": "course:strength",
      "type": "number",
      "default": 0.65,
      "min": 0,
      "max": 1,
      "impact": [
        "program"
      ]
    },
    {
      "id": "course:gain",
      "type": "number",
      "default": 1,
      "min": 0.5,
      "max": 1.5,
      "impact": [
        "uniform"
      ]
    },
    {
      "id": "course:glow",
      "type": "boolean",
      "default": true,
      "impact": [
        "pipeline",
        "resources"
      ]
    }
  ]
}
manifest/passes.json
json
{
  "passes": [
    {
      "id": "course:terrain_opaque",
      "enabled": true,
      "stage": {
        "template": "dawnlight:command_list",
        "version": 1,
        "target": "world",
        "phase": "opaque"
      },
      "services": [],
      "programs": [
        "course:scene/terrain"
      ],
      "commands": [
        {
          "type": "engineDraw",
          "sceneProvider": {
            "id": "dawnlight:scene_draw/terrain_opaque",
            "version": 2
          },
          "targets": {
            "colors": [
              {
                "location": 0,
                "resource": "course:scene/color",
                "loadOp": "load",
                "storeOp": "store"
              }
            ],
            "depth": {
              "resource": "course:scene/depth",
              "loadOp": "clear",
              "storeOp": "store",
              "clearValue": 1
            }
          },
          "state": {
            "blend": "opaque",
            "depth": "default",
            "rasterizer": "cullCounterClockwiseScissor"
          },
          "viewport": {
            "source": "target",
            "restore": "frame",
            "synchronizeScissor": true
          },
          "program": "course:scene/terrain",
          "sceneBindings": [
            {
              "symbol": "u_viewProjectionMatrix",
              "contract": "dawnlight:scene_binding/view_projection",
              "version": 1,
              "frequency": "view"
            },
            {
              "symbol": "u_origin",
              "contract": "dawnlight:scene_binding/terrain_origin",
              "version": 1,
              "frequency": "view"
            },
            {
              "symbol": "u_lightTable",
              "contract": "dawnlight:scene_binding/light_table",
              "version": 1,
              "frequency": "batch"
            },
            {
              "symbol": "u_texture",
              "contract": "dawnlight:scene_binding/block_texture",
              "version": 1,
              "frequency": "draw",
              "binding": 0
            }
          ],
          "bindings": [
            {
              "kind": "storageBuffer",
              "symbol": "MaterialTable",
              "binding": 4,
              "resource": "course:materials",
              "access": "readOnly"
            }
          ]
        }
      ],
      "inputs": [
        "course:scene/color",
        "course:scene/depth",
        "course:materials"
      ],
      "outputs": [
        "course:scene/color",
        "course:scene/depth"
      ]
    },
    {
      "id": "course:terrain_alpha_tested",
      "enabled": true,
      "stage": {
        "template": "dawnlight:command_list",
        "version": 1,
        "target": "world",
        "phase": "opaque",
        "ordering": {
          "after": [
            "course:terrain_opaque"
          ]
        }
      },
      "services": [],
      "programs": [],
      "commands": [
        {
          "type": "engineDraw",
          "sceneProvider": {
            "id": "dawnlight:scene_draw/terrain_alpha_tested",
            "version": 2
          },
          "targets": {
            "colors": [
              {
                "location": 0,
                "resource": "course:scene/color",
                "loadOp": "load",
                "storeOp": "store"
              }
            ],
            "depth": {
              "resource": "course:scene/depth",
              "loadOp": "load",
              "storeOp": "store"
            }
          },
          "state": {
            "blend": "opaque",
            "depth": "default",
            "rasterizer": "cullCounterClockwiseScissor"
          },
          "viewport": {
            "source": "target",
            "restore": "frame",
            "synchronizeScissor": true
          }
        }
      ],
      "inputs": [
        "course:scene/color",
        "course:scene/depth"
      ],
      "outputs": [
        "course:scene/color",
        "course:scene/depth"
      ]
    },
    {
      "id": "course:terrain_transparent",
      "enabled": true,
      "stage": {
        "template": "dawnlight:command_list",
        "version": 1,
        "target": "world",
        "phase": "transparent"
      },
      "services": [],
      "programs": [],
      "commands": [
        {
          "type": "engineDraw",
          "sceneProvider": {
            "id": "dawnlight:scene_draw/terrain_transparent",
            "version": 2
          },
          "targets": {
            "colors": [
              {
                "location": 0,
                "resource": "course:scene/color",
                "loadOp": "load",
                "storeOp": "store"
              }
            ],
            "depth": {
              "resource": "course:scene/depth",
              "loadOp": "load",
              "storeOp": "store"
            }
          },
          "state": {
            "blend": "alphaBlend",
            "depth": "default",
            "rasterizer": "cullCounterClockwiseScissor"
          },
          "viewport": {
            "source": "target",
            "restore": "frame",
            "synchronizeScissor": true
          }
        }
      ],
      "inputs": [
        "course:scene/color",
        "course:scene/depth"
      ],
      "outputs": [
        "course:scene/color",
        "course:scene/depth"
      ]
    },
    {
      "id": "course:terrain_sorted_translucent",
      "enabled": true,
      "stage": {
        "template": "dawnlight:command_list",
        "version": 1,
        "target": "world",
        "phase": "transparent",
        "ordering": {
          "after": [
            "course:terrain_transparent"
          ]
        }
      },
      "services": [],
      "programs": [],
      "commands": [
        {
          "type": "engineDraw",
          "sceneProvider": {
            "id": "dawnlight:scene_draw/terrain_sorted_translucent",
            "version": 2
          },
          "targets": {
            "colors": [
              {
                "location": 0,
                "resource": "course:scene/color",
                "loadOp": "load",
                "storeOp": "store"
              }
            ],
            "depth": {
              "resource": "course:scene/depth",
              "loadOp": "load",
              "storeOp": "store"
            }
          },
          "state": {
            "blend": "alphaBlend",
            "depth": "default",
            "rasterizer": "cullCounterClockwiseScissor"
          },
          "viewport": {
            "source": "target",
            "restore": "frame",
            "synchronizeScissor": true
          }
        }
      ],
      "inputs": [
        "course:scene/color",
        "course:scene/depth"
      ],
      "outputs": [
        "course:scene/color",
        "course:scene/depth"
      ]
    },
    {
      "id": "course:grade",
      "enabled": true,
      "stage": {
        "template": "dawnlight:command_list",
        "version": 1,
        "target": "afterDraw",
        "phase": "afterDraw"
      },
      "services": [],
      "programs": [
        "course:post/grade"
      ],
      "commands": [
        {
          "type": "fullscreen",
          "program": "course:post/grade",
          "bindings": [
            {
              "kind": "sampler2D",
              "symbol": "u_sceneColor",
              "binding": 0,
              "resource": "course:scene/color"
            }
          ],
          "state": {
            "blend": "opaque",
            "depth": "disabled",
            "rasterizer": "cullNoneScissor"
          },
          "viewport": {
            "source": "target",
            "restore": "frame",
            "synchronizeScissor": true
          },
          "targets": {
            "colors": [
              {
                "location": 0,
                "resource": "course:post/color",
                "loadOp": "dontCare",
                "storeOp": "store"
              }
            ]
          },
          "customBindings": [
            {
              "symbol": "u_gain",
              "variable": "course:gain"
            },
            {
              "symbol": "u_day",
              "variable": "course:day"
            },
            {
              "symbol": "u_rain",
              "variable": "course:rain"
            }
          ]
        }
      ],
      "inputs": [
        "course:scene/color"
      ],
      "outputs": [
        "course:post/color"
      ],
      "enabledWhen": [
        {
          "option": "course:grade",
          "equals": true
        }
      ]
    },
    {
      "id": "course:glow",
      "enabled": true,
      "stage": {
        "template": "dawnlight:command_list",
        "version": 1,
        "target": "afterDraw",
        "phase": "afterDraw",
        "ordering": {
          "after": [
            "course:grade"
          ]
        }
      },
      "services": [],
      "programs": [
        "course:post/glow"
      ],
      "commands": [
        {
          "type": "fullscreen",
          "program": "course:post/glow",
          "bindings": [
            {
              "kind": "sampler2D",
              "symbol": "u_source",
              "binding": 0,
              "resource": "course:post/color"
            }
          ],
          "state": {
            "blend": "opaque",
            "depth": "disabled",
            "rasterizer": "cullNoneScissor"
          },
          "viewport": {
            "source": "target",
            "restore": "frame",
            "synchronizeScissor": true
          },
          "targets": {
            "colors": [
              {
                "location": 0,
                "resource": "course:post/glow",
                "loadOp": "dontCare",
                "storeOp": "store"
              }
            ]
          }
        }
      ],
      "inputs": [
        "course:post/color"
      ],
      "outputs": [
        "course:post/glow"
      ],
      "enabledWhen": [
        {
          "option": "course:grade",
          "equals": true
        },
        {
          "option": "course:glow",
          "equals": true
        }
      ]
    },
    {
      "id": "course:present-grade",
      "enabled": true,
      "stage": {
        "template": "dawnlight:command_list",
        "version": 1,
        "target": "afterDraw",
        "phase": "screenOutput",
        "ordering": {
          "after": [
            "course:grade"
          ]
        }
      },
      "services": [],
      "programs": [
        "course:post/present"
      ],
      "commands": [
        {
          "type": "present",
          "program": "course:post/present",
          "bindings": [
            {
              "kind": "sampler2D",
              "symbol": "u_postColor",
              "binding": 0,
              "resource": "course:post/color"
            }
          ],
          "state": {
            "blend": "opaque",
            "depth": "disabled",
            "rasterizer": "cullNoneScissor"
          },
          "viewport": {
            "source": "frame",
            "restore": "none",
            "synchronizeScissor": true
          }
        }
      ],
      "inputs": [
        "course:post/color"
      ],
      "outputs": [],
      "enabledWhen": [
        {
          "option": "course:grade",
          "equals": true
        },
        {
          "option": "course:glow",
          "equals": false
        }
      ]
    },
    {
      "id": "course:present-raw",
      "enabled": true,
      "stage": {
        "template": "dawnlight:command_list",
        "version": 1,
        "target": "afterDraw",
        "phase": "screenOutput"
      },
      "services": [],
      "programs": [
        "course:post/present"
      ],
      "commands": [
        {
          "type": "present",
          "program": "course:post/present",
          "bindings": [
            {
              "kind": "sampler2D",
              "symbol": "u_postColor",
              "binding": 0,
              "resource": "course:scene/color"
            }
          ],
          "state": {
            "blend": "opaque",
            "depth": "disabled",
            "rasterizer": "cullNoneScissor"
          },
          "viewport": {
            "source": "frame",
            "restore": "none",
            "synchronizeScissor": true
          }
        }
      ],
      "inputs": [
        "course:scene/color"
      ],
      "outputs": [],
      "enabledWhen": [
        {
          "option": "course:grade",
          "equals": false
        }
      ]
    },
    {
      "id": "course:present-glow",
      "enabled": true,
      "stage": {
        "template": "dawnlight:command_list",
        "version": 1,
        "target": "afterDraw",
        "phase": "screenOutput",
        "ordering": {
          "after": [
            "course:glow"
          ]
        }
      },
      "services": [],
      "programs": [
        "course:post/present"
      ],
      "commands": [
        {
          "type": "present",
          "program": "course:post/present",
          "bindings": [
            {
              "kind": "sampler2D",
              "symbol": "u_postColor",
              "binding": 0,
              "resource": "course:post/glow"
            }
          ],
          "state": {
            "blend": "opaque",
            "depth": "disabled",
            "rasterizer": "cullNoneScissor"
          },
          "viewport": {
            "source": "frame",
            "restore": "none",
            "synchronizeScissor": true
          }
        }
      ],
      "inputs": [
        "course:post/glow"
      ],
      "outputs": [],
      "enabledWhen": [
        {
          "option": "course:grade",
          "equals": true
        },
        {
          "option": "course:glow",
          "equals": true
        }
      ]
    }
  ],
  "sceneCategories": [
    {
      "id": "dawnlight:scene/terrain_opaque",
      "version": 1,
      "mode": "override",
      "stage": "course:terrain_opaque"
    },
    {
      "id": "dawnlight:scene/terrain_alpha_tested",
      "version": 1,
      "mode": "builtin"
    },
    {
      "id": "dawnlight:scene/terrain_transparent",
      "version": 1,
      "mode": "builtin"
    },
    {
      "id": "dawnlight:scene/terrain_sorted_translucent",
      "version": 1,
      "mode": "builtin"
    }
  ]
}
manifest/programs.json
json
{
  "programs": [
    {
      "id": "course:scene/terrain",
      "kind": "graphics",
      "vertex": "terrain.vsh",
      "fragment": "terrain.psh",
      "compileMode": "officialCompatible"
    },
    {
      "id": "course:post/grade",
      "kind": "graphics",
      "vertex": "fullscreen.vsh",
      "fragment": "grade.psh",
      "compileMode": "manifestDriven",
      "defines": {
        "GRADE_STRENGTH": {
          "option": "course:strength"
        }
      }
    },
    {
      "id": "course:post/present",
      "kind": "graphics",
      "vertex": "fullscreen.vsh",
      "fragment": "present.psh",
      "compileMode": "manifestDriven"
    },
    {
      "id": "course:post/glow",
      "kind": "graphics",
      "vertex": "fullscreen.vsh",
      "fragment": "glow.psh",
      "compileMode": "manifestDriven"
    }
  ]
}
manifest/resources.json
json
{
  "resources": [
    {
      "id": "course:scene/color",
      "kind": "texture2D",
      "lifetime": "persistent",
      "size": {
        "mode": "viewport"
      },
      "format": "rgba8"
    },
    {
      "id": "course:scene/depth",
      "kind": "texture2D",
      "lifetime": "persistent",
      "size": {
        "mode": "viewport"
      },
      "format": "depth24"
    },
    {
      "id": "course:post/color",
      "kind": "texture2D",
      "lifetime": "persistent",
      "size": {
        "mode": "viewport"
      },
      "format": "rgba8"
    },
    {
      "id": "course:materials",
      "kind": "buffer",
      "lifetime": "persistent",
      "usage": "staticDraw",
      "content": {
        "type": "materialTable",
        "version": 1
      }
    },
    {
      "id": "course:post/glow",
      "kind": "texture2D",
      "lifetime": "persistent",
      "size": {
        "mode": "viewport",
        "scale": [
          0.5,
          0.5
        ]
      },
      "format": "rgba8"
    }
  ]
}
presets/balanced.json
json
{
  "course:grade": true,
  "course:glow": true,
  "course:strength": 0.65,
  "course:gain": 1.0
}
presets/economy.json
json
{
  "course:grade": true,
  "course:glow": false,
  "course:strength": 0.4,
  "course:gain": 1.0
}
presets/neutral.json
json
{
  "course:grade": false,
  "course:glow": false,
  "course:strength": 0.65,
  "course:gain": 1.0
}
settings.json
json
{
  "schemaVersion": 1,
  "defaultLocale": "en-US",
  "translations": {
    "zh-CN": {
      "page.amber": "琥珀课程",
      "course:grade": "调色",
      "course:strength": "调色强度(重新编译)",
      "course:gain": "曝光增益",
      "course:glow": "半分辨率柔光"
    },
    "en-US": {
      "page.amber": "Amber course",
      "course:grade": "Color grade",
      "course:strength": "Grade strength (recompile)",
      "course:gain": "Exposure gain",
      "course:glow": "Half-resolution glow"
    }
  },
  "pages": [
    {
      "id": "amber",
      "title": "page.amber",
      "groups": [
        {
          "id": "look",
          "controls": [
            {
              "id": "grade",
              "option": "course:grade",
              "widget": "toggle",
              "label": "course:grade"
            },
            {
              "id": "strength",
              "option": "course:strength",
              "widget": "slider",
              "label": "course:strength",
              "min": 0,
              "max": 1,
              "step": 0.05,
              "format": "0.00",
              "enabledWhen": [
                {
                  "option": "course:grade",
                  "equals": true
                }
              ]
            },
            {
              "id": "gain",
              "option": "course:gain",
              "widget": "slider",
              "label": "course:gain",
              "min": 0.5,
              "max": 1.5,
              "step": 0.05,
              "format": "0.00",
              "enabledWhen": [
                {
                  "option": "course:grade",
                  "equals": true
                }
              ]
            },
            {
              "id": "glow",
              "option": "course:glow",
              "widget": "toggle",
              "label": "course:glow"
            }
          ]
        }
      ]
    }
  ]
}
shaderpack.json
json
{
  "manifestVersion": 5,
  "sceneAbiVersion": 2,
  "expectedCatalogSha256": "4bc28c17beffea2311a422fff9f633d2e4f03784460d0254adda8af2e766d84c",
  "id": "course:10-distribution",
  "name": "Dawnlight Course · Amber 10-distribution",
  "version": "1.0.0",
  "author": "EltanceX",
  "description": "Website-authored Amber course snapshot; see README for tested scope.",
  "shaderRoot": "shaders",
  "frameTarget": {
    "targets": {
      "colors": [
        {
          "location": 0,
          "resource": "course:scene/color",
          "loadOp": "clear",
          "storeOp": "store",
          "clearValue": [
            0,
            0,
            0,
            1
          ]
        }
      ],
      "depth": {
        "resource": "course:scene/depth",
        "loadOp": "clear",
        "storeOp": "store",
        "clearValue": 1
      }
    }
  },
  "settings": "settings.json",
  "sourceFormatVersion": 1,
  "fragments": [
    "manifest/options.json",
    "manifest/resources.json",
    "manifest/programs.json",
    "manifest/passes.json",
    "manifest/data.json"
  ]
}

验证与画面 ​

解压为 shaderpacks 的新直接子目录,在包根目录使用环境准备中安装的固定 Analyzer。预期退出码 0、无诊断;材质未提供世界快照时 deferred 是预期。进入创造世界应用设置,再重载、调整尺寸并切回 BuiltIn。

powershell
$analyzer = "C:\Tools\Dawnlight\shaderpack-analyzer.exe"
& $analyzer pack validate . --format json
& $analyzer scene explain . --include-inactive --format json
& $analyzer graph dump . --contract 2 --include-inactive
& $analyzer program interface . --program course:scene/terrain --contract 2
& $analyzer program interface . --program course:post/grade --contract 2
& $analyzer program interface . --program course:post/present --contract 2
& $analyzer program interface . --program course:post/glow --contract 2
& $analyzer data explain . --format json
& $analyzer materials explain . --format json
& $analyzer scene explain . --options presets/economy.json --include-inactive --format json
& $analyzer data explain . --options presets/economy.json --format json

以上 graph CLI 命令只检查默认值。已提交分支收据使用显式 inputs.options 的 JSON-RPC,见上表和维护流程。

实际映射需加载世界后运行 /switchshader content-export,将该文件以 --content-snapshot world-final.json 传给 materials explain。用 /switchshader export-data-driver-report 导出 Data 接口证据;世界快照保留在本地。

实际游戏观察 · W6

已在隔离创造世界完成 6 个选项分支的加载/切换、同名重载、真实窗口尺寸变化与返回 BuiltIn。Program 链接与帧缓冲完整;Data 接口报告匹配,未进行数值读回。

79ed24ac3d796f5ed8b60dcea274cf4de7e3cac0a43c792652d2f5fb62bdffc3

分支与生命周期证据摘要

默认配置下的实际游戏窗口;裁去标题栏并缩小。截图不作性能或数值证据。

宿主、方法与未验证范围 →

常见卡点 ​

能加载但画面不对:检查当前选择是否真是 External、是否回退了 BuiltIn,比较 manifest/source/generation identity。ZIP 新增了文件却哈希不变:你可能下载或运行了旧 URL。材质 driver 报告过期:重新从同世界、同 generation 导出;不能拿 Scene contract v1 报告冒充 Data contract v2。

动手练习 ​

让另一位作者仅凭本章 ZIP 与 README 完成流程,记录卡住的步骤;与本次代理复现分开登记。发布你自己的改版时使用新的 ID/version 和新指纹下载 URL,保留旧课程包身份;补充你的宿主与硬件验收范围。

README ​

README.md
md
# Amber course 10-distribution / 琥珀课程

Website-authored teaching pack, Manifest 5 / Scene ABI 2, host f8aaa5c4218f54536ccf994a2d512aed2e3678b7.

## Install / 安装

Extract the ZIP as shaderpacks/10-distribution/shaderpack.json (no extra wrapper folder). In a creative test world run /switchshader 10-distribution. Use the authored Shader Pack settings to edit options and apply. Reload by switching to the same pack again. /switchshader builtin restores BuiltIn.

ZIP 解压后根目录直接包含 shaderpack.json。使用创造测试世界;修改设置后应用,切换同名包可重载。

## Appearance / 效果

Amber uses a gentle warm contrast. Public day_time and weather_precipitation inputs alter the grade; gain is typed custom data. Opaque Terrain uses stable stone/sand content mappings and a readonly materialTable SSBO; all other content uses a neutral fallback. Optional half-resolution glow adds a five-tap highlight pass. This is LDR soft glow, not HDR bloom. 

Chapter 05 returns from the MRT debug view to the chapter 03 color pipeline; the extra debug attachments are deliberately removed. Terrain alpha-tested, transparent and sorted-translucent routes keep host BuiltIn fallback.

## Options / 选项

course:grade (default true): disabling removes grade and glow from the active closure and presents scene color directly. course:strength (0–1, default 0.65) is a Program define and recompiles. course:gain (0.5–1.5, default 1) supplies a generation-frequency float; it is consumed only by grade. course:glow (default true) allocates a half-resolution RGBA8 output only when grade is enabled. 

## Presets / 预设

The JSON files in presets/ are Analyzer option override files and documented recipes, not an automatic host preset API. Balanced = all defaults; economy = grade on / glow off / strength 0.4 / gain 1; neutral = grade off / glow off. Apply the same values in the in-game settings. Optional amberdemo:MarbleBlock is a fictional integration example: onMissing=skip. Install no Mod to follow this course. Unmatched content uses course:neutral (shaderId 0).

## Verify / 验证

Run the pinned shaderpack-analyzer pack validate, scene explain, graph dump --contract 2 and program interface --contract 2 commands. For options use scene --options and data commands --options. Graph CLI on this baseline does not consume option overrides: use dawnlight/dumpGraph JSON-RPC inputs.options for branch graphs. See https://core.eltancex.top/tutorial/10-distribution and its English counterpart.

Check source/archive SHA-256 against the website inventory. Static success does not prove GPU compilation or runtime data. Use a creative world; load, edit settings, reload, resize, export reports, then switch to BuiltIn. Test Android, VR, different GPUs and device loss separately. No universal compatibility, performance gate or release-ready claim.

## Ownership / 来源

Course source: https://github.com/EltanceX/dawnlight-core-docs/tree/main/examples/course/10-distribution
Public host contracts: https://gitea.com/EltanceX/DawnlightCore at the pinned commit above. No host binary or private source is included.

tool-contracts · materials · programs

完整运行记录与限制

作者文档 · Manifest v5 / Scene ABI v2