refactor: Raymarcher -> Wobbleball

This commit is contained in:
FMS-Cat
2021-03-27 20:24:34 +09:00
parent b57ca265cb
commit dd00e309c3
4 changed files with 14 additions and 14 deletions

File diff suppressed because one or more lines are too long

View File

@@ -10,9 +10,9 @@ import { genOctahedron } from '../geometries/genOctahedron';
import { objectValuesMap } from '../utils/objectEntriesMap'; import { objectValuesMap } from '../utils/objectEntriesMap';
import { randomTexture, randomTextureStatic } from '../globals/randomTexture'; import { randomTexture, randomTextureStatic } from '../globals/randomTexture';
import raymarchObjectVert from '../shaders/raymarch-object.vert'; import raymarchObjectVert from '../shaders/raymarch-object.vert';
import raymarcherFrag from '../shaders/raymarcher.frag'; import wobbleballFrag from '../shaders/wobbleball.frag';
export class Raymarcher extends Entity { export class Wobbleball extends Entity {
public constructor() { public constructor() {
super(); super();
@@ -34,7 +34,7 @@ export class Raymarcher extends Entity {
// -- materials -------------------------------------------------------------------------------- // -- materials --------------------------------------------------------------------------------
const deferred = new Material( const deferred = new Material(
raymarchObjectVert, raymarchObjectVert,
raymarcherFrag, wobbleballFrag,
{ {
defines: [ 'DEFERRED 1' ], defines: [ 'DEFERRED 1' ],
initOptions: { geometry, target: dummyRenderTargetFourDrawBuffers }, initOptions: { geometry, target: dummyRenderTargetFourDrawBuffers },
@@ -43,7 +43,7 @@ export class Raymarcher extends Entity {
const depth = new Material( const depth = new Material(
raymarchObjectVert, raymarchObjectVert,
raymarcherFrag, wobbleballFrag,
{ {
defines: [ 'SHADOW 1' ], defines: [ 'SHADOW 1' ],
initOptions: { geometry, target: dummyRenderTarget } initOptions: { geometry, target: dummyRenderTarget }
@@ -54,9 +54,9 @@ export class Raymarcher extends Entity {
if ( process.env.DEV ) { if ( process.env.DEV ) {
if ( module.hot ) { if ( module.hot ) {
module.hot.accept( '../shaders/raymarcher.frag', () => { module.hot.accept( '../shaders/wobbleball.frag', () => {
deferred.replaceShader( raymarchObjectVert, raymarcherFrag ); deferred.replaceShader( raymarchObjectVert, wobbleballFrag );
depth.replaceShader( raymarchObjectVert, raymarcherFrag ); depth.replaceShader( raymarchObjectVert, wobbleballFrag );
} ); } );
} }
} }
@@ -94,14 +94,14 @@ export class Raymarcher extends Entity {
material.addUniform( 'deformTime', '1f', auto( 'Music/NEURO_TIME' ) ); material.addUniform( 'deformTime', '1f', auto( 'Music/NEURO_TIME' ) );
} ); } );
}, },
name: process.env.DEV && 'Raymarcher/updater', name: process.env.DEV && 'Wobbleball/updater',
} ) ); } ) );
// -- mesh ------------------------------------------------------------------------------------- // -- mesh -------------------------------------------------------------------------------------
const mesh = new Mesh( { const mesh = new Mesh( {
geometry, geometry,
materials, materials,
name: process.env.DEV && 'Raymarcher/mesh', name: process.env.DEV && 'Wobbleball/mesh',
} ); } );
mesh.cull = MeshCull.None; mesh.cull = MeshCull.None;
this.components.push( mesh ); this.components.push( mesh );

View File

@@ -19,13 +19,13 @@ import { LightEntity } from './entities/LightEntity';
import { PixelSorter } from './entities/PixelSorter'; import { PixelSorter } from './entities/PixelSorter';
import { Post } from './entities/Post'; import { Post } from './entities/Post';
import { RTInspector } from './entities/RTInspector'; import { RTInspector } from './entities/RTInspector';
import { Raymarcher } from './entities/Raymarcher';
import { Rings } from './entities/Rings'; import { Rings } from './entities/Rings';
import { Serial } from './entities/Serial'; import { Serial } from './entities/Serial';
import { SphereParticles } from './entities/SphereParticles'; import { SphereParticles } from './entities/SphereParticles';
import { SufferTexts } from './entities/SufferTexts'; import { SufferTexts } from './entities/SufferTexts';
import { Swap, Vector3 } from '@fms-cat/experimental'; import { Swap, Vector3 } from '@fms-cat/experimental';
import { Trails } from './entities/Trails'; import { Trails } from './entities/Trails';
import { Wobbleball } from './entities/Wobbleball';
import { arraySetDelete } from './utils/arraySetDelete'; import { arraySetDelete } from './utils/arraySetDelete';
import { auto, automaton } from './globals/automaton'; import { auto, automaton } from './globals/automaton';
import { music } from './globals/music'; import { music } from './globals/music';
@@ -155,10 +155,10 @@ if ( process.env.DEV && module.hot ) {
} ); } );
} }
const replacerRaymarcher = new EntityReplacer( () => new Raymarcher(), 'Raymarcher' ); const replacerWobbleball = new EntityReplacer( () => new Wobbleball(), 'Wobbleball' );
if ( process.env.DEV && module.hot ) { if ( process.env.DEV && module.hot ) {
module.hot.accept( './entities/Raymarcher', () => { module.hot.accept( './entities/Wobbleball', () => {
replacerRaymarcher.replace(); replacerWobbleball.replace();
} ); } );
} }