mirror of
https://github.com/FMS-Cat/condition.git
synced 2025-08-13 17:24:00 +02:00
fix: Fix crystal issues
This commit is contained in:
@@ -69,11 +69,6 @@ export class Crystal extends Entity {
|
||||
}
|
||||
}
|
||||
|
||||
objectValuesMap( materials, ( material ) => {
|
||||
material?.addUniform( 'size', '2f', width, height );
|
||||
material?.addUniform( 'noiseOffset', '1f', noiseOffset );
|
||||
} );
|
||||
|
||||
// haha
|
||||
auto( 'Crystal/enableDepth', ( { uninit } ) => {
|
||||
if ( uninit ) {
|
||||
@@ -103,6 +98,9 @@ export class Crystal extends Entity {
|
||||
.inverse!
|
||||
.elements
|
||||
);
|
||||
|
||||
material?.addUniform( 'size', '2f', width, height );
|
||||
material?.addUniform( 'noiseOffset', '1f', noiseOffset );
|
||||
} );
|
||||
},
|
||||
name: process.env.DEV && 'Crystal/updater',
|
||||
|
@@ -93,6 +93,7 @@ export class SceneCrystals extends Entity {
|
||||
light1.transform.lookAt( new Vector3( [ 0.0, 4.0, 1.0 ] ) );
|
||||
|
||||
auto( 'SceneCrystals/light/amp', ( { value } ) => {
|
||||
light1.active = value > 0.0;
|
||||
light1.color = [ 100.0 * value, 100.0 * value, 100.0 * value ];
|
||||
} );
|
||||
|
||||
|
26
src/scene.ts
26
src/scene.ts
@@ -179,6 +179,19 @@ if ( process.env.DEV && module.hot ) {
|
||||
} );
|
||||
}
|
||||
|
||||
const replacerSceneCrystals = new EntityReplacer(
|
||||
() => new SceneCrystals( { scenes: [ dog.root ] } ),
|
||||
'SceneCrystals',
|
||||
);
|
||||
if ( process.env.DEV && module.hot ) {
|
||||
module.hot.accept( './entities/SceneCrystals', () => {
|
||||
replacerSceneCrystals.current.lights.map( ( light ) => arraySetDelete( lights, light ) );
|
||||
replacerSceneCrystals.replace();
|
||||
lights.push( ...replacerSceneCrystals.current.lights );
|
||||
replacerSceneCrystals.current.setDefferedCameraTarget( deferredCamera.cameraTarget );
|
||||
} );
|
||||
}
|
||||
|
||||
const replacerSceneDynamic = new EntityReplacer(
|
||||
() => new SceneDynamic( { scenes: [ dog.root ] } ),
|
||||
'SceneDynamic',
|
||||
@@ -207,19 +220,6 @@ if ( process.env.DEV && module.hot ) {
|
||||
} );
|
||||
}
|
||||
|
||||
const replacerSceneCrystals = new EntityReplacer(
|
||||
() => new SceneCrystals( { scenes: [ dog.root ] } ),
|
||||
'SceneCrystals',
|
||||
);
|
||||
if ( process.env.DEV && module.hot ) {
|
||||
module.hot.accept( './entities/SceneCrystals', () => {
|
||||
replacerSceneCrystals.current.lights.map( ( light ) => arraySetDelete( lights, light ) );
|
||||
replacerSceneCrystals.replace();
|
||||
lights.push( ...replacerSceneCrystals.current.lights );
|
||||
replacerSceneCrystals.current.setDefferedCameraTarget( deferredCamera.cameraTarget );
|
||||
} );
|
||||
}
|
||||
|
||||
const replacerScenePsy = new EntityReplacer(
|
||||
() => new ScenePsy( { scenes: [ dog.root ] } ),
|
||||
'ScenePsy'
|
||||
|
@@ -135,7 +135,7 @@ void main() {
|
||||
float shadowDepth = linearstep(
|
||||
cameraNearFar.x,
|
||||
cameraNearFar.y,
|
||||
length( cameraPos - rayPos )
|
||||
length( cameraPos - modelPos.xyz )
|
||||
);
|
||||
fragColor = vec4( shadowDepth, shadowDepth * shadowDepth, shadowDepth, 1.0 );
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user