Comments (11)
Sorry! I found the problem.
I was scaling the object with the spline by a factor of 4, for testing. That screwsed up the thing.
Setting all to 1 solved the problem!
from crest.
Unfortunately it is still not really solved. I made some tests:
This is a sphere moving at a speed of 6 thru not flowing water:
And this is a sphere sitting still in a water flow of 6
It generates way less waves in the moving water. I have put the same FFT wave settings onto the flow component.
Overall the waterinteractions produces way less waves inside a flow area.
Any advise?
Another thing I found out is that the SphereWaterIteraction.VelocityOffset works on the world speed of the object. This is wrong! It has to use the relative speed thru the water, right?
from crest.
Better images:
Flow: OFF
Flow: ON
Same relative speed of 6.
Seems also to be a difference in the created foam.
from crest.
Yeah, that doesn't seem right. I would think it would be stronger if anything but I could be wrong. If you disable the following line it does a bit to keep the interaction strength - can go even further by changing it to an add to increase the interaction strength:
I don't know if this will be the actual solution as going against something that seems intentional but worth a test anyhow. LMKWYT
Another thing I found out is that the SphereWaterIteraction.VelocityOffset works on the world speed of the object. This is wrong! It has to use the relative speed thru the water, right?
That makes sense and will look into it.
from crest.
Yes! That's it. Looks right to me! Please do not forget to change this for the next update!
from crest.
Unfortunately removing that line or adding the surfaceFlow vector to relativeVelocity creates a new issue where the interaction sphere effect begins to compound on itself over time when no input is applied. This is what happens when you remove the line with a flow of 9 and do not add any input to the spheres (just let it move with the flow).
Screen.Recording.2023-11-20.at.9.06.30.AM.mp4
This is the behavior normally without removing or adding the surfaceFlow vector, note the lack of amplified interaction sphere forces:
Screen.Recording.2023-11-20.at.9.10.19.AM.mp4
I do believe that the issue might stem from taking the world object speed and not relative speed.
Edit:
Upon further testing this unwanted amplification occurs at any flow rate. You can reproduce by setting a curve with flow, placing an interaction sphere with no further inputs in the flow, and disabling the following line:
relativeVelocity -= new Vector3(surfaceFlow.x, 0, surfaceFlow.y);
Ideally the behavior should replicate wakes similarly between non flow and flow elements with the same interaction settings.
from crest.
Thanks for the additional input. I will look into it further and see if I can come up with something.
from crest.
I had a harder look and the velocity calculations are correct.
There is an issue where wakes do not work very well at higher velocities which flow can contribute to and may be related in certain cases.
There is certainly a diminished wake in flow. I am not sure how SWI should behave in flow and whether this is correct or needs fixing. It may take a while before a conclusion on that.
For the time being I think the loss of wakes can be compensated by modelling the boat's propulsion system and further compensated with water spray as the boat will have to work harder against flow to maintain velocity.
from crest.
Alright... so wakes are far more diminished when flow is not axis aligned. When axis aligned it is pretty close to expectations.
from crest.
I had a harder look and the velocity calculations are correct.
There is an issue where wakes do not work very well at higher velocities which flow can contribute to and may be related in certain cases.
There is certainly a diminished wake in flow. I am not sure how SWI should behave in flow and whether this is correct or needs fixing. It may take a while before a conclusion on that.
For the time being I think the loss of wakes can be compensated by modelling the boat's propulsion system and further compensated with water spray as the boat will have to work harder against flow to maintain velocity.
I do actually agree with this, I was doing thinking as well and flow should definitely dampen the effect of SphereWaterInteractions, however I think the current iteration of flow is neutering this far too much to where at any flow above
certain values completely removes any impact of a sphere interactor e.g. in flows of 5 or above. If we refer to even shallow rapids we can see a noticeable impact of the watercraft e.g. https://youtu.be/FW8c75CUBGU. Perhaps the impact of water interactions in flow should be a tunable setting on the flow side?
from crest.
e.g. in flows of 5 or above
Fastest river speed would be around 3MPS (in rare cases almost 5MPS). Flash flooding is around 7MPS.
This will take a while to solve properly as there is potentially various factors.
As for increasing the weight of SWI in flow that is a possible workaround. I made a branch you can try: fix-weak-flow-swi-interaction
from crest.
Related Issues (20)
- Boat Physics - Adding colliders and player to boat causing big issues HOT 1
- Problems when rendering HOT 1
- Shader broken on 2022.2.4 on Metal HOT 5
- URP reflection error when using two cameras after build. HOT 3
- Updating ShapeFFT parameters runtime, generates a lot of garbage HOT 5
- HDRP underwater volumetric lights not working properly HOT 2
- Local / movable spectrums or crest shapes HOT 3
- Foam / wake vibration when approaching whirlpools HOT 20
- Pressing the Windows Key in the editor disables underwater rendering HOT 3
- Wake / foam artifacts when moving the camera quickly HOT 11
- Delayed LOD / tile enabling when using large clipping areas HOT 5
- Depth Cache not populated - Exported Image is Black HOT 8
- Water interaction is not visible when moving camera away from the sea level HOT 1
- Underwater broken with XR multi-pass rendering HOT 1
- No caustics, no shadow data and/or constant shadowing on iOS
- Error of Does not exist some Classes. HOT 1
- Sporadic gaps / precision errors in tiles. HOT 35
- Activating flow in the material when oceanrenderer is running does only work in editor HOT 2
- FindObjectsSortMode HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crest.