perf(falukant): simplify house runtime geometry
All checks were successful
Deploy to production / deploy (push) Successful in 1m54s
All checks were successful
Deploy to production / deploy (push) Successful in 1m54s
This commit is contained in:
@@ -62,6 +62,7 @@ function optimizeModelDirectory({ name, sourceDir, outputDir, required = false }
|
||||
}
|
||||
|
||||
console.log(`Optimize Falukant ${name} GLBs (Draco + texture 1024)\n`);
|
||||
const isHouse = name === 'house' || name === 'houses' || path.basename(sourceDir) === 'houses';
|
||||
|
||||
for (const f of models) {
|
||||
const input = path.join(sourceDir, f);
|
||||
@@ -71,7 +72,16 @@ function optimizeModelDirectory({ name, sourceDir, outputDir, required = false }
|
||||
try {
|
||||
const result = spawnSync(
|
||||
'node',
|
||||
[cli, 'optimize', input, output, '--compress', 'draco', '--texture-size', '1024'],
|
||||
[
|
||||
cli, 'optimize', input, output,
|
||||
'--compress', 'draco',
|
||||
'--texture-size', '1024',
|
||||
// Draco reduces download size, while simplify prevents high-poly
|
||||
// scans from exhausting browser GPU memory. Houses are small
|
||||
// previews, so they get a deliberately stronger reduction.
|
||||
'--simplify-ratio', isHouse ? '0.05' : '0.35',
|
||||
'--simplify-error', isHouse ? '0.02' : '0.01',
|
||||
],
|
||||
{
|
||||
stdio: 'inherit',
|
||||
cwd: path.join(__dirname, '..'),
|
||||
|
||||
Reference in New Issue
Block a user