Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edge feathering for flow for a fix direction #851

Open
nitroman123 opened this issue Jun 9, 2021 · 21 comments
Open

Edge feathering for flow for a fix direction #851

nitroman123 opened this issue Jun 9, 2021 · 21 comments

Comments

@nitroman123
Copy link

Please describe the desired feature/behavior.

This will help simulating dynamic waves when the ship is is at low speeds. This will help a lot for waterjets in the near future I want to add and the dynamic waves to be simulated like real when the ship has low speeds . This will look very realistic

Supporting images/mockups, or example reference videos are very helpful to communicate ideas.

Desktop.2021.06.08.-.18.33.31.02.mp4
@daleeidd
Copy link
Collaborator

daleeidd commented Jun 9, 2021

Thanks.

One workaround until we look into adding this is making use of the texture input is an option. Here is a radial gradient which won't have a seam.

Radial

@nitroman123
Copy link
Author

the result is amazing !!! really

@nitroman123
Copy link
Author

nitroman123 commented Jun 9, 2021

But in the start is fine but when is start gaining speed its like rotating around it self

Start
Screenshot_372

At speed and turned

Screenshot_373

Screenshot_374

@nitroman123
Copy link
Author

@daleeidd @huwb After some experiment with programming some custom properties I found that the flow float2 attribute they x and y values must have a different value for every single rotation in order to simulate the correct value (pushing the waves backwards or regardless the rotation this could help a lot with my case and will give a unique touch for the game)

Screenshot_381

@huwb
Copy link
Contributor

huwb commented Jun 13, 2021

Thanks for this, looks interesting. we can help but i think i need to see the issue in motion to understand your latest posts. or if you can share the effect with us we can work on it with you.

@nitroman123
Copy link
Author

@huwb yes here i made a 3 min video to see , hope this helps , i tweak the values runtime to see the correction it makes , its a very nice effect and for me and i think everyone love to have it cause it simulates the real sea behavior especially for ships. The combination of fixed direction and the 2 texture could be awesome .

https://youtu.be/VGu_Crjg9V8

@nitroman123
Copy link
Author

Any updates for this i really love to have it to make some nice videos... this feature will give a very nice feeling on the water pushing ?

@daleeidd
Copy link
Collaborator

@nitroman123 Unfortunately, no. All time has gone towards the next release as it was a big update.

@nitroman123
Copy link
Author

@huwb @daleeidd Ive made some experiments and i found the values for the degrees based on the rotation , i was trying to make a script to control the X and Z values. I made the X and Z float variables and i found the right values for the X and Z .

Basically the values goes from to for each rotation

degrees 0 x = 0 , z = 1
degrees 90 x = 1 , z = 0
degrees 180 x = 0 , z = -1
degrees 270 x = -1 , z = 0
degrees 360 x = 0 , z = 1

tell me if i cant make something the help the procedure cause i really want it !!!

Thanks in advance

@nitroman123
Copy link
Author

nitroman123 commented Jul 2, 2021

So after 1 day of trying i made a script that controls the values for the shader to be rotated with the right numbers

script :

https://pastebin.com/JpfB4FPa

assign the material and the modified shader

https://pastebin.com/2kNcg5us

download

@daleeidd
Copy link
Collaborator

daleeidd commented Jul 7, 2021

Nice work. Have a video of it in action? Very interested in seeing it.

@nitroman123
Copy link
Author

it doesnt work correctly for all rotations and imagine that if you want to make a flow input look at the side of the ship (Bow thruster) the rotations change dramatically i will make a sort video and send it over in a bit

@nitroman123
Copy link
Author

nitroman123 commented Jul 7, 2021

here is the video https://youtu.be/vru4gtWMCTc it is almost getting the right values but i would very costly to make for a lot of points and more points mean more script etc... I really want this feature it will give a very big impact on the visuals and a unique feature for a ship sim game

@daleeidd
Copy link
Collaborator

daleeidd commented Jul 7, 2021

The video is private and I cannot view it.

@nitroman123
Copy link
Author

nitroman123 commented Jul 8, 2021

sry for this now you should be able to see it https://youtu.be/vru4gtWMCTc

@huwb
Copy link
Contributor

huwb commented Jul 10, 2021

Still can't seem to access it. Has it worked for you dale?

@daleeidd
Copy link
Collaborator

Still can't seem to access it. Has it worked for you dale?

It does but I had to copy and paste the link manually. I've updated both links and they will work when clicked now.

@daleeidd
Copy link
Collaborator

sry for this now you should be able to see it https://youtu.be/vru4gtWMCTc

Thanks. Looks great. Interesting approach to get that effect.

@nitroman123
Copy link
Author

Is very nice effect to show that forces push the water backwards etc. This is a must effect in my ship sim game. Its getting close to release next year and having this effect will be a miracle. If a had a fixed direction with the smoothness of the add flow map is all i need.

Sry for the link don't know what was wrong with that.

@daleeidd
Copy link
Collaborator

Test branch here: test/feature/flow-input-improvements. Spoke with @nitroman123 on Discord with feedback. The rotation works with a quad as I just took the code from the spline. I'll need to work out how to make it user friendly before it can be merged. Will do a PR soon for the UV feathering as that works well.

@daleeidd
Copy link
Collaborator

Feathering has been added for 4.15. Rotation has been moved to its own branch: https://github.com/wave-harmonic/crest/tree/feature/flow-rotation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants