mirror of
https://github.com/FMS-Cat/condition.git
synced 2025-09-02 18:02:38 +02:00
refactor: lint was not working at all
This commit is contained in:
@@ -8,7 +8,9 @@
|
||||
"build": "yarn build-js && yarn build-png",
|
||||
"build-js": "webpack --mode production",
|
||||
"build-png": "jsexe -cn -po ./dist/bundle.js ./dist/out.png.html",
|
||||
"h": "start http://localhost:8081/out.png.html && http-server ./dist"
|
||||
"h": "start http://localhost:8081/out.png.html && http-server ./dist",
|
||||
"lint": "eslint \"src/**/*.{ts,tsx}\"",
|
||||
"lint-fix": "eslint --fix \"src/**/*.{ts,tsx}\""
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fms-cat/automaton": "^4.1.0",
|
||||
@@ -20,6 +22,7 @@
|
||||
"@typescript-eslint/eslint-plugin": "^4.17.0",
|
||||
"@typescript-eslint/parser": "^4.17.0",
|
||||
"eslint": "^7.21.0",
|
||||
"eslint-plugin-sort-imports-es6-autofix": "^0.6.0",
|
||||
"glslify-loader": "^2.0.0",
|
||||
"html-webpack-plugin": "^5.3.0",
|
||||
"loader-utils": "^2.0.0",
|
||||
|
16
src/Music.ts
16
src/Music.ts
@@ -1,13 +1,13 @@
|
||||
import { Channel } from '@fms-cat/automaton';
|
||||
import { GLCat, GLCatBuffer, GLCatProgram, GLCatTexture, GLCatTransformFeedback } from '@fms-cat/glcat-ts';
|
||||
import { MUSIC_AUTOMATON_TEXTURE_HEIGHT, MUSIC_BPM, MUSIC_BUFFER_LENGTH } from './config';
|
||||
import { Pool } from './utils/Pool';
|
||||
import musicVert from './shaders/music.vert';
|
||||
import { gl, glCat } from './globals/canvas';
|
||||
import samplesOpus from './samples.opus';
|
||||
import { randomTextureStatic } from './globals/randomTexture';
|
||||
import { automaton } from './globals/automaton';
|
||||
import { Channel } from '@fms-cat/automaton';
|
||||
import { gl, glCat } from './globals/canvas';
|
||||
import { injectCodeToShader } from './utils/injectCodeToShader';
|
||||
import { randomTextureStatic } from './globals/randomTexture';
|
||||
import musicVert from './shaders/music.vert';
|
||||
import samplesOpus from './samples.opus';
|
||||
import type { AutomatonWithGUI } from '@fms-cat/automaton-with-gui';
|
||||
|
||||
const discardFrag = '#version 300 es\nvoid main(){discard;}';
|
||||
@@ -34,7 +34,7 @@ export class Music {
|
||||
private __arrayAutomaton: Float32Array;
|
||||
private __textureAutomaton: GLCatTexture;
|
||||
|
||||
constructor( glCat: GLCat, audio: AudioContext ) {
|
||||
public constructor( glCat: GLCat, audio: AudioContext ) {
|
||||
this.audio = audio;
|
||||
|
||||
// == yoinked from wavenerd-deck ===============================================================
|
||||
@@ -100,7 +100,7 @@ export class Music {
|
||||
|
||||
// == hot hot hot hot hot ======================================================================
|
||||
if ( process.env.DEV && module.hot ) {
|
||||
const recompileShader = async () => {
|
||||
const recompileShader = async (): Promise<void> => {
|
||||
const program = await glCat.lazyProgramAsync(
|
||||
injectCodeToShader( musicVert, this.__automatonDefineString ),
|
||||
discardFrag,
|
||||
@@ -300,4 +300,4 @@ export class Music {
|
||||
} );
|
||||
} );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { sine } from './sine';
|
||||
import { repeat } from './repeat';
|
||||
import { hermitePatch } from './hermitePatch';
|
||||
import { repeat } from './repeat';
|
||||
import { sine } from './sine';
|
||||
import { transpose } from './transpose';
|
||||
|
||||
// quotes! prevent fx names from being mangled
|
||||
|
@@ -1,12 +1,12 @@
|
||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||
import { Entity } from '../heck/Entity';
|
||||
import { Material } from '../heck/Material';
|
||||
import { Quad } from '../heck/components/Quad';
|
||||
import { RenderTarget } from '../heck/RenderTarget';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import fxaaFrag from '../shaders/fxaa.frag';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
|
||||
export interface PostOptions {
|
||||
input: BufferRenderTarget;
|
||||
|
@@ -1,16 +1,16 @@
|
||||
import { Blit } from '../heck/components/Blit';
|
||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||
import { Entity } from '../heck/Entity';
|
||||
import { Material } from '../heck/Material';
|
||||
import { Quad } from '../heck/components/Quad';
|
||||
import { RenderTarget } from '../heck/RenderTarget';
|
||||
import { Swap } from '@fms-cat/experimental';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
import bloomUpFrag from '../shaders/bloom-up.frag';
|
||||
import bloomDownFrag from '../shaders/bloom-down.frag';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
import { gl } from '../globals/canvas';
|
||||
import { Blit } from '../heck/components/Blit';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import bloomDownFrag from '../shaders/bloom-down.frag';
|
||||
import bloomUpFrag from '../shaders/bloom-up.frag';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
|
||||
export interface BloomOptions {
|
||||
input: BufferRenderTarget;
|
||||
|
@@ -1,20 +1,20 @@
|
||||
import { GLCatTexture } from '@fms-cat/glcat-ts';
|
||||
import { AO_RESOLUTION_RATIO } from '../config';
|
||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||
import { Entity } from '../heck/Entity';
|
||||
import { GLCatTexture } from '@fms-cat/glcat-ts';
|
||||
import { Lambda } from '../heck/components/Lambda';
|
||||
import { LightEntity } from './LightEntity';
|
||||
import { Material } from '../heck/Material';
|
||||
import { PerspectiveCamera } from '../heck/components/PerspectiveCamera';
|
||||
import { Quad } from '../heck/components/Quad';
|
||||
import { RenderTarget } from '../heck/RenderTarget';
|
||||
import { AO_RESOLUTION_RATIO } from '../config';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
import { gl } from '../globals/canvas';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { randomTexture } from '../globals/randomTexture';
|
||||
import aoFrag from '../shaders/ao.frag';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
import shadingFrag from '../shaders/shading.frag';
|
||||
import { gl } from '../globals/canvas';
|
||||
import { randomTexture } from '../globals/randomTexture';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
|
||||
export interface CameraEntityOptions {
|
||||
root: Entity;
|
||||
@@ -39,6 +39,7 @@ export class CameraEntity extends Entity {
|
||||
numBuffers: 4,
|
||||
name: 'CameraEntity/cameraTarget',
|
||||
} );
|
||||
|
||||
this.camera = new PerspectiveCamera( {
|
||||
scene: this.root,
|
||||
renderTarget: cameraTarget,
|
||||
@@ -47,7 +48,6 @@ export class CameraEntity extends Entity {
|
||||
name: 'CameraEntity/camera',
|
||||
materialTag: 'deferred',
|
||||
} );
|
||||
this.components.push( this.camera );
|
||||
|
||||
const aoTarget = new BufferRenderTarget( {
|
||||
width: AO_RESOLUTION_RATIO * options.target.width,
|
||||
@@ -61,7 +61,7 @@ export class CameraEntity extends Entity {
|
||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||
);
|
||||
|
||||
this.components.push( new Lambda( {
|
||||
const lambdaAoSetCameraUniforms = new Lambda( {
|
||||
onUpdate: () => {
|
||||
const cameraView = this.transform.matrix.inverse!;
|
||||
|
||||
@@ -74,7 +74,7 @@ export class CameraEntity extends Entity {
|
||||
);
|
||||
},
|
||||
name: process.env.DEV && 'CameraEntity/ao/setCameraUniforms',
|
||||
} ) );
|
||||
} );
|
||||
|
||||
for ( let i = 0; i < 2; i ++ ) { // it doesn't need 2 and 3
|
||||
aoMaterial.addUniformTexture(
|
||||
@@ -90,7 +90,6 @@ export class CameraEntity extends Entity {
|
||||
target: aoTarget,
|
||||
name: process.env.DEV && 'CameraEntity/ao/quad',
|
||||
} );
|
||||
this.components.push( aoQuad );
|
||||
|
||||
const shadingMaterials = options.lights.map( ( light, iLight ) => {
|
||||
const shadingMaterial = new Material(
|
||||
@@ -102,7 +101,12 @@ export class CameraEntity extends Entity {
|
||||
},
|
||||
);
|
||||
|
||||
let shadingQuad: Quad;
|
||||
const shadingQuad = new Quad( {
|
||||
material: shadingMaterial,
|
||||
target: options.target,
|
||||
name: process.env.DEV && 'CameraEntity/shading/quad',
|
||||
} );
|
||||
shadingQuad.clear = iLight === 0 ? [] : false;
|
||||
|
||||
const lambda = new Lambda( {
|
||||
onUpdate: ( { frameCount } ) => {
|
||||
@@ -164,15 +168,13 @@ export class CameraEntity extends Entity {
|
||||
'lightPV',
|
||||
'Matrix4fv',
|
||||
light.camera.projectionMatrix.multiply(
|
||||
light.transform.matrix.inverse!
|
||||
light.transform.matrix.inverse!
|
||||
).elements
|
||||
);
|
||||
},
|
||||
name: process.env.DEV && 'CameraEntity/shading/setCameraUniforms',
|
||||
} );
|
||||
|
||||
this.components.push( lambda );
|
||||
|
||||
for ( let i = 0; i < 4; i ++ ) {
|
||||
shadingMaterial.addUniformTexture(
|
||||
'sampler' + i,
|
||||
@@ -187,14 +189,13 @@ export class CameraEntity extends Entity {
|
||||
shadingMaterial.addUniformTexture( 'samplerEnv', options.textureEnv );
|
||||
shadingMaterial.addUniformTexture( 'samplerRandom', randomTexture.texture );
|
||||
|
||||
shadingQuad = new Quad( {
|
||||
material: shadingMaterial,
|
||||
target: options.target,
|
||||
name: process.env.DEV && 'CameraEntity/shading/quad',
|
||||
} );
|
||||
shadingQuad.clear = iLight === 0 ? [] : false;
|
||||
|
||||
this.components.push( shadingQuad );
|
||||
this.components.push(
|
||||
this.camera,
|
||||
lambdaAoSetCameraUniforms,
|
||||
aoQuad,
|
||||
lambda,
|
||||
shadingQuad,
|
||||
);
|
||||
|
||||
return shadingMaterial;
|
||||
} );
|
||||
|
@@ -1,15 +1,15 @@
|
||||
import { Vector3 } from '@fms-cat/experimental';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
import { Entity } from '../heck/Entity';
|
||||
import { InstancedGeometry } from '../heck/InstancedGeometry';
|
||||
import { createSVGTableTexture } from '../utils/createSVGTableTexture';
|
||||
import conditionVert from '../shaders/condition.vert';
|
||||
import conditionFrag from '../shaders/condition.frag';
|
||||
import { Material } from '../heck/Material';
|
||||
import { dummyRenderTargetFourDrawBuffers, dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
import { Mesh } from '../heck/components/Mesh';
|
||||
import { Vector3 } from '@fms-cat/experimental';
|
||||
import { auto } from '../globals/automaton';
|
||||
import { createSVGTableTexture } from '../utils/createSVGTableTexture';
|
||||
import { dummyRenderTarget, dummyRenderTargetFourDrawBuffers } from '../globals/dummyRenderTarget';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
import { objectValuesMap } from '../utils/objectEntriesMap';
|
||||
import conditionFrag from '../shaders/condition.frag';
|
||||
import conditionVert from '../shaders/condition.vert';
|
||||
|
||||
const POINTS_MAX = 256;
|
||||
|
||||
@@ -163,7 +163,7 @@ export class Condition extends Entity {
|
||||
const mesh = new Mesh( {
|
||||
geometry,
|
||||
materials,
|
||||
name: process.env.DEV && `Condition/mesh`,
|
||||
name: process.env.DEV && 'Condition/mesh',
|
||||
} );
|
||||
this.components.push( mesh );
|
||||
}
|
||||
|
@@ -1,18 +1,18 @@
|
||||
import { Quaternion, Vector3 } from '@fms-cat/experimental';
|
||||
import { Mesh } from '../heck/components/Mesh';
|
||||
import { Entity } from '../heck/Entity';
|
||||
import { Material } from '../heck/Material';
|
||||
import cubeVert from '../shaders/cube.vert';
|
||||
import cubeFrag from '../shaders/cube.frag';
|
||||
import depthFrag from '../shaders/depth.frag';
|
||||
import { genCube } from '../geometries/genCube';
|
||||
import { Lambda } from '../heck/components/Lambda';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { dummyRenderTargetFourDrawBuffers, dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
import { glCat } from '../globals/canvas';
|
||||
import { InstancedGeometry } from '../heck/InstancedGeometry';
|
||||
import { objectValuesMap } from '../utils/objectEntriesMap';
|
||||
import { Lambda } from '../heck/components/Lambda';
|
||||
import { Material } from '../heck/Material';
|
||||
import { Mesh } from '../heck/components/Mesh';
|
||||
import { Quaternion, Vector3 } from '@fms-cat/experimental';
|
||||
import { auto } from '../globals/automaton';
|
||||
import { dummyRenderTarget, dummyRenderTargetFourDrawBuffers } from '../globals/dummyRenderTarget';
|
||||
import { genCube } from '../geometries/genCube';
|
||||
import { glCat } from '../globals/canvas';
|
||||
import { objectValuesMap } from '../utils/objectEntriesMap';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import cubeFrag from '../shaders/cube.frag';
|
||||
import cubeVert from '../shaders/cube.vert';
|
||||
import depthFrag from '../shaders/depth.frag';
|
||||
|
||||
const PRIMCOUNT = 512;
|
||||
|
||||
@@ -54,20 +54,20 @@ export class Cube extends Entity {
|
||||
geometry.primcount = PRIMCOUNT;
|
||||
|
||||
// -- materials --------------------------------------------------------------------------------
|
||||
const deferred = new Material(
|
||||
cubeVert,
|
||||
cubeFrag,
|
||||
{
|
||||
defines: [ 'DEFERRED 1' ],
|
||||
initOptions: { geometry: quadGeometry, target: dummyRenderTargetFourDrawBuffers },
|
||||
},
|
||||
);
|
||||
const deferred = new Material(
|
||||
cubeVert,
|
||||
cubeFrag,
|
||||
{
|
||||
defines: [ 'DEFERRED 1' ],
|
||||
initOptions: { geometry: quadGeometry, target: dummyRenderTargetFourDrawBuffers },
|
||||
},
|
||||
);
|
||||
|
||||
const depth = new Material(
|
||||
cubeVert,
|
||||
depthFrag,
|
||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||
);
|
||||
const depth = new Material(
|
||||
cubeVert,
|
||||
depthFrag,
|
||||
{ initOptions: { geometry: quadGeometry, target: dummyRenderTarget } },
|
||||
);
|
||||
|
||||
const materials = { deferred, depth };
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import { CUBEMAP_RESOLUTION } from '../config';
|
||||
import { CubemapCamera } from '../heck/components/CubemapCamera';
|
||||
import { CubemapRenderTarget } from '../heck/CubemapRenderTarget';
|
||||
import { Entity } from '../heck/Entity';
|
||||
import { LightEntity } from './LightEntity';
|
||||
import { PerspectiveCamera } from '../heck/components/PerspectiveCamera';
|
||||
import { CubemapRenderTarget } from '../heck/CubemapRenderTarget';
|
||||
import { CubemapCamera } from '../heck/components/CubemapCamera';
|
||||
import { CUBEMAP_RESOLUTION } from '../config';
|
||||
|
||||
export interface CubemapCameraEntityOptions {
|
||||
root: Entity;
|
||||
|
@@ -1,18 +1,18 @@
|
||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||
import { CubemapRenderTarget } from '../heck/CubemapRenderTarget';
|
||||
import { Entity } from '../heck/Entity';
|
||||
import { GLCatTexture } from '@fms-cat/glcat-ts';
|
||||
import { Lambda } from '../heck/components/Lambda';
|
||||
import { Material } from '../heck/Material';
|
||||
import { Quad } from '../heck/components/Quad';
|
||||
import { Swap, Xorshift } from '@fms-cat/experimental';
|
||||
import { auto } from '../globals/automaton';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
import { gl } from '../globals/canvas';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import environmentMapFrag from '../shaders/environment-map.frag';
|
||||
import environmentMapMergeFrag from '../shaders/environment-map-merge.frag';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||
import { Swap, Xorshift } from '@fms-cat/experimental';
|
||||
import { Lambda } from '../heck/components/Lambda';
|
||||
import { CubemapRenderTarget } from '../heck/CubemapRenderTarget';
|
||||
import { gl } from '../globals/canvas';
|
||||
import { auto } from '../globals/automaton';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
|
||||
const WIDTH = 1024;
|
||||
const HEIGHT = 512;
|
||||
|
@@ -2,16 +2,16 @@ import { Entity } from '../heck/Entity';
|
||||
import { GPUParticles } from './GPUParticles';
|
||||
import { InstancedGeometry } from '../heck/InstancedGeometry';
|
||||
import { Material } from '../heck/Material';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
import { TRIANGLE_STRIP_QUAD } from '@fms-cat/experimental';
|
||||
import { dummyRenderTarget, dummyRenderTargetFourDrawBuffers } from '../globals/dummyRenderTarget';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
import { objectValuesMap } from '../utils/objectEntriesMap';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
||||
import flickyParticleComputeFrag from '../shaders/flicky-particles-compute.frag';
|
||||
import flickyParticleRenderFrag from '../shaders/flicky-particles-render.frag';
|
||||
import flickyParticleRenderVert from '../shaders/flicky-particles-render.vert';
|
||||
import { TRIANGLE_STRIP_QUAD } from '@fms-cat/experimental';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { dummyRenderTargetFourDrawBuffers, dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
import { objectValuesMap } from '../utils/objectEntriesMap';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
|
||||
const PARTICLES_SQRT = 8;
|
||||
const PARTICLES = PARTICLES_SQRT * PARTICLES_SQRT;
|
||||
|
@@ -1,14 +1,14 @@
|
||||
import { Blit } from '../heck/components/Blit';
|
||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||
import { Entity } from '../heck/Entity';
|
||||
import { Material } from '../heck/Material';
|
||||
import { Quad } from '../heck/components/Quad';
|
||||
import { RenderTarget } from '../heck/RenderTarget';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
import glitchFrag from '../shaders/glitch.frag';
|
||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||
import { Blit } from '../heck/components/Blit';
|
||||
import { auto } from '../globals/automaton';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import glitchFrag from '../shaders/glitch.frag';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
|
||||
export interface GlitchOptions {
|
||||
input: BufferRenderTarget;
|
||||
|
@@ -1,15 +1,15 @@
|
||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||
import { Entity } from '../heck/Entity';
|
||||
import { GLCatTexture } from '@fms-cat/glcat-ts';
|
||||
import { Lambda } from '../heck/components/Lambda';
|
||||
import { Material } from '../heck/Material';
|
||||
import { Quad } from '../heck/components/Quad';
|
||||
import { Swap } from '@fms-cat/experimental';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { vdc } from '../utils/vdc';
|
||||
import iblLutFrag from '../shaders/ibl-lut.frag';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||
import { Swap } from '@fms-cat/experimental';
|
||||
import { Lambda } from '../heck/components/Lambda';
|
||||
import { vdc } from '../utils/vdc';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
|
||||
const IBL_SIZE = 256;
|
||||
|
||||
|
@@ -4,10 +4,10 @@ import { Material } from '../heck/Material';
|
||||
import { PerspectiveCamera } from '../heck/components/PerspectiveCamera';
|
||||
import { Quad } from '../heck/components/Quad';
|
||||
import { Swap } from '@fms-cat/experimental';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
import shadowBlurFrag from '../shaders/shadow-blur.frag';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
|
||||
export interface LightEntityOptions {
|
||||
root: Entity;
|
||||
|
@@ -1,16 +1,16 @@
|
||||
import { Blit } from '../heck/components/Blit';
|
||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||
import { Entity } from '../heck/Entity';
|
||||
import { Material } from '../heck/Material';
|
||||
import { Quad } from '../heck/components/Quad';
|
||||
import { RenderTarget } from '../heck/RenderTarget';
|
||||
import pixelSorterIndexFrag from '../shaders/pixel-sorter-index.frag';
|
||||
import pixelSorterFrag from '../shaders/pixel-sorter.frag';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||
import { Swap } from '@fms-cat/experimental';
|
||||
import { Blit } from '../heck/components/Blit';
|
||||
import { auto } from '../globals/automaton';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import pixelSorterFrag from '../shaders/pixel-sorter.frag';
|
||||
import pixelSorterIndexFrag from '../shaders/pixel-sorter-index.frag';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
|
||||
export interface PixelSorterOptions {
|
||||
input: BufferRenderTarget;
|
||||
|
@@ -1,13 +1,13 @@
|
||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||
import { Entity } from '../heck/Entity';
|
||||
import { Material } from '../heck/Material';
|
||||
import { Quad } from '../heck/components/Quad';
|
||||
import { RenderTarget } from '../heck/RenderTarget';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { randomTexture } from '../globals/randomTexture';
|
||||
import postFrag from '../shaders/post.frag';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
import { randomTexture } from '../globals/randomTexture';
|
||||
|
||||
export interface PostOptions {
|
||||
input: BufferRenderTarget;
|
||||
|
@@ -1,15 +1,15 @@
|
||||
import { Entity } from '../heck/Entity';
|
||||
import { RenderTarget } from '../heck/RenderTarget';
|
||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||
import { RTINSPECTOR_CAPTURE_INDEX, RTINSPECTOR_CAPTURE_NAME, RTINSPECTOR_MULTIPLE } from '../config-hot';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
import inspectorFrag from '../shaders/inspector.frag';
|
||||
import { canvas, gl } from '../globals/canvas';
|
||||
import { Blit } from '../heck/components/Blit';
|
||||
import { BufferRenderTarget } from '../heck/BufferRenderTarget';
|
||||
import { Entity } from '../heck/Entity';
|
||||
import { Material } from '../heck/Material';
|
||||
import { Quad } from '../heck/components/Quad';
|
||||
import { RTINSPECTOR_CAPTURE_INDEX, RTINSPECTOR_CAPTURE_NAME, RTINSPECTOR_MULTIPLE } from '../config-hot';
|
||||
import { RenderTarget } from '../heck/RenderTarget';
|
||||
import { canvas, gl } from '../globals/canvas';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { Quad } from '../heck/components/Quad';
|
||||
import inspectorFrag from '../shaders/inspector.frag';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
|
||||
export interface RTInspectorOptions {
|
||||
target: RenderTarget;
|
||||
@@ -38,7 +38,7 @@ export class RTInspector extends Entity {
|
||||
this.quadSingle = new Quad( {
|
||||
target: options.target,
|
||||
material: this.materialSingle,
|
||||
name: `RTInspector/quadSingle`,
|
||||
name: 'RTInspector/quadSingle',
|
||||
ignoreBreakpoints: true,
|
||||
} );
|
||||
this.entitySingle.components.push( this.quadSingle );
|
||||
|
@@ -1,16 +1,16 @@
|
||||
import { Mesh, MeshCull } from '../heck/components/Mesh';
|
||||
import { Vector3 } from '@fms-cat/experimental';
|
||||
import { Entity } from '../heck/Entity';
|
||||
import { Geometry } from '../heck/Geometry';
|
||||
import { Material } from '../heck/Material';
|
||||
import raymarchObjectVert from '../shaders/raymarch-object.vert';
|
||||
import raymarcherFrag from '../shaders/raymarcher.frag';
|
||||
import { Lambda } from '../heck/components/Lambda';
|
||||
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
||||
import { Material } from '../heck/Material';
|
||||
import { Mesh, MeshCull } from '../heck/components/Mesh';
|
||||
import { Vector3 } from '@fms-cat/experimental';
|
||||
import { auto } from '../globals/automaton';
|
||||
import { dummyRenderTargetFourDrawBuffers, dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
import { dummyRenderTarget, dummyRenderTargetFourDrawBuffers } from '../globals/dummyRenderTarget';
|
||||
import { genOctahedron } from '../geometries/genOctahedron';
|
||||
import { objectValuesMap } from '../utils/objectEntriesMap';
|
||||
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
||||
import raymarchObjectVert from '../shaders/raymarch-object.vert';
|
||||
import raymarcherFrag from '../shaders/raymarcher.frag';
|
||||
|
||||
export class Raymarcher extends Entity {
|
||||
public constructor() {
|
||||
|
@@ -1,15 +1,15 @@
|
||||
import { Quaternion, Vector3 } from '@fms-cat/experimental';
|
||||
import { genTorus } from '../geometries/genTorus';
|
||||
import { Mesh } from '../heck/components/Mesh';
|
||||
import { Entity } from '../heck/Entity';
|
||||
import { InstancedGeometry } from '../heck/InstancedGeometry';
|
||||
import { Material } from '../heck/Material';
|
||||
import depthFrag from '../shaders/depth.frag';
|
||||
import ringsVert from '../shaders/rings.vert';
|
||||
import ringsFrag from '../shaders/rings.frag';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
import { Lambda } from '../heck/components/Lambda';
|
||||
import { Material } from '../heck/Material';
|
||||
import { Mesh } from '../heck/components/Mesh';
|
||||
import { Quaternion, Vector3 } from '@fms-cat/experimental';
|
||||
import { dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
import { genTorus } from '../geometries/genTorus';
|
||||
import { glCat } from '../globals/canvas';
|
||||
import depthFrag from '../shaders/depth.frag';
|
||||
import ringsFrag from '../shaders/rings.frag';
|
||||
import ringsVert from '../shaders/rings.vert';
|
||||
|
||||
const PRIMCOUNT = 32;
|
||||
|
||||
@@ -35,7 +35,7 @@ export class Rings extends Entity {
|
||||
geometry.vao.bindVertexbuffer( torus.normal, 1, 3 );
|
||||
geometry.vao.bindIndexbuffer( torus.index );
|
||||
|
||||
const arrayInstanceId = [ ...Array( PRIMCOUNT).keys() ];
|
||||
const arrayInstanceId = [ ...Array( PRIMCOUNT ).keys() ];
|
||||
const bufferInstanceId = glCat.createBuffer();
|
||||
bufferInstanceId.setVertexbuffer( new Float32Array( arrayInstanceId ) );
|
||||
|
||||
@@ -75,7 +75,7 @@ export class Rings extends Entity {
|
||||
forward,
|
||||
deferred,
|
||||
depth,
|
||||
}
|
||||
};
|
||||
|
||||
if ( process.env.DEV ) {
|
||||
if ( module.hot ) {
|
||||
|
@@ -2,16 +2,16 @@ import { Entity } from '../heck/Entity';
|
||||
import { GPUParticles } from './GPUParticles';
|
||||
import { InstancedGeometry } from '../heck/InstancedGeometry';
|
||||
import { Material } from '../heck/Material';
|
||||
import { dummyRenderTarget, dummyRenderTargetFourDrawBuffers } from '../globals/dummyRenderTarget';
|
||||
import { genOctahedron } from '../geometries/genOctahedron';
|
||||
import { glCat } from '../globals/canvas';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
||||
import depthFrag from '../shaders/depth.frag';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
import sphereParticleComputeFrag from '../shaders/sphere-particles-compute.frag';
|
||||
import sphereParticleRenderFrag from '../shaders/sphere-particles-render.frag';
|
||||
import sphereParticleRenderVert from '../shaders/sphere-particles-render.vert';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { dummyRenderTargetFourDrawBuffers, dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
|
||||
const PARTICLES_SQRT = 256;
|
||||
const PARTICLES = PARTICLES_SQRT * PARTICLES_SQRT;
|
||||
|
@@ -1,20 +1,20 @@
|
||||
import { Entity } from '../heck/Entity';
|
||||
import { GPUParticles } from './GPUParticles';
|
||||
import { InstancedGeometry } from '../heck/InstancedGeometry';
|
||||
import { Lambda } from '../heck/components/Lambda';
|
||||
import { Material } from '../heck/Material';
|
||||
import { TRIANGLE_STRIP_QUAD } from '@fms-cat/experimental';
|
||||
import { auto } from '../globals/automaton';
|
||||
import { dummyRenderTarget, dummyRenderTargetFourDrawBuffers } from '../globals/dummyRenderTarget';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { randomTextureStatic } from '../globals/randomTexture';
|
||||
import { sufferList } from '../sufferList';
|
||||
import { tinyCharTexture } from '../globals/tinyCharTexture';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
import sufferTextsComputeFrag from '../shaders/suffer-texts-compute.frag';
|
||||
import sufferTextsRenderFrag from '../shaders/suffer-texts-render.frag';
|
||||
import sufferTextsRenderVert from '../shaders/suffer-texts-render.vert';
|
||||
import { TRIANGLE_STRIP_QUAD } from '@fms-cat/experimental';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
import { randomTextureStatic } from '../globals/randomTexture';
|
||||
import { tinyCharTexture } from '../globals/tinyCharTexture';
|
||||
import { Lambda } from '../heck/components/Lambda';
|
||||
import { auto } from '../globals/automaton';
|
||||
import { sufferList } from '../sufferList';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { dummyRenderTargetFourDrawBuffers, dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
|
||||
const PARTICLES = 256;
|
||||
|
||||
|
@@ -2,15 +2,15 @@ import { Entity } from '../heck/Entity';
|
||||
import { GPUParticles } from './GPUParticles';
|
||||
import { InstancedGeometry } from '../heck/InstancedGeometry';
|
||||
import { Material } from '../heck/Material';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
import { dummyRenderTarget, dummyRenderTargetFourDrawBuffers } from '../globals/dummyRenderTarget';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
||||
import depthFrag from '../shaders/depth.frag';
|
||||
import quadVert from '../shaders/quad.vert';
|
||||
import trailsComputeFrag from '../shaders/trails-compute.frag';
|
||||
import trailsRenderFrag from '../shaders/trails-render.frag';
|
||||
import trailsRenderVert from '../shaders/trails-render.vert';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
|
||||
import { quadGeometry } from '../globals/quadGeometry';
|
||||
import { dummyRenderTargetFourDrawBuffers, dummyRenderTarget } from '../globals/dummyRenderTarget';
|
||||
|
||||
const TRAILS = 4096;
|
||||
const TRAIL_LENGTH = 64;
|
||||
|
@@ -29,7 +29,7 @@ export function genCube(): ResultGenCube {
|
||||
];
|
||||
|
||||
for ( let i = 0; i < 6; i ++ ) {
|
||||
let func = ( v: number[] ) => {
|
||||
const func = ( v: number[] ): number[] => {
|
||||
const vt: number[] = [];
|
||||
|
||||
if ( i < 4 ) {
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import GLCat, { GLCatBuffer } from '@fms-cat/glcat-ts';
|
||||
import { GLCatBuffer } from '@fms-cat/glcat-ts';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
|
||||
interface ResultGenTorus {
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import { Automaton } from '@fms-cat/automaton';
|
||||
import { AutomatonWithGUI } from '@fms-cat/automaton-with-gui';
|
||||
import automatonData from '../automaton.json';
|
||||
import { music } from './music';
|
||||
import { getDivAutomaton } from './dom';
|
||||
import { fxDefinitions } from '../automaton-fxs/fxDefinitions';
|
||||
import { getDivAutomaton } from './dom';
|
||||
import { music } from './music';
|
||||
import automatonData from '../automaton.json';
|
||||
|
||||
export const automaton = ( () => {
|
||||
if ( process.env.DEV ) {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { RESOLUTION } from '../config';
|
||||
import { GLCat } from '@fms-cat/glcat-ts';
|
||||
import { RESOLUTION } from '../config';
|
||||
|
||||
export const canvas = document.createElement( 'canvas' );
|
||||
canvas.width = RESOLUTION[ 0 ];
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { TRIANGLE_STRIP_QUAD } from '@fms-cat/experimental';
|
||||
import { Geometry } from '../heck/Geometry';
|
||||
import { TRIANGLE_STRIP_QUAD } from '@fms-cat/experimental';
|
||||
import { gl, glCat } from './canvas';
|
||||
|
||||
const quadBuffer = glCat.createBuffer();
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { glCat } from './canvas';
|
||||
import { RANDOM_RESOLUTION, STATIC_RANDOM_RESOLUTION } from '../config';
|
||||
import { RandomTexture } from '../utils/RandomTexture';
|
||||
import { glCat } from './canvas';
|
||||
|
||||
export const randomTexture = new RandomTexture(
|
||||
glCat,
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { GLCatFramebuffer, GLCatTexture } from '@fms-cat/glcat-ts';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
import { RenderTarget } from './RenderTarget';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
|
||||
export interface BufferRenderTargetOptions {
|
||||
width: number;
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { canvas, gl, glCat } from '../globals/canvas';
|
||||
import { RenderTarget } from './RenderTarget';
|
||||
import { canvas, gl, glCat } from '../globals/canvas';
|
||||
|
||||
export class CanvasRenderTarget extends RenderTarget {
|
||||
public get width(): number {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { GLCatFramebuffer, GLCatTextureCubemap } from '@fms-cat/glcat-ts';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
import { RenderTarget } from './RenderTarget';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
|
||||
export interface CubemapRenderTargetOptions {
|
||||
width: number;
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { Component } from './components/Component';
|
||||
import { Entity } from './Entity';
|
||||
import { Transform } from './Transform';
|
||||
import { Component } from './components/Component';
|
||||
import { music } from '../globals/music';
|
||||
|
||||
/**
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import { Camera } from './components/Camera';
|
||||
import { Component } from './components/Component';
|
||||
import { MaterialTag } from './Material';
|
||||
import { Matrix4 } from '@fms-cat/experimental';
|
||||
import { RenderTarget } from './RenderTarget';
|
||||
import { Transform } from './Transform';
|
||||
import { MaterialTag } from './Material';
|
||||
|
||||
export interface EntityUpdateEvent {
|
||||
frameCount: number;
|
||||
|
@@ -59,7 +59,7 @@ export class GPUTimer {
|
||||
|
||||
public check( query: WebGLQuery ): Promise<number> {
|
||||
return new Promise( ( resolve ) => {
|
||||
const task = () => {
|
||||
const task = (): void => {
|
||||
const isAvailable = gl.getQueryParameter( query, gl.QUERY_RESULT_AVAILABLE );
|
||||
|
||||
if ( isAvailable ) {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
import { Geometry } from './Geometry';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
|
||||
export class InstancedGeometry extends Geometry {
|
||||
public primcount: number = 0;
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import { GLCatProgram, GLCatProgramLinkOptions, GLCatProgramUniformType, GLCatTexture, GLCatTextureCubemap } from '@fms-cat/glcat-ts';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
import { injectCodeToShader } from '../utils/injectCodeToShader';
|
||||
import { Geometry } from './Geometry';
|
||||
import { RenderTarget } from './RenderTarget';
|
||||
import { SHADERPOOL } from './ShaderPool';
|
||||
import { gl, glCat } from '../globals/canvas';
|
||||
import { injectCodeToShader } from '../utils/injectCodeToShader';
|
||||
|
||||
export type MaterialTag =
|
||||
| 'deferred'
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { GLCatProgram, GLCatProgramLinkOptions } from '@fms-cat/glcat-ts';
|
||||
import { glCat } from '../globals/canvas';
|
||||
import { Material } from './Material';
|
||||
import { glCat } from '../globals/canvas';
|
||||
|
||||
export class ShaderPool<TUser> {
|
||||
private __programMap: Map<string, GLCatProgram> = new Map();
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { Component, ComponentOptions, ComponentUpdateEvent } from './Component';
|
||||
import { BufferRenderTarget } from '../BufferRenderTarget';
|
||||
import { Component, ComponentOptions } from './Component';
|
||||
import { RenderTarget } from '../RenderTarget';
|
||||
import { gl } from '../../globals/canvas';
|
||||
import { BufferRenderTarget } from '../BufferRenderTarget';
|
||||
|
||||
export interface BlitOptions extends ComponentOptions {
|
||||
src?: BufferRenderTarget;
|
||||
|
@@ -1,10 +1,10 @@
|
||||
import { Component, ComponentOptions, ComponentUpdateEvent } from './Component';
|
||||
import { Entity } from '../Entity';
|
||||
import { MaterialTag } from '../Material';
|
||||
import { Matrix4 } from '@fms-cat/experimental';
|
||||
import { RenderTarget } from '../RenderTarget';
|
||||
import { Transform } from '../Transform';
|
||||
import { glCat } from '../../globals/canvas';
|
||||
import { MaterialTag } from '../Material';
|
||||
|
||||
export interface CameraOptions extends ComponentOptions {
|
||||
renderTarget?: RenderTarget;
|
||||
|
@@ -1,12 +1,12 @@
|
||||
import { COMPONENT_DRAW_BREAKPOINT, COMPONENT_UPDATE_BREAKPOINT } from '../../config-hot';
|
||||
import { Camera } from './Camera';
|
||||
import { Entity } from '../Entity';
|
||||
import { GPUTimer } from '../GPUTimer';
|
||||
import { MaterialTag } from '../Material';
|
||||
import { Matrix4 } from '@fms-cat/experimental';
|
||||
import { RenderTarget } from '../RenderTarget';
|
||||
import { Transform } from '../Transform';
|
||||
import { COMPONENT_DRAW_BREAKPOINT, COMPONENT_UPDATE_BREAKPOINT } from '../../config-hot';
|
||||
import { GPUTimer } from '../GPUTimer';
|
||||
import { getDivComponentsDraw, getDivComponentsUpdate } from '../../globals/dom';
|
||||
import { MaterialTag } from '../Material';
|
||||
|
||||
export interface ComponentUpdateEvent {
|
||||
frameCount: number;
|
||||
@@ -212,7 +212,7 @@ export class Component {
|
||||
}
|
||||
|
||||
if ( process.env.DEV ) {
|
||||
const checkBreakpointNames = () => {
|
||||
const checkBreakpointNames = (): void => {
|
||||
if (
|
||||
COMPONENT_UPDATE_BREAKPOINT != null &&
|
||||
Component.nameMap.get( COMPONENT_UPDATE_BREAKPOINT ?? '' ) == null
|
||||
|
@@ -1,11 +1,11 @@
|
||||
import { Camera } from './Camera';
|
||||
import { Entity } from '../Entity';
|
||||
import { Matrix4, Quaternion, Vector3 } from '@fms-cat/experimental';
|
||||
import { ComponentOptions, ComponentUpdateEvent } from './Component';
|
||||
import { CubemapRenderTarget } from '../CubemapRenderTarget';
|
||||
import { gl } from '../../globals/canvas';
|
||||
import { Transform } from '../Transform';
|
||||
import { Entity } from '../Entity';
|
||||
import { MaterialTag } from '../Material';
|
||||
import { Matrix4, Quaternion, Vector3 } from '@fms-cat/experimental';
|
||||
import { Transform } from '../Transform';
|
||||
import { gl } from '../../globals/canvas';
|
||||
|
||||
const INV_SQRT2 = 1.0 / Math.sqrt( 2.0 );
|
||||
|
||||
|
@@ -1,9 +1,9 @@
|
||||
import { Camera } from './Camera';
|
||||
import { ComponentOptions } from './Component';
|
||||
import { Entity } from '../Entity';
|
||||
import { MaterialTag } from '../Material';
|
||||
import { Matrix4 } from '@fms-cat/experimental';
|
||||
import { RenderTarget } from '../RenderTarget';
|
||||
import { ComponentOptions } from './Component';
|
||||
import { MaterialTag } from '../Material';
|
||||
|
||||
export interface PerspectiveCameraOptions extends ComponentOptions {
|
||||
materialTag: MaterialTag;
|
||||
|
@@ -1,10 +1,10 @@
|
||||
import { canvas } from './globals/canvas';
|
||||
import { BufferRenderTarget } from './heck/BufferRenderTarget';
|
||||
import { Component } from './heck/components/Component';
|
||||
import { music } from './globals/music';
|
||||
import { getCheckboxActive, getDivCanvasContainer } from './globals/dom';
|
||||
import { dog } from './scene';
|
||||
import { START_POSITION } from './config';
|
||||
import { canvas } from './globals/canvas';
|
||||
import { dog } from './scene';
|
||||
import { getCheckboxActive, getDivCanvasContainer } from './globals/dom';
|
||||
import { music } from './globals/music';
|
||||
|
||||
// == dom ==========================================================================================
|
||||
document.body.style.margin = '0';
|
||||
|
24
src/scene.ts
24
src/scene.ts
@@ -1,36 +1,33 @@
|
||||
import { Swap, Vector3 } from '@fms-cat/experimental';
|
||||
import { Antialias } from './entities/Antialias';
|
||||
import { Bloom } from './entities/Bloom';
|
||||
import { BufferRenderTarget } from './heck/BufferRenderTarget';
|
||||
import { CameraEntity } from './entities/CameraEntity';
|
||||
import { CanvasRenderTarget } from './heck/CanvasRenderTarget';
|
||||
import { Component } from './heck/components/Component';
|
||||
import { Condition } from './entities/Condition';
|
||||
import { Cube } from './entities/Cube';
|
||||
import { CubemapCameraEntity } from './entities/CubemapCameraEntity';
|
||||
import { Dog } from './heck/Dog';
|
||||
import { Entity } from './heck/Entity';
|
||||
import { EnvironmentMap } from './entities/EnvironmentMap';
|
||||
import { FlickyParticles } from './entities/FlickyParticles';
|
||||
import { Glitch } from './entities/Glitch';
|
||||
import { IBLLUT } from './entities/IBLLUT';
|
||||
import { Lambda } from './heck/components/Lambda';
|
||||
import { LightEntity } from './entities/LightEntity';
|
||||
import { PixelSorter } from './entities/PixelSorter';
|
||||
import { Post } from './entities/Post';
|
||||
import { RTInspector } from './entities/RTInspector';
|
||||
import { Raymarcher } from './entities/Raymarcher';
|
||||
import { Rings } from './entities/Rings';
|
||||
import { RTInspector } from './entities/RTInspector';
|
||||
import { SphereParticles } from './entities/SphereParticles';
|
||||
import { SufferTexts } from './entities/SufferTexts';
|
||||
import { Swap, Vector3 } from '@fms-cat/experimental';
|
||||
import { Trails } from './entities/Trails';
|
||||
import { arraySetDelete } from './utils/arraySetDelete';
|
||||
import { auto, automaton } from './globals/automaton';
|
||||
import { music } from './globals/music';
|
||||
import { randomTexture } from './globals/randomTexture';
|
||||
import { BufferRenderTarget } from './heck/BufferRenderTarget';
|
||||
import { CanvasRenderTarget } from './heck/CanvasRenderTarget';
|
||||
import { Component } from './heck/components/Component';
|
||||
import { Lambda } from './heck/components/Lambda';
|
||||
import { Dog } from './heck/Dog';
|
||||
import { Entity } from './heck/Entity';
|
||||
import { arraySetDelete } from './utils/arraySetDelete';
|
||||
|
||||
let totalFrame = 0;
|
||||
let isInitialFrame = true;
|
||||
|
||||
// -- dog ------------------------------------------------------------------------------------------
|
||||
export const dog = new Dog();
|
||||
@@ -40,9 +37,6 @@ const canvasRenderTarget = new CanvasRenderTarget();
|
||||
// Mr. Update Everything
|
||||
dog.root.components.push( new Lambda( {
|
||||
onUpdate: () => {
|
||||
totalFrame ++;
|
||||
isInitialFrame = false;
|
||||
|
||||
if ( process.env.DEV ) {
|
||||
Component.gpuTimer!.update();
|
||||
}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { Xorshift } from '@fms-cat/experimental';
|
||||
import GLCat, { GLCatTexture } from '@fms-cat/glcat-ts';
|
||||
import { gl } from '../globals/canvas';
|
||||
import GLCat, { GLCatTexture } from '@fms-cat/glcat-ts';
|
||||
|
||||
export class RandomTexture {
|
||||
private __texture: GLCatTexture;
|
||||
|
@@ -1,5 +0,0 @@
|
||||
export function createDefineString( defines: { [ identifier: string ]: string | undefined } ): string {
|
||||
return Object.entries( defines ).map( ( [ identifier, value ] ) => (
|
||||
value ? `#define ${identifier} ${value}\n` : ''
|
||||
) ).join( '' );
|
||||
}
|
@@ -4,7 +4,7 @@
|
||||
* @param i Index of the sequence
|
||||
* @param base Base of the sequence
|
||||
*/
|
||||
export function vdc( i: number, base: number ) {
|
||||
export function vdc( i: number, base: number ): number {
|
||||
let r = 0;
|
||||
let denom = 1;
|
||||
|
||||
|
@@ -1306,6 +1306,11 @@ escape-string-regexp@^1.0.5:
|
||||
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
|
||||
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
||||
|
||||
eslint-plugin-sort-imports-es6-autofix@^0.6.0:
|
||||
version "0.6.0"
|
||||
resolved "https://registry.yarnpkg.com/eslint-plugin-sort-imports-es6-autofix/-/eslint-plugin-sort-imports-es6-autofix-0.6.0.tgz#b8cd8639d7a54cefce6b17898b102fd5ec31e52b"
|
||||
integrity sha512-2NVaBGF9NN+727Fyq+jJYihdIeegjXeUUrZED9Q8FVB8MsV3YQEyXG96GVnXqWt0pmn7xfCZOZf3uKnIhBrfeQ==
|
||||
|
||||
eslint-scope@^5.0.0, eslint-scope@^5.1.1:
|
||||
version "5.1.1"
|
||||
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
|
||||
|
Reference in New Issue
Block a user