|
|
@@ -97,9 +97,17 @@ const { builtinConfig, normalizeConfig } = await import('../../../src/modules/co
|
|
|
assert.ok(shader.includes('0.2126, 0.7152, 0.0722'), '同一套 Rec.709 亮度权重')
|
|
|
assert.ok(shader.includes('out_FragColor'), '用 Cesium 当前的 out_FragColor 出口')
|
|
|
assert.ok(shader.includes('gradeTintStrength * (1.0 - luma)'), '阴影权重公式与 domain 一致')
|
|
|
- // varying 而不是 in:与雾 shader(真机验证过的模板)保持一致;写 in 是并行会话的
|
|
|
- // 未提交实验,GLSL 翻译行为未经验证, shader 编译失败 = 整帧失败 = 三维场景消失。
|
|
|
- assert.ok(shader.includes('varying vec2 v_textureCoordinates;'), 'shader 用雾同款 varying 模板')
|
|
|
+ // Installed Cesium ViewportQuadVS outputs v_textureCoordinates under GLSL 300 es.
|
|
|
+ // The browser compile log proves `varying` is invalid; assert both actual stage sources.
|
|
|
+ for (const name of ['GRADE_FRAGMENT_SHADER', 'FOG_FRAGMENT_SHADER']) {
|
|
|
+ const source = engine.match(new RegExp('const ' + name + ' = `([\\s\\S]*?)`'))?.[1]
|
|
|
+ assert.ok(source, `${name} must exist`)
|
|
|
+ // 截断哨兵:正则假定模板内无反引号;若日后出现,source 会被静默截断。
|
|
|
+ // 模板以 void main 收尾,断言它同时挡「提取失败」与「提取被截断」两种失配。
|
|
|
+ assert.ok(source.includes('void main'), `${name} extraction intact (ends at void main, not truncated by a stray backtick)`)
|
|
|
+ assert.ok(source.includes('in vec2 v_textureCoordinates;'), `${name} uses GLSL3 fragment input`)
|
|
|
+ assert.ok(!/\bvarying\b|\btexture2D\b|\bgl_FragColor\b/.test(source), `${name} rejects GLSL1 syntax`)
|
|
|
+ }
|
|
|
console.log('PASS C1 引擎处理级:函数 uniform、enabled 随计划、shader 与 domain 同序同式')
|
|
|
}
|
|
|
|