Jump to content

WebGL GLSL Shader one wave over the sphere


inverser
 Share

Recommended Posts

Hello, friends. There was such a task. Start up one! a wave over a sphere, which, as it were, looks like a map of the planet, which (map) in turn is generated from planeBufferGeometry and then these geometries are combined using

THREE.BufferGeometryUtils.mergeBufferGeometries(geometries, false);

Code of vertex shader:

vertexShader:`
    varying vec2 vUv;
    uniform float time;
    void main(){
        vUv=uv;
        vec3 newposition = position + position*sin(position.z*12.)*0.03;
        gl_Position = projectionMatrix * modelViewMatrix * vec4( newposition, 1. );
    }
`,

The question is how to make only this one "wave", i.e. so that sin does not go over the entire sphere, but only in the middle, for example. And further. How can I change the direction of this "wave", now it comes from the Z coordinate of this sphere, I need it to go from the position I have defined (for example, approximate coordinates of London).

Screenshot_20210206_101239.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...