Dad72 Posted March 7, 2018 Share Posted March 7, 2018 I noticed two bug with the waterMaterial. Place a field at 0, 0, 0 and an object above this field. Then add water some time later. You will see that the terrain is climbing 1.0 on the y axis. It is no longer 0, 0, 0 A second problem is that if you now observe the object, the water drops gently on this PG. On my project, it is the opposite the object is gradually found under water, so the ground goes up very very slowly. You have to wait a minute to fully see the problem. The water moves up or down and it's very subtle but after a while, a boat can be completely underwater or completely overhead. https://www.babylonjs-playground.com/#1SLLOJ#434 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 8, 2018 Share Posted March 8, 2018 Then after messing around for a while: Good catch. Simple fix I bet. Another problem I have noticed is reflection problems tword the bottom of the viewpoint when you are close to the water looking out nearly perpendicular. It seems to stretch the reflection. Dad72 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 8, 2018 Share Posted March 8, 2018 I can almost guarantee its: https://github.com/BabylonJS/Babylon.js/blob/master/materialsLibrary/src/water/water.vertex.fx#L129 vec3 p = position; float newY = (sin(((p.x / 0.05) + time * waveSpeed)) * waveHeight * windDirection.x * 5.0) + (cos(((p.z / 0.05) + time * waveSpeed)) * waveHeight * windDirection.y * 5.0); p.y += abs(newY); I would just see if we can nerf out the p.y+=abs(newY) for now if that it will fix it. https://www.babylonjs-playground.com/#1SLLOJ#435 ...Nope that did not seem to fix it... Hmmm I gotta do some thinking now. Dad72 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 8, 2018 Share Posted March 8, 2018 actually it looks like what I am doing is not replacing the shader, so I bet it would fix it if the changes I made propagated. That is the only place anywhere on the shader that it manipulates the height so has to be responsible for that glitch. Perhaps a Parallax Displacement would work better? http://graphics.cs.brown.edu/games/SteepParallax/index.html Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 8, 2018 Author Share Posted March 8, 2018 Your change in the shader here works for me. Can be your cache that makes you think it was not working. The water is at 0, 0, 0 and does not up and does not down. https://www.babylonjs-playground.com/#1SLLOJ#435 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 8, 2018 Share Posted March 8, 2018 Ok cool, are the waves still working? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 8, 2018 Author Share Posted March 8, 2018 Yes, Are you going to make a PR for this correction? Quote Link to comment Share on other sites More sharing options...
Dad72 Posted March 8, 2018 Author Share Posted March 8, 2018 I did the PR for this fix Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted March 8, 2018 Share Posted March 8, 2018 PR's scare me, hence why I have so little... Its like you make it you are responsible for it and that is way to much accountability. Quote Link to comment Share on other sites More sharing options...
Guest Posted March 9, 2018 Share Posted March 9, 2018 We are a team so you won't never be left alone Pryme8 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.