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

View File

@@ -19,13 +19,13 @@ 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 { Serial } from './entities/Serial';
import { SphereParticles } from './entities/SphereParticles';
import { SufferTexts } from './entities/SufferTexts';
import { Swap, Vector3 } from '@fms-cat/experimental';
import { Trails } from './entities/Trails';
import { Wobbleball } from './entities/Wobbleball';
import { arraySetDelete } from './utils/arraySetDelete';
import { auto, automaton } from './globals/automaton';
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 ) {
module.hot.accept( './entities/Raymarcher', () => {
replacerRaymarcher.replace();
module.hot.accept( './entities/Wobbleball', () => {
replacerWobbleball.replace();
} );
}