crest icon indicating copy to clipboard operation
crest copied to clipboard

Edge feathering for flow for a fix direction

Open nitroman123 opened this issue 4 years ago • 21 comments

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.

https://user-images.githubusercontent.com/62849221/121402064-22a2ba80-c962-11eb-8d7c-81cec68306e6.mp4

nitroman123 avatar Jun 09 '21 17:06 nitroman123

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

magenta404 avatar Jun 09 '21 18:06 magenta404

the result is amazing !!! really

nitroman123 avatar Jun 09 '21 18:06 nitroman123

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 avatar Jun 09 '21 18:06 nitroman123

@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

nitroman123 avatar Jun 13 '21 06:06 nitroman123

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.

huwb avatar Jun 13 '21 07:06 huwb

@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 avatar Jun 13 '21 08:06 nitroman123

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 ?

nitroman123 avatar Jun 28 '21 19:06 nitroman123

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

magenta404 avatar Jun 28 '21 21:06 magenta404

@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 avatar Jul 01 '21 18:07 nitroman123

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

nitroman123 avatar Jul 02 '21 08:07 nitroman123

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

magenta404 avatar Jul 07 '21 19:07 magenta404

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 avatar Jul 07 '21 20:07 nitroman123

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

nitroman123 avatar Jul 07 '21 21:07 nitroman123

The video is private and I cannot view it.

magenta404 avatar Jul 07 '21 22:07 magenta404

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

nitroman123 avatar Jul 08 '21 06:07 nitroman123

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

huwb avatar Jul 10 '21 09:07 huwb

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.

magenta404 avatar Jul 10 '21 09:07 magenta404

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

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

magenta404 avatar Jul 10 '21 10:07 magenta404

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.

nitroman123 avatar Jul 10 '21 11:07 nitroman123

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.

magenta404 avatar Jul 25 '21 21:07 magenta404

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

magenta404 avatar Jan 30 '22 18:01 magenta404