Closed datouzhan closed 3 years ago
@datouzhan , thanks for the issue.
What do you mean by:
Try to apply the example of Threejs's ocean, but the texture of the mouse scrolling flow will move with it.
Do you want the water texture to somehow follow the mouse?
i dont want the water texture to somehow follow the mouse ,but it follow.It confuse me
At present, the water texure will follow the mouse to zoom in and out.I dont want it follow.
@datouzhan , I can't see the issue from the gif, can you please upload a video somewhere and make it a bit longer, the gif is too stuttering
Can you see the issue?
@datouzhan , yes, thank you, now it is much clearer, and sorry for the delay.
What value are you passing in as the "eye" value? I mean uniform vec3 eye;
.
var eye = options.eye !== undefined ? options.eye : new THREE.Vector3(0, 0, 0);
I
set the eye value to the new vector3,and then In onbeforeRender method, I set eye.setFromMatrixPosition(camera.matrixWorld);
Ok, thanks @datouzhan. Which camera do you use? I guess the .camara
from the MapView
?
yes, the camera
from thre mapview
I have an idea.
Can you try just removing that line. i.e. set the eye to 0,0,0 every frame.
The position of all objects is positioned relative to the camera, i.e. the camera is positioned at 0,0,0 and everything is rendered relative to it, to ensure the precision of the depth buffer.
Do you mean to delete the eye.setFromMatrixPosition(camera.matrixWorld);
from beforeerender?
Yes
i try to delete the eye.setFromMatrixPosition(camera.matrixWorld);
But the problem is still not solved
What does it look like? Can you please create another video?
I noticed also you have the following
worldPosition = mirrorCoord.xyzw;
mirrorCoord = textureMatrix * mirrorCoord;
vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 )
Can you instead set worldPosition
to mvPosition
?
Otherwise I don't know what the issue is. You will have to debug it step by step.
" mirrorCoord = modelMatrix * vec4( position, 1.0 );",
// " worldPosition = mirrorCoord.xyzw;",
" mirrorCoord = textureMatrix * vec4( position, 1.0 );",
" vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );",
" worldPosition = mvPosition;",
" gl_Position = projectionMatrix * mvPosition;",
i instead set the worldPosition to mvPosition, now it look like https://user-images.githubusercontent.com/20176393/118776635-c72d6180-b8ba-11eb-8f72-17d56b0ee363.mp4 Do you have an email? I can send you a simple example
Sure, I have setup a temporary email: fowexeb391@threepp.com
Please send there, or do you have slack? You can register and we can talk directly. The link is in harp.gl: https://github.com/heremaps/harp.gl#harpgl-slack-channel-registration-available-here
hey @nzjony ,i am in the slack.My username is jane, can you find me?
@datouzhan , did you solve the issue in the end with the water?
Try to apply the example of Threejs's ocean, but the texture of the mouse scrolling flow will move with it.
` fragmentShader: [ "uniform sampler2D mirrorSampler;", "uniform float alpha;", "uniform float time;", "uniform float size;", "uniform float distortionScale;", "uniform sampler2D normalSampler;", "uniform vec3 sunColor;", "uniform vec3 sunDirection;", "uniform vec3 eye;", "uniform vec3 waterColor;",