Skip to content

Commit c396670

Browse files
committed
コメントの修正、simplex-noiseを依存関係から削除
1 parent ce36090 commit c396670

File tree

7 files changed

+10
-18
lines changed

7 files changed

+10
-18
lines changed

package-lock.json

Lines changed: 0 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
},
2121
"dependencies": {
2222
"lil-gui": "^0.21.0",
23-
"simplex-noise": "^4.0.3",
2423
"three": "^0.180.0"
2524
}
2625
}

sea/src/three/createSea.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import * as THREE from "three";
2-
import { createNoise2D } from "simplex-noise";
2+
import { SimplexNoise } from "three/examples/jsm/Addons.js";
33

4-
const noise2D = createNoise2D();
4+
const simplexNoise = new SimplexNoise();
55

66
const seaParams = {
77
color: "#52ebff",
8-
frequency: 0.1,
9-
amplitude: 0.7,
8+
frequency: 0.09,
9+
amplitude: 0.75,
1010
waveSpeed: 0.2,
1111
waveAmplitude: 0.4,
1212
};
@@ -27,7 +27,7 @@ const applyNoise = () => {
2727
const x = positionAttribute.getX(index);
2828
const y = positionAttribute.getY(index);
2929

30-
const noiseValue = noise2D(x * seaParams.frequency, y * seaParams.frequency);
30+
const noiseValue = simplexNoise.noise(x * seaParams.frequency, y * seaParams.frequency);
3131
const height = noiseValue * seaParams.amplitude;
3232

3333
positionAttribute.setZ(index, height);
@@ -68,7 +68,7 @@ export const animateSea = (elapsedTime: number) => {
6868
const originalZ = originalZPositions[index];
6969

7070
// xとyの値からノイズを生成し、timeで変化させる
71-
const noiseValue = noise2D(x * seaParams.frequency + time, y * seaParams.frequency + time);
71+
const noiseValue = simplexNoise.noise(x * seaParams.frequency + time, y * seaParams.frequency + time);
7272
const waveHeight = noiseValue * seaParams.waveAmplitude;
7373

7474
// 元のz座標を基準に波の高さを加算

sea/src/three/postprocess/bloom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { TextureNode } from "three/webgpu";
33
import { bloom } from "three/examples/jsm/tsl/display/BloomNode.js";
44

55
/**
6-
* bloomエフェクトの作成
6+
* Bloomエフェクトの作成
77
* @param node
88
*/
99
export const createBloom = (node: ShaderNodeObject<TextureNode>) => {

sea/src/three/postprocess/chromatic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as THREE from "three";
66
import { float, uniform } from "three/tsl";
77

88
/**
9-
* chromaticエフェクトの作成
9+
* Chromatic Aberration + Depth of Fieldエフェクトの作成
1010
* @param node
1111
* @param viewZ
1212
*/

sea/src/three/postprocess/pixelation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type * as THREE from "three";
33
import { pixelationPass } from "three/examples/jsm/tsl/display/PixelationPassNode.js";
44

55
/**
6-
* pixelationエフェクトの作成
6+
* Pixelationエフェクトの作成
77
* @param node
88
*/
99
export const createPixelation = (scene: THREE.Scene, camera: THREE.PerspectiveCamera) => {

sea/src/three/postprocess/sepia.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { film as filmPass } from "three/examples/jsm/tsl/display/FilmNode.js";
55
import { gaussianBlur as gaussianBlurPass } from "three/examples/jsm/tsl/display/GaussianBlurNode.js";
66

77
/**
8-
* sepiaエフェクトの作成
8+
* Sepia + Film + Gaussian Blurエフェクトの作成
99
* @param node
1010
*/
1111
export const createSepia = (node: ShaderNodeObject<TextureNode>) => {

0 commit comments

Comments
 (0)