Skip to content

Commit

Permalink
Permanent add KTX quality test and Sprite test to check fps count.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kristof Van Der Haeghen committed Feb 14, 2024
1 parent c110a36 commit cbc8fdf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
1 change: 0 additions & 1 deletion build/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<title>Simple Project</title>
<script>javascript:(function(){var script=document.createElement('script');script.onload=function(){var stats=new Stats();document.body.appendChild(stats.dom);requestAnimationFrame(function loop(){stats.update();requestAnimationFrame(loop)});};script.src='//mrdoob.github.io/stats.js/build/stats.min.js';document.head.appendChild(script);})()
</script>
<script src="https://unpkg.com/brotli/decompress"></script>
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0">
</head>
<body>
Expand Down
20 changes: 10 additions & 10 deletions build/webpack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Webpack from 'webpack';
import { Config } from './webpack.utils';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import CopyPlugin from 'copy-webpack-plugin';
import CompressionPlugin from 'compression-webpack-plugin';
// import CompressionPlugin from 'compression-webpack-plugin';
import Ip from 'ip';
import os from 'os';

Expand Down Expand Up @@ -84,15 +84,15 @@ const config: Webpack.Configuration = {

}),
new nodePolyfillPlugin(),
new CompressionPlugin({
algorithm: 'brotliCompress',
filename: '[name].br[query]',
test: /\.(js|css|html|svg)$/,
compressionOptions: { level: 6 },
threshold: 10240,
minRatio: 0.8,
deleteOriginalAssets: false,
}),
// new CompressionPlugin({
// algorithm: 'brotliCompress',
// filename: '[name].br[query]',
// test: /\.(js|css|html|svg)$/,
// compressionOptions: { level: 6 },
// threshold: 10240,
// minRatio: 0.8,
// deleteOriginalAssets: false,
// }),
],
output: {
filename: Config.outFileName,
Expand Down
22 changes: 11 additions & 11 deletions src/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ export class Project implements IProject {
}

private createButtons(): void {
const offset = 32;
const offset = 20;
const width = 128;
const height = 64;
const height = 48;
const scaleW = width * 1.5;
const scaleH = 64;
const scaleH = 56;

this.createButton('Save', this.saveContainer, 20, offset, scaleW, scaleH, async () => {
if (this.isSaving) return;
Expand Down Expand Up @@ -247,20 +247,20 @@ export class Project implements IProject {
this.updateButtonText('Load server zip', 'Load server');
});

this.resultText = this.createResultText('Logs:', 20, offset + height * 5).text;
this.resultText = this.createResultText('Logs:', 20, offset + height * 6).text;

// this.createButton('Print Usage', this.loadContainer, 20 + scaleW + offset, offset + height * 4.5, scaleW, scaleH * 0.5, () => {
// this.printUsageInfo();
// });

// this.createButton('KTX Quality Test', this.loadContainer, 20 + scaleW + offset, offset + height * 4.5, scaleW, scaleH * 0.5, async () => {
// this.disposeAll();
// this.logResults('Loading KTX2 test...');
// await this.ktxTestViewer.createTextures();
// this.logResults('KTX2 test loaded!');
// });
this.createButton('KTX Quality Test', this.loadContainer, 20, offset + height * 4.5, scaleW, scaleH, async () => {
this.disposeAll();
this.logResults('Loading KTX2 test...');
await this.ktxTestViewer.createTextures();
this.logResults('KTX2 test loaded!');
});

this.createButton('Add Sprites', this.loadContainer, 20 + scaleW + offset, offset + height * 4.5, scaleW, scaleH * 0.5, async () => {
this.createButton('Add test sprites', this.loadContainer, 20 + scaleW + offset, offset + height * 4.5, scaleW, scaleH, async () => {
const imageExt = this.ktx2Type ? 'KTX2_' + this.ktx2Type.toUpperCase() :'PNG'
this.logResults(`Loading 1000 ${imageExt} sprites...`);
await this.ktxTestViewer.createTestSprites(1000, this.ktx2Type);
Expand Down

0 comments on commit cbc8fdf

Please sign in to comment.