mirror of
https://github.com/FMS-Cat/condition.git
synced 2025-08-15 18:14:19 +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
|
// haha
|
||||||
auto( 'Crystal/enableDepth', ( { uninit } ) => {
|
auto( 'Crystal/enableDepth', ( { uninit } ) => {
|
||||||
if ( uninit ) {
|
if ( uninit ) {
|
||||||
@@ -103,6 +98,9 @@ export class Crystal extends Entity {
|
|||||||
.inverse!
|
.inverse!
|
||||||
.elements
|
.elements
|
||||||
);
|
);
|
||||||
|
|
||||||
|
material?.addUniform( 'size', '2f', width, height );
|
||||||
|
material?.addUniform( 'noiseOffset', '1f', noiseOffset );
|
||||||
} );
|
} );
|
||||||
},
|
},
|
||||||
name: process.env.DEV && 'Crystal/updater',
|
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 ] ) );
|
light1.transform.lookAt( new Vector3( [ 0.0, 4.0, 1.0 ] ) );
|
||||||
|
|
||||||
auto( 'SceneCrystals/light/amp', ( { value } ) => {
|
auto( 'SceneCrystals/light/amp', ( { value } ) => {
|
||||||
|
light1.active = value > 0.0;
|
||||||
light1.color = [ 100.0 * value, 100.0 * value, 100.0 * value ];
|
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(
|
const replacerSceneDynamic = new EntityReplacer(
|
||||||
() => new SceneDynamic( { scenes: [ dog.root ] } ),
|
() => new SceneDynamic( { scenes: [ dog.root ] } ),
|
||||||
'SceneDynamic',
|
'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(
|
const replacerScenePsy = new EntityReplacer(
|
||||||
() => new ScenePsy( { scenes: [ dog.root ] } ),
|
() => new ScenePsy( { scenes: [ dog.root ] } ),
|
||||||
'ScenePsy'
|
'ScenePsy'
|
||||||
|
@@ -135,7 +135,7 @@ void main() {
|
|||||||
float shadowDepth = linearstep(
|
float shadowDepth = linearstep(
|
||||||
cameraNearFar.x,
|
cameraNearFar.x,
|
||||||
cameraNearFar.y,
|
cameraNearFar.y,
|
||||||
length( cameraPos - rayPos )
|
length( cameraPos - modelPos.xyz )
|
||||||
);
|
);
|
||||||
fragColor = vec4( shadowDepth, shadowDepth * shadowDepth, shadowDepth, 1.0 );
|
fragColor = vec4( shadowDepth, shadowDepth * shadowDepth, shadowDepth, 1.0 );
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user