Skip to content

Commit d82a162

Browse files
author
FMS-Cat
committed
refactor: revamp measure system
1 parent 7bfdb79 commit d82a162

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+285
-253
lines changed

src/config-hot.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,6 @@ export const
1111
COMPONENT_UPDATE_BREAKPOINT: string | null = null,
1212
// COMPONENT_UPDATE_BREAKPOINT: string | null = 'lightDynamic2/shadowMapCamera',
1313
// COMPONENT_UPDATE_BREAKPOINT: string | null = 'lightDynamic1/shadowMapCamera',
14-
COMPONENT_DRAW_BREAKPOINT: string | null = null;
14+
COMPONENT_DRAW_BREAKPOINT: string | null = null,
15+
COMPONENT_UPDATE_PATTERN = /.*/,
16+
COMPONENT_DRAW_PATTERN = /deferred/;

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const
55
AO_RESOLUTION_RATIO = 1.0,
66
RESOLUTION = [ 1280, 720 ],
77
MUSIC_BPM = 180,
8-
START_POSITION = 112,
8+
START_POSITION = 0,
99
MUSIC_LENGTH = 213,
1010
MUSIC_AUTOMATON_TEXTURE_HEIGHT = 16,
1111
IBLLUT_ITER = 400,

src/entities/Antialias.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class Antialias extends Entity {
3838
this.components.push( new Quad( {
3939
target: options.target,
4040
material,
41-
name: process.env.DEV && 'Antialias/quad',
41+
name: process.env.DEV && 'quad',
4242
} ) );
4343
}
4444
}

src/entities/BigBlur.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,16 @@ export class BigBlur extends Entity {
2828
entityMain.visible = false;
2929
this.children.push( entityMain );
3030

31+
if ( process.env.DEV ) {
32+
entityBypass.name = 'entityBypass';
33+
entityMain.name = 'entityMain';
34+
}
35+
3136
// -- bypass -----------------------------------------------------------------------------------
3237
entityBypass.components.push( new Blit( {
3338
src: options.input,
3439
dst: options.target,
35-
name: 'BigBlur/blitBypass',
40+
name: process.env.DEV && 'blitBypass',
3641
} ) );
3742

3843
// -- h ----------------------------------------------------------------------------------------
@@ -58,7 +63,7 @@ export class BigBlur extends Entity {
5863
const quadH = new Quad( {
5964
target: targetH,
6065
material: materialH,
61-
name: process.env.DEV && 'BigBlur/quadH',
66+
name: process.env.DEV && 'quadH',
6267
} );
6368
entityMain.components.push( quadH );
6469

@@ -82,7 +87,7 @@ export class BigBlur extends Entity {
8287
const quadV = new Quad( {
8388
target: options.target,
8489
material: materialV,
85-
name: process.env.DEV && 'BigBlur/quad',
90+
name: process.env.DEV && 'quadV',
8691
} );
8792
entityMain.components.push( quadV );
8893

src/entities/Bloom.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class Bloom extends Entity {
4040
this.components.push( new Blit( {
4141
src: options.input,
4242
dst: options.target,
43-
name: 'Bloom/blitDry',
43+
name: process.env.DEV && 'blitDry',
4444
} ) );
4545

4646
// -- down -------------------------------------------------------------------------------------
@@ -68,7 +68,7 @@ export class Bloom extends Entity {
6868
target: swap.o,
6969
material,
7070
range,
71-
name: `Bloom/quadDown${ i }`,
71+
name: `quadDown${ i }`,
7272
} ) );
7373

7474
swap.swap();
@@ -102,7 +102,7 @@ export class Bloom extends Entity {
102102
target: isLast ? options.target : swap.o,
103103
material,
104104
range,
105-
name: `Bloom/quadUp${ i }`,
105+
name: `quadUp${ i }`,
106106
} ) );
107107

108108
swap.swap();

src/entities/BoundingBox.ts

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
11
import { Entity } from '../heck/Entity';
2-
import { InstancedGeometry } from '../heck/InstancedGeometry';
2+
import { Geometry } from '../heck/Geometry';
33
import { Material } from '../heck/Material';
44
import { Mesh } from '../heck/components/Mesh';
5-
import { Vector3 } from '@fms-cat/experimental';
6-
import { auto } from '../globals/automaton';
7-
import { createSVGTableTexture } from '../utils/createSVGTableTexture';
8-
import { dummyRenderTarget, dummyRenderTargetFourDrawBuffers } from '../globals/dummyRenderTarget';
5+
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
96
import { gl, glCat } from '../globals/canvas';
10-
import { objectValuesMap } from '../utils/objectEntriesMap';
117
import boundingBoxFrag from '../shaders/bounding-box.frag';
128
import boundingBoxVert from '../shaders/bounding-box.vert';
13-
import { Geometry } from '../heck/Geometry';
149

1510
export class BoundingBox extends Entity {
1611
public constructor() {
@@ -79,20 +74,6 @@ export class BoundingBox extends Entity {
7974

8075
const materials = { forward, cubemap: forward, depth };
8176

82-
objectValuesMap( materials, ( material ) => {
83-
// auto( 'BoundingBox/phaseWidth', ( { value } ) => {
84-
// material.addUniform( 'phaseWidth', '1f', value );
85-
// } );
86-
87-
// auto( 'Sync/first/clap', ( { value } ) => {
88-
// material.addUniform( 'phaseOffset', '1f', value );
89-
// } );
90-
91-
// auto( 'BoundingBox/hahaRatio', ( { value } ) => {
92-
// material.addUniform( 'hahaRatio', '1f', value );
93-
// } );
94-
} );
95-
9677
if ( process.env.DEV ) {
9778
if ( module.hot ) {
9879
module.hot.accept(
@@ -112,7 +93,7 @@ export class BoundingBox extends Entity {
11293
const mesh = new Mesh( {
11394
geometry,
11495
materials,
115-
name: process.env.DEV && 'BoundingBox/mesh',
96+
name: process.env.DEV && 'mesh',
11697
} );
11798
this.components.push( mesh );
11899
}

src/entities/Condition.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export class Condition extends Entity {
157157
const mesh = new Mesh( {
158158
geometry,
159159
materials,
160-
name: process.env.DEV && 'Condition/mesh',
160+
name: process.env.DEV && 'mesh',
161161
} );
162162
this.components.push( mesh );
163163
}

src/entities/Cube.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ export class Cube extends Entity {
100100
material.addUniform( 'clap', '1f', auto( 'Sync/first/clap' ) )
101101
) );
102102
},
103-
name: process.env.DEV && 'Cube/speen',
103+
name: process.env.DEV && 'speen',
104104
} ) );
105105

106106
// -- mesh -------------------------------------------------------------------------------------
107107
this.mesh = new Mesh( {
108108
geometry: geometry,
109109
materials,
110-
name: process.env.DEV && 'Cube/mesh',
110+
name: process.env.DEV && 'mesh',
111111
} );
112112
this.components.push( this.mesh );
113113
}

src/entities/CubemapCameraEntity.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ export class CubemapCameraEntity extends Entity {
2929
renderTarget: this.target,
3030
near: 1.0,
3131
far: 20.0,
32-
name: 'CubemapCameraEntity/camera',
3332
materialTag: 'cubemap',
3433
} );
3534
this.components.push( this.camera );

src/entities/CyclicBoard.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export class CyclicBoard extends Entity {
7979
onDraw: ( { frameCount } ) => {
8080
setLightUniforms( forward, this.lights, frameCount );
8181
},
82-
name: process.env.DEV && 'CyclicBoard/setLightUniforms',
82+
name: process.env.DEV && 'setLightUniforms',
8383
} ) );
8484

8585
// -- updater ----------------------------------------------------------------------------------
@@ -104,14 +104,14 @@ export class CyclicBoard extends Entity {
104104
);
105105
} );
106106
},
107-
name: process.env.DEV && 'CyclicBoard/updater',
107+
name: process.env.DEV && 'setCameraUniforms',
108108
} ) );
109109

110110
// -- mesh -------------------------------------------------------------------------------------
111111
const mesh = new Mesh( {
112112
geometry,
113113
materials,
114-
name: process.env.DEV && 'CyclicBoard/mesh',
114+
name: process.env.DEV && 'mesh',
115115
} );
116116
mesh.cull = MeshCull.None;
117117
this.components.push( mesh );

0 commit comments

Comments
 (0)