cheryglsljs 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cherry.js CHANGED
@@ -1 +1 @@
1
- !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("Cherryglsl",[],n):"object"==typeof exports?exports.Cherryglsl=n():e.Cherryglsl=n()}(this,(()=>(()=>{"use strict";var e={d:(n,t)=>{for(var r in t)e.o(t,r)&&!e.o(n,r)&&Object.defineProperty(n,r,{enumerable:!0,get:t[r]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>r});function t(e=400,n=400){const t=new THREE.Scene,r=new THREE.PerspectiveCamera(75,window.innerWidth/window.innerHeight,.1,1e3),o=new THREE.WebGLRenderer({alpha:!0});return o.setSize(e,n),{Scene:t,camera:r,renderer:o}}const r={CherryWave:({container:e,image:n,speed:r=.05,strength:o=8,hover:i=!1})=>{if(!n)return void console.log("No image provided");(new THREE.TextureLoader).load(n.src,(a=>{const u={uImage:{value:a},uTime:{value:0},uStrength:{value:i?0:o}},c=t(e.clientWidth,e.clientHeight);let s;c.camera.position.z=190;new THREE.Raycaster;const d=new THREE.Vector2;function l(){const t=e.clientWidth,r=e.clientHeight,o=t/r,i=n.naturalWidth/n.naturalHeight;let a,d;o<i?(a=t,d=t/i):(d=r,a=r*i),s&&(c.Scene.remove(s),s.geometry.dispose(),s.material.dispose()),s=function(e,n){const t=new THREE.PlaneGeometry(e,n,100,100),r=new THREE.ShaderMaterial({vertexShader:"\nprecision highp float;\n varying vec2 vUv;\n varying vec3 pos;\n uniform float uTime;\n uniform float uStrength;\n\n void main() {\n \n vUv = uv;\n \n vec3 newPosition = position;\n\n // Enhanced wave effect: move vertices in all directions\n float waveX = uStrength * sin(10.0 * uv.y + uTime * 2.0);\n float waveY = uStrength * cos(12.0 * uv.x + uTime * 1.5);\n \n float waveZ = uStrength * sin(10.0 * uv.x + uTime * 2.5);\n\n newPosition.x += waveX;\n newPosition.y += waveY;\n newPosition.z += waveZ;\n\n pos = (modelViewMatrix * vec4(newPosition, 1.0)).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0);\n };",fragmentShader:"\nprecision highp float;\nvarying vec2 vUv;\nuniform sampler2D uImage;\nuniform float uTime;\nuniform float uStrength;\nvoid main() {\n // Create a wave effect by modifying the y coordinate\n vec2 uv = vUv;\n \n \n uv.y += uStrength/400.0 * sin(10.0 * uv.x + uTime * 2.0);\n uv.x += uStrength/400.0 * sin(10.0 * uv.y + uTime * 2.0);\n \n vec4 color = texture2D(uImage, uv);\n gl_FragColor = color;\n};",uniforms:u});return new THREE.Mesh(t,r)}(a,d),c.mesh=s,c.Scene.add(s)}return i&&(e.addEventListener("mousemove",(function(n){const t=e.getBoundingClientRect();d.x=(n.clientX-t.left)/t.width*2-1,d.y=-(n.clientY-t.top)/t.height*2+1})),e.addEventListener("mouseenter",(()=>{gsap.to(u.uStrength,{value:o,duration:.5,ease:"power2.out"})})),e.addEventListener("mouseleave",(()=>{gsap.to(u.uStrength,{value:0,duration:.5,ease:"power2.out"})}))),e.innerHTML="",e.appendChild(c.renderer.domElement),window.addEventListener("resize",(function(){const n=e.clientWidth,t=e.clientHeight;c.renderer.setSize(n,t),c.renderer.setPixelRatio(window.devicePixelRatio),c.camera.aspect=n/t,c.camera.updateProjectionMatrix(),l()})),l(),function e(){u.uTime.value+=r,c.renderer.render(c.Scene,c.camera),requestAnimationFrame(e)}(),{mesh:c.mesh,geometry:c.geometry,renderer:c.renderer,Scene:c.Scene}}))}};return n})()));
1
+ !function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define("Cherryglsl",[],n):"object"==typeof exports?exports.Cherryglsl=n():e.Cherryglsl=n()}(this,(()=>(()=>{"use strict";var e={d:(n,t)=>{for(var o in t)e.o(t,o)&&!e.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:t[o]})},o:(e,n)=>Object.prototype.hasOwnProperty.call(e,n),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},n={};e.r(n),e.d(n,{default:()=>o});function t(e=400,n=400){const t=new THREE.Scene,o=new THREE.PerspectiveCamera(75,window.innerWidth/window.innerHeight,.1,1e3),r=new THREE.WebGLRenderer({alpha:!1});return r.setSize(e,n),{Scene:t,camera:o,renderer:r}}const o={CherryWave:({container:e,image:n,speed:o=.05,strength:r=.02,hover:i=!1,light:a})=>{if(!n)return void console.log("No image provided");(new THREE.TextureLoader).load(n.src,(n=>{const u={uImage:{value:n},uTime:{value:0},uStrength:{value:i?0:r},uLight:{value:a}},s=t(e.clientWidth,e.clientHeight);let l;function v(){l&&(s.Scene.remove(l),l.geometry.dispose(),l.material.dispose()),l=function(){const n=e.clientWidth/e.clientHeight*2.3,t=new THREE.PlaneGeometry(n,2.3,100,100),o=new THREE.ShaderMaterial({vertexShader:"\nprecision highp float;\n varying vec2 vUv;\n varying vec3 pos;\n uniform float uTime;\n uniform float uStrength;\n\n void main() {\n \n vUv = uv;\n \n vec3 newPosition = position;\n\n \n float waveX = uStrength * sin(10.0 * uv.y + uTime * 2.0);\n float waveY = uStrength * cos(12.0 * uv.x + uTime * 1.5);\n \n float waveZ = uStrength * sin(10.0 * uv.x + uTime * 2.5);\n\n newPosition.x += waveX;\n newPosition.y += waveY;\n newPosition.z += waveZ;\n\n pos = (modelViewMatrix * vec4(newPosition, 1.0)).xyz;\n gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0);\n }",fragmentShader:"\nprecision highp float;\n\nvarying vec2 vUv;\nuniform sampler2D uImage;\nuniform float uTime;\n\nuniform float uStrength;\nuniform bool uLight;\n\n\nvoid main() {\n vec2 uv = vUv;\n \n\n \n \n\n // Apply wave distortion\n float waveX = sin(10.0 * uv.y + uTime * 2.0);\n float waveY = cos(10.0 * uv.x + uTime * 2.0);\n uv.x += (uStrength * 0.05) * waveX;\n uv.y += (uStrength * 0.05) * waveY;\n\n \n\n vec4 color = texture2D(uImage, uv);\n if(!uLight){\n color.x+=smoothstep(0.001,0.6,sin(2.0*uTime));\n color.y+=smoothstep(0.2,0.6,sin(0.2*uTime));\n }\n \n gl_FragColor = color;\n}\n",uniforms:u,transparent:!0});return new THREE.Mesh(t,o)}(),s.mesh=l,s.Scene.add(l)}function c(){const n=e.clientWidth,t=e.clientHeight;s.renderer.setSize(n,t),s.renderer.setPixelRatio(window.devicePixelRatio),s.camera.aspect=n/t,s.camera.updateProjectionMatrix(),v()}return s.camera.fov=2*Math.atan(e.clientHeight/2/600)*(180/Math.PI),s.camera.position.z=2.8,i&&(e.addEventListener("mouseenter",(()=>{gsap.to(u.uStrength,{value:r,duration:.5,ease:"power2.out"})})),e.addEventListener("mouseleave",(()=>{gsap.to(u.uStrength,{value:0,duration:.5,ease:"power2.out"})}))),e.innerHTML="",e.appendChild(s.renderer.domElement),window.addEventListener("resize",c),c(),function e(){u.uTime.value+=o,s.renderer.render(s.Scene,s.camera),requestAnimationFrame(e)}(),{mesh:s.mesh,geometry:s.geometry,renderer:s.renderer,Scene:s.Scene}}))}};return n})()));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cheryglsljs",
3
- "version": "1.1.3",
3
+ "version": "1.1.5",
4
4
  "description": "A Three.js + GLSL-based wave effect library.",
5
5
  "main": "dist/cherry.js",
6
6
  "module": "dist/cherry.js",
@@ -0,0 +1,161 @@
1
+
2
+ import createWaveAssets from '../../utils/init.js';
3
+ import fragmentShader from './FragementShader.glsl.js';
4
+ import vertexShader from './Vertexshader.glsl.js';
5
+
6
+ const CherryWave = ({ container, image, speed = 0.05, strength = 0.02, hover = false,light=false }) => {
7
+ if (!image) {
8
+ console.log("No image provided");
9
+ return;
10
+ }
11
+ const uniforms={
12
+ uImage: { value: null },
13
+ uImage2: { value: null },
14
+ uTime: { value: 0.0 },
15
+ uStrength: { value: hover ? 0 : strength },
16
+ uLight:light,
17
+ uMouse: { value: new THREE.Vector2(-10, -10) },
18
+ uRadius:{value:-4.0}
19
+ };
20
+ const textureLoader = new THREE.TextureLoader();
21
+ const images = ["i3.jpg","testimage.jpeg"];
22
+ let textures=[];
23
+ let index;
24
+ images.map((img,i)=>{
25
+ textureLoader.load(img, (texture) => {
26
+ index =0;
27
+ if(i==1) uniforms.uImage2.value=texture;
28
+ if(i==0) uniforms.uImage.value=texture;
29
+ textures.push(texture)
30
+ });
31
+ })
32
+
33
+ const waveassets = createWaveAssets(container.clientWidth, container.clientHeight);
34
+
35
+ // Set camera to frame a 2x2 unit square
36
+ waveassets.camera.fov = 2 * Math.atan(container.clientHeight / 2 / 600) * (180 / Math.PI);
37
+ waveassets.camera.position.z = 2.8;
38
+
39
+ let mesh;
40
+
41
+ function createMesh() {
42
+ const width = container.clientWidth;
43
+ const height = container.clientHeight;
44
+
45
+
46
+ const aspect = width / height;
47
+ const worldHeight = 2.3;
48
+ const worldWidth = worldHeight * aspect;
49
+
50
+ const geometry = new THREE.PlaneGeometry(worldWidth, worldHeight, 100, 100);
51
+ const material = new THREE.ShaderMaterial({
52
+ vertexShader,
53
+ fragmentShader,
54
+ uniforms,
55
+ transparent: true
56
+ });
57
+
58
+ return new THREE.Mesh(geometry, material);
59
+ }
60
+
61
+ function addMesh() {
62
+ if (mesh) {
63
+ waveassets.Scene.remove(mesh);
64
+ mesh.geometry.dispose();
65
+ mesh.material.dispose();
66
+ }
67
+
68
+ mesh = createMesh();
69
+ waveassets.mesh = mesh;
70
+ waveassets.Scene.add(mesh);
71
+ }
72
+
73
+ function onResize() {
74
+ const width = container.clientWidth;
75
+ const height = container.clientHeight;
76
+
77
+ waveassets.renderer.setSize(width, height);
78
+ waveassets.renderer.setPixelRatio(window.devicePixelRatio);
79
+
80
+ waveassets.camera.aspect = width / height;
81
+ waveassets.camera.updateProjectionMatrix();
82
+
83
+ addMesh();
84
+ }
85
+
86
+ function onMouseMove(event) {
87
+ const bounds = container.getBoundingClientRect();
88
+ const x = ((event.clientX - bounds.left) / bounds.width) - 0.5;
89
+ const y = -((event.clientY - bounds.top) / bounds.height) + 0.5;
90
+
91
+ gsap.to(uniforms.uMouse.value, {
92
+ x: x,
93
+ y: y,
94
+ duration: 0.2
95
+ });
96
+ // TransitionAssets.renderer.render(TransitionAssets.Scene, TransitionAssets.camera);
97
+ }
98
+
99
+ container.addEventListener('mousemove', onMouseMove);
100
+ if (hover) {
101
+
102
+ container.addEventListener('mouseenter', () => {
103
+ gsap.to(uniforms.uStrength, {
104
+ value: strength,
105
+ duration: 0.5,
106
+ ease: 'power2.out'
107
+ });
108
+ gsap.to(uniforms.uRadius, {
109
+ value:0.02,
110
+ duration: 0.2
111
+ });
112
+ });
113
+
114
+ container.addEventListener('mouseleave', () => {
115
+ gsap.to(uniforms.uStrength, {
116
+ value: 0,
117
+ duration: 0.5,
118
+ ease: 'power2.out'
119
+ });
120
+ gsap.to(uniforms.uRadius, {
121
+ value:-100,
122
+ duration: 0.6
123
+ });
124
+ });
125
+ }
126
+
127
+ container.innerHTML = '';
128
+ container.appendChild(waveassets.renderer.domElement);
129
+
130
+ window.addEventListener('resize', onResize);
131
+ onResize();
132
+
133
+ function animate() {
134
+ uniforms.uTime.value += speed;
135
+ waveassets.renderer.render(waveassets.Scene, waveassets.camera);
136
+ requestAnimationFrame(animate);
137
+ }
138
+
139
+ animate();
140
+ container.addEventListener('click',()=>{
141
+ gsap.to(uniforms.uRadius,{
142
+ value:20,
143
+ duration:3,
144
+ onComplete:()=>{
145
+ uniforms.uRadius.value=0.01
146
+ uniforms.uImage.value=textures[(index+1)%textures.length]
147
+ uniforms.uImage2.value=textures[(index+2)%textures.length]
148
+ index++;
149
+ }
150
+ })
151
+ })
152
+
153
+ return {
154
+ mesh: waveassets.mesh,
155
+ geometry: waveassets.geometry,
156
+ renderer: waveassets.renderer,
157
+ Scene: waveassets.Scene
158
+ };
159
+ };
160
+
161
+ export default CherryWave;
@@ -0,0 +1,62 @@
1
+ export default /* glsl */`
2
+ precision highp float;
3
+ uniform vec2 uMouse;
4
+ varying vec2 vUv;
5
+ uniform sampler2D uImage;
6
+ uniform float uTime;
7
+ uniform float uRadius;
8
+ uniform float uStrength;
9
+ uniform bool uLight;
10
+ uniform sampler2D uImage2;
11
+ float rand(float n){return fract(sin(n) * 43758.5453123);}
12
+ float rand(vec2 n){return fract(sin(dot(n, vec2(12.9898, 4.1414))) * 43758.5453123);}
13
+
14
+ float noise(float p){
15
+ float fl = floor(p);
16
+ float fc = fract(p);
17
+ return mix(rand(fl), rand(fl + 1.0), fc);
18
+ }
19
+
20
+ float noise(vec2 n) {
21
+ const vec2 d = vec2(0.0, 1.0);
22
+ vec2 b = floor(n), f = smoothstep(vec2(0.0), vec2(1.0), fract(n));
23
+ return mix(mix(rand(b), rand(b + d.yx), f.x), mix(rand(b + d.xy), rand(b + d.yy), f.x), f.y);
24
+ }
25
+
26
+ void main() {
27
+ vec2 uv = vUv;
28
+ vec2 guv = vUv;
29
+ guv.x -= 0.5;
30
+ guv.y -= 0.5;
31
+
32
+ // Calculate distance from mouse
33
+ float dist = length(guv - uMouse);
34
+
35
+
36
+ float edgeNoise = noise(guv * 10.0 + uTime * 2.0 ) * 0.2;
37
+
38
+ // Create mask for area following mouse, with wobbly edge
39
+ float inside = step(dist, uRadius + edgeNoise);
40
+
41
+ // Apply noise only inside the circle
42
+ float n = noise(guv * 0.2);
43
+
44
+ vec3 circle = mix(vec3(1.0), vec3(n), inside);
45
+
46
+ // Apply wave distortion
47
+ float waveX = sin(10.0 * uv.y + uTime * 2.0);
48
+ float waveY = cos(10.0 * uv.x + uTime * 2.0);
49
+ uv.x += (uStrength * 0.05) * waveX;
50
+ uv.y += (uStrength * 0.05) * waveY;
51
+
52
+
53
+
54
+ vec4 color = texture2D(uImage, uv);
55
+ if(uLight){
56
+ color.x-=smoothstep(0.001,0.6,sin(2.0*uTime));
57
+ color.y-=smoothstep(0.2,0.6,sin(0.2*uTime));
58
+ }
59
+ vec4 color2 = texture2D(uImage2,uv);
60
+ gl_FragColor = mix(color,(vec4(n)+color2),inside);
61
+ }
62
+ `;
@@ -0,0 +1,11 @@
1
+ export default /* glsl */`
2
+ precision highp float;
3
+ varying vec2 vUv;
4
+
5
+ void main() {
6
+ vUv = uv;
7
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
8
+ }`
9
+
10
+
11
+
@@ -1,8 +1,9 @@
1
+
1
2
  import createWaveAssets from '../../utils/init.js';
2
- import fragmentShader from './FragementShader.glsl';
3
- import vertexShader from './Vertexshader.glsl';
3
+ import fragmentShader from './FragementShader.glsl.js';
4
+ import vertexShader from './Vertexshader.glsl.js';
4
5
 
5
- const CherryWave = ({ container, image, speed = 0.05, strength = 8, hover = false }) => {
6
+ const CherryWave = ({ container, image, speed = 0.05, strength = 0.02, hover = false,light }) => {
6
7
  if (!image) {
7
8
  console.log("No image provided");
8
9
  return;
@@ -13,49 +14,48 @@ import vertexShader from './Vertexshader.glsl';
13
14
  const uniforms = {
14
15
  uImage: { value: texture },
15
16
  uTime: { value: 0.0 },
16
- uStrength: { value: hover ? 0 : strength }
17
+ uStrength: { value: hover ? 0 : strength },
18
+ uLight:{value:light}
19
+
17
20
  };
21
+
18
22
 
19
23
  const waveassets = createWaveAssets(container.clientWidth, container.clientHeight);
20
- waveassets.camera.position.z = 190;
24
+
25
+ // Set camera to frame a 2x2 unit square
26
+ waveassets.camera.fov = 2 * Math.atan(container.clientHeight / 2 / 600) * (180 / Math.PI);
27
+ waveassets.camera.position.z = 2.8;
21
28
 
22
29
  let mesh;
23
- const raycaster = new THREE.Raycaster();
24
- const mouse = new THREE.Vector2();
25
- let isHovering = false;
26
30
 
27
- function createMesh(width, height) {
28
- const geometry = new THREE.PlaneGeometry(width, height, 100, 100);
31
+ function createMesh() {
32
+ const width = container.clientWidth;
33
+ const height = container.clientHeight;
34
+
35
+
36
+ const aspect = width / height;
37
+ const worldHeight = 2.3;
38
+ const worldWidth = worldHeight * aspect;
39
+
40
+ const geometry = new THREE.PlaneGeometry(worldWidth, worldHeight, 100, 100);
29
41
  const material = new THREE.ShaderMaterial({
30
42
  vertexShader,
31
43
  fragmentShader,
32
- uniforms
44
+ uniforms,
45
+ transparent: true
33
46
  });
47
+
34
48
  return new THREE.Mesh(geometry, material);
35
49
  }
36
50
 
37
51
  function addMesh() {
38
- const containerWidth = container.clientWidth;
39
- const containerHeight = container.clientHeight;
40
- const containerAspect = containerWidth / containerHeight;
41
- const imageAspect = image.naturalWidth / image.naturalHeight;
42
-
43
- let scaleWidth, scaleHeight;
44
- if (containerAspect < imageAspect) {
45
- scaleWidth = containerWidth;
46
- scaleHeight = containerWidth / imageAspect;
47
- } else {
48
- scaleHeight = containerHeight;
49
- scaleWidth = containerHeight * imageAspect;
50
- }
51
-
52
52
  if (mesh) {
53
53
  waveassets.Scene.remove(mesh);
54
54
  mesh.geometry.dispose();
55
55
  mesh.material.dispose();
56
56
  }
57
57
 
58
- mesh = createMesh(scaleWidth, scaleHeight);
58
+ mesh = createMesh();
59
59
  waveassets.mesh = mesh;
60
60
  waveassets.Scene.add(mesh);
61
61
  }
@@ -73,14 +73,8 @@ import vertexShader from './Vertexshader.glsl';
73
73
  addMesh();
74
74
  }
75
75
 
76
- function onMouseMove(event) {
77
- const bounds = container.getBoundingClientRect();
78
- mouse.x = ((event.clientX - bounds.left) / bounds.width) * 2 - 1;
79
- mouse.y = -((event.clientY - bounds.top) / bounds.height) * 2 + 1;
80
- }
81
-
76
+
82
77
  if (hover) {
83
- container.addEventListener('mousemove', onMouseMove);
84
78
 
85
79
  container.addEventListener('mouseenter', () => {
86
80
  gsap.to(uniforms.uStrength, {
@@ -88,6 +82,7 @@ import vertexShader from './Vertexshader.glsl';
88
82
  duration: 0.5,
89
83
  ease: 'power2.out'
90
84
  });
85
+
91
86
  });
92
87
 
93
88
  container.addEventListener('mouseleave', () => {
@@ -96,20 +91,22 @@ import vertexShader from './Vertexshader.glsl';
96
91
  duration: 0.5,
97
92
  ease: 'power2.out'
98
93
  });
94
+
99
95
  });
100
96
  }
101
97
 
102
98
  container.innerHTML = '';
103
99
  container.appendChild(waveassets.renderer.domElement);
100
+
104
101
  window.addEventListener('resize', onResize);
105
- addMesh();
102
+ onResize();
106
103
 
107
104
  function animate() {
108
105
  uniforms.uTime.value += speed;
109
106
  waveassets.renderer.render(waveassets.Scene, waveassets.camera);
110
107
  requestAnimationFrame(animate);
111
108
  }
112
-
109
+
113
110
  animate();
114
111
 
115
112
  return {
@@ -122,4 +119,3 @@ import vertexShader from './Vertexshader.glsl';
122
119
  };
123
120
 
124
121
  export default CherryWave;
125
-
@@ -1,18 +1,35 @@
1
1
  export default /* glsl */`
2
2
  precision highp float;
3
+
3
4
  varying vec2 vUv;
4
5
  uniform sampler2D uImage;
5
6
  uniform float uTime;
7
+
6
8
  uniform float uStrength;
9
+ uniform bool uLight;
10
+
11
+
7
12
  void main() {
8
- // Create a wave effect by modifying the y coordinate
9
13
  vec2 uv = vUv;
10
14
 
15
+
16
+
11
17
 
12
- uv.y += uStrength/400.0 * sin(10.0 * uv.x + uTime * 2.0);
13
- uv.x += uStrength/400.0 * sin(10.0 * uv.y + uTime * 2.0);
18
+
19
+ // Apply wave distortion
20
+ float waveX = sin(10.0 * uv.y + uTime * 2.0);
21
+ float waveY = cos(10.0 * uv.x + uTime * 2.0);
22
+ uv.x += (uStrength * 0.05) * waveX;
23
+ uv.y += (uStrength * 0.05) * waveY;
24
+
14
25
 
15
- vec4 color = texture2D(uImage, uv);
16
- gl_FragColor = color;
17
- };`
18
26
 
27
+ vec4 color = texture2D(uImage, uv);
28
+ if(!uLight){
29
+ color.x+=smoothstep(0.001,0.6,sin(2.0*uTime));
30
+ color.y+=smoothstep(0.2,0.6,sin(0.2*uTime));
31
+ }
32
+
33
+ gl_FragColor = color;
34
+ }
35
+ `;
@@ -11,7 +11,7 @@ precision highp float;
11
11
 
12
12
  vec3 newPosition = position;
13
13
 
14
- // Enhanced wave effect: move vertices in all directions
14
+
15
15
  float waveX = uStrength * sin(10.0 * uv.y + uTime * 2.0);
16
16
  float waveY = uStrength * cos(12.0 * uv.x + uTime * 1.5);
17
17
 
@@ -23,7 +23,7 @@ precision highp float;
23
23
 
24
24
  pos = (modelViewMatrix * vec4(newPosition, 1.0)).xyz;
25
25
  gl_Position = projectionMatrix * modelViewMatrix * vec4(newPosition, 1.0);
26
- };`
26
+ }`
27
27
 
28
28
 
29
29
 
package/src/utils/init.js CHANGED
@@ -6,7 +6,8 @@ const camera = () => new THREE.PerspectiveCamera(
6
6
  0.1,
7
7
  1000
8
8
  );
9
- const renderer = () => new THREE.WebGLRenderer({alpha:true});
9
+
10
+ const renderer = () => new THREE.WebGLRenderer({alpha:false});
10
11
 
11
12
  export default function createWaveAssets(width = 400, height = 400) {
12
13
  const SceneInstance = Scene();