File tree Expand file tree Collapse file tree 7 files changed +10
-18
lines changed
Expand file tree Collapse file tree 7 files changed +10
-18
lines changed Original file line number Diff line number Diff line change 2020 },
2121 "dependencies" : {
2222 "lil-gui" : " ^0.21.0" ,
23- "simplex-noise" : " ^4.0.3" ,
2423 "three" : " ^0.180.0"
2524 }
2625}
Original file line number Diff line number Diff line change 11import * 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
66const 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座標を基準に波の高さを加算
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type { TextureNode } from "three/webgpu";
33import { bloom } from "three/examples/jsm/tsl/display/BloomNode.js" ;
44
55/**
6- * bloomエフェクトの作成
6+ * Bloomエフェクトの作成
77 * @param node
88 */
99export const createBloom = ( node : ShaderNodeObject < TextureNode > ) => {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import * as THREE from "three";
66import { float , uniform } from "three/tsl" ;
77
88/**
9- * chromaticエフェクトの作成
9+ * Chromatic Aberration + Depth of Fieldエフェクトの作成
1010 * @param node
1111 * @param viewZ
1212 */
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import type * as THREE from "three";
33import { pixelationPass } from "three/examples/jsm/tsl/display/PixelationPassNode.js" ;
44
55/**
6- * pixelationエフェクトの作成
6+ * Pixelationエフェクトの作成
77 * @param node
88 */
99export const createPixelation = ( scene : THREE . Scene , camera : THREE . PerspectiveCamera ) => {
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { film as filmPass } from "three/examples/jsm/tsl/display/FilmNode.js";
55import { gaussianBlur as gaussianBlurPass } from "three/examples/jsm/tsl/display/GaussianBlurNode.js" ;
66
77/**
8- * sepiaエフェクトの作成
8+ * Sepia + Film + Gaussian Blurエフェクトの作成
99 * @param node
1010 */
1111export const createSepia = ( node : ShaderNodeObject < TextureNode > ) => {
You can’t perform that action at this time.
0 commit comments