10 lines
700 B
JavaScript
10 lines
700 B
JavaScript
import assert from 'node:assert/strict';
|
|
import { readFile } from 'node:fs/promises';
|
|
import * as settings from '../src/constants/glass.ts';
|
|
const shader = await readFile(new URL('../src/shaders/mosaic.frag', import.meta.url), 'utf8');
|
|
assert.ok(settings.GLASS_TRANSMISSION_DETAIL > 0 && settings.GLASS_TRANSMISSION_DETAIL < 0.5,
|
|
'maximum simplification must retain optical detail while keeping color planes dominant');
|
|
assert.match(shader, /candidateColor=mix\(candidateColor,color.rgb,uTransmissionDetail\)/,
|
|
'retain the refracted scene, not raw photo UV or a facial-feature fallback');
|
|
console.log('Glass material keeps continuous refracted detail under maximum color-plane simplification.');
|