[Community Project] WIP Weather & Water Shader

Well going extremes is usually the easiest way to find bugs :stuck_out_tongue: Thank you very much, Santa Claus will be pleased to know. I hope youā€™re feeling better, wish you all the best.

Oh my!

Do let me know when does get released, but of course please proceed at the pace that is fun for you!

That CPU read for height info is especially important for my intended use cases :slight_smile:

Iā€™ll be waiting to hear more about !!!

:heart:

Rama

Rock on !

:heart:

Rama

REALLY glad youā€™re working on the fluid surface actor, absolutely stoked to see integrated, and Iā€™m sure a lot of other people are, is really the only thing standing between us and Crynengine, and EPIC knows it.

IF thereā€™s a way you can find to stop the hard driver from crashing ( I tried integrating it myself and ran into that, is there a way to to turn off wave displacement, and just have the blueprint there for changing material params?

Amazing.
The only problem that I find in my tries with FFT is: ā€œThe water looks like it is not going anywhereā€.

FFT:

So IĀ“ve changed to 2 combos of 8 gerstner waves + heightmap panners, to create kind of ā€œcrisp messyā€.

Working on a fluid surface integration, but so far, iā€™ve been unsuccessful in getting the fluid surface component to work in the blueprint, without it crashing my GPU (every time happens i need to restart windows.)

But, Iā€™ve applied the material to it, using the ā€˜ultraā€™ shader, and i got good results, Iā€™ll post results here when I can :slight_smile:

I would not recommend using the fluid surface pluginā€¦ unfortunately there are a lot of bugs with it and itā€™s unstable.
Itā€™s development was stopped a long time ago, it may have been updated for later engine versions but it was never ā€œreadyā€ in the first place.
Someone would need to put in a lot of effort to improve it (I have tried, and failed :p), but in my opinion itā€™s not worth the time at point.

I have recently discovered that there are some ridiculously simple algorithms out there for making interactive water surfaces that work surprising well (and fast!).
The cool part is that it can work even with a few lines of code! itā€™s almost like magic.

For example, MullerGDC2008 can be as simple as :
EIhBs.png

The problem with these kind of fluid simulations however is that they are a little too frame-rate dependent so itā€™s nearly impossible (or not easy) to sync them in networked applications.
For example, FFT and gerstner waves can be simulated for any arbitrary time value that will give the exact same result each time, which means you can simulate 86355131 frames ahead if you need to but kind of fluid simulations are very differentā€¦ a simulation at 30fps will be 2 times slower than a simulation at 60fps for example.

But for single player it can work well including buoyancy. Or as a rendering-only in multiplayer (no buoyancy, not accurately synced).
Iā€™m implementing something like that will compliment the FFT simulation, I should have something demo-able soon.

I agree the current implementation is not going anywhere, but I am proposing that we all as a community Start Over from the UE2 code provided by Golding.

Essentially that plugin got taken up by 1 person and went down 1 route, I feel like we should start over truly from scratch rather than trying to patch up what is currently around.

Fluid Surface Plugin ~ Starting Over
https://.unrealengine.com/showthread.php?3609-Project-FluidSurface-Plugin&p=561546&viewfull=1#post561546

Please note I have great respect for thread and what is happening here, and I am hoping that a recapitulation of that plugin could be helped out by all you folks here in thread, as a compatible game element to what you are doing.

If any of the core folks in thread dont like me mentioning here let me know and I will remove it, but I am hoping we can resuscitate the poor Fluid Surface Plugin

or

Completely re-implement what it does in our own way, @ ?

:slight_smile:

Rama

PS: Summary: omg I miss fluid surface ripples affected by moving characters from UE3/UE2

I for one donā€™t give a ratā€™s (youknowwhat) about FFT, granted, itā€™s great, looks nice, and all the more realistic, weā€™re getting no closer to water that interacts with the world around it.

I for one wouldnā€™t mind a water surface which interacted with the actors movements, the rocks it crashes up against, and the particles that hit it (rain and snow, hail and etc).

Rather than a beautiful water shader that has no immersive effect what so ever, apart from being nice to look at.

I wish weā€™d all have the same beautiful vision for the Engine, fluid surfaces that make the player feel attached to the world theyā€™re playing in, as opposed to static scenes that feel like a painting more than anything else. But to each their own, is entitled to their own dreams, it is really sad to me that fluid surface is just a dream that most of us donā€™t share, to my knowledge.

With all that said, If I knew anything about coding, Iā€™d jump right in and start fluid surface from the beginning, but I donā€™t, and Iā€™d probably make it worse. Truth is, itā€™s PERFECTLY fine aside from the fact you canā€™t integrate it into blueprints, and you canā€™t put it inside a landscape / or another static mesh.

But in any way I can help at all, consider me all for notion.

I find contrary to regular game development water needs performance before mechanics. How many fps do you get with 120 gertner sums. Guess it depends of you need weather or gently lapping. Good to see Rama slowly unrealā€™ing himself to death in one more thing :slight_smile:

Triton has rotor/propr wash, wakes, object-water interaction, etc. and is used in some military simsā€¦ pretty sure they started right with FFTs due to the massive speed of waveform calculations. That said a waveform is a waveform no matter how its generatedā€¦ to a degree.

Edit: on their website they quote ā€œOver 65,000 individual waves at over 500 frames per secondā€ thats alot of [performance] room you have to throw extra features on top. Although they use the gpu for a lot more computational speed its possible to do if throws in what they got working when they do.
, dont forget bitbuckets free private git repos, rama is a much more appealing contributor than myself :wink:

Iā€™m already making good progress :wink:

u79E1DKlEeQ

It currently runs on the CPU, the performance is not that great with grids > 256x256 as you can expect but itā€™s totally acceptable at lower resolution grids (itā€™s also possible to multi-thread it, so it should be even better).
The video showcases 2 different propagation algorithms that I found. The waves can reflect from walls or custom obstacles btw!

Omg!

Wohooo! Thank youuuuu @!

So ahm

hee hee

I um, well, any sense of when I can play with ?

Will it be something that is part of the entire project or a separate plugin?

If you ever wanted to consider it as a paid plugin I know many would buy it :slight_smile:

You could also present to Epic as a PR, a replacement for the fluid surface plugin initiative, something Golding really wanted in the Engine

If youā€™d like any coding involvement on my part just let me know!

:heart:

Rama

Is that the fluid surface actor you seemed so bleak about yesterday :O?

What are the chances of getting to work in an HTML5 project? I tried to cook it but it choked on the plugin.

Hello I try to make landscape modulation work I selected landscape and heightmap I exported from landscape in details, but it makes no difference as you can see:

Here is the heightmap, shore is actually quite flat, but i think it should still work.

Iā€™m having trouble getting the same underwater thatā€™s in dcSkyTestMap and UnderwaterFish in 4.12.5. I created a new project, copied the Plugins folder into project folder and , ShipsAndExamples, and Sky folders into the Content folder, created a new empty level, dragged the BP_Ocean, BP_Underwater, and BP_Sky blueprints into the scene then deleted them. Then I copied BP_Ocean, BP_Sky, BP_Underwater, PP_Global and WaterSwimVolume from dcSkyTestMap and into my level but they didnā€™t all copy until I migrated the map into my project. Then they copied but there are no underwater .

I also tried as directed in the instructions using the OceanExampleMap_01 but I think theyā€™re a little outdated. I couldnā€™t find everything in the example map that I was supposed to copy, and it looks like the lights and heightfog are no longer needed in the new sky bp. Iā€™ve tried other combinations as well to no avail. The only way I could get it to work was to rename the files and contents in source of to my project name, generate VS files and compile it that way. gave me all of the I was looking for but every time I tried to add a new class, the editor crashed.

Also, when I plug in latitude and longitude for Kennedy Space Center (28.58N, 80.65W), the sun and moon both show up at 10. And if I check the Allow Daylight Savings box and hit play, the sun immediately goes down.

And finally, I tried switching to a first person pawn and when I hit play, the sky gets darker. Changing the sunā€™s brightness had no effect. But whatā€™s really weird is if I walk (speed of 600), it stays that way, but if I run (shift+w and speed at 1000), it brightens up until I stop and then gets dark again.

Not sure what Iā€™m missing or doing wrongā€¦ any ideas?

The issues with underwater will be caused by not having a Post Process actor in the scene with the Blendables PP material in the Misc section (and make sure the PP volume is ā€œUnBoundā€), check the implementation of the PP_Global actor in the demo level. Also make sure you migrate everything in the Sky & folder, along with the ShipsAndExamples\CustomThirdPerson\Blueprints folder at a minimum if you want both the and skydome.

The brightening will also be caused by the PostProcess volume, expand the Settings, then the Auto Exposure section, and set both the Min & Brightness values to 1. disables the brightening effect when looking at bright then darker areas and vice versa.

For the moon, believe it or not, the moon is quite often visible in the daytime (how else could you get a solar eclipse mid day?). We donā€™t notice it as much because it blends into the atmosphere, it doesnā€™t stand out like it does at night, but it is there. You can check the values against website, MoonCalc.org, or any others such as the US Navyā€™s site. Just enter in your long/lat date/time, then compare the Azimuth (yaw) and AltitudeAngle (pitch) values. Please note that the end Rotator pitch/yaw/roll will not be the same as Azimuth & AltitudeAngle, they need to be rotated into UE4 coordinates causing a discrepancy. Be sure to adjust the time/date in the Default section, the moon and sun positions vary from one day to the next, most days the moon stays below the horizon during the day, but not all.

One last thing to keep in mind, the Offset UTC variable needs to be accurate for your longitude location. As an example I live in Vancouver Canada, which is roughly -130 longitude, and a UTC hour offset of -8. The east coast is -5 hours UTC, make sure you have that set properly. I am not sure what might be causing the with Daylight Savings time but I will look into it further.

I will update the documentation asap with the migrating instructions, and get back to you on the other info asap.


@Mordraug:
Please take a look at answer from TK a little while back, the texture needs to be a certain size to work properly:
https://.unrealengine.com/showthread.php?42092-Community-Project-WIP-Weather-ampā€“Water-Shader&p=553893&viewfull=1#post553893


@dazuk1978 / @jSlavens / @ppouloup

I am sorry for not replying to your PMā€™s yet, I have not been doing very well for the last couple weeks, I will try and get back to you asap


@

Same as above, havenā€™t been around much lately, but Iā€™ll try again tomorrow :frowning: Your fluid surface actor looks great! Itā€™s probably a lot of fun to play with too hey? Nice work man! :wink:

Thanks for the quick response! Sorry to hear youā€™re not doing well. Iā€™ll give all these things a whirl.

I do know that the sun and moon are often both above the horizonā€¦ I guess it just looked odd being so prominent, maybe too close. I didnā€™t really dig into it that much because I was having these other issues but Iā€™ll take a look at it again when have a .

Thanks again.

Edit:

Hey , I havenā€™t had a to look at the other stuff yet, but I had migrated all of those folders over and copied the PP_Global actor over from the demo project already and verified they all had the same settings between our two projects, several times before I reached out, and everything looked okay, but I just checked again under the Blendables section in PP_Global to make sure and there is 1 element pointing to /Game//Materials/M_Underwater_PP_Inst and itā€™s set to 1, priority of 0.0, Blend radius of 100 (greyed out), Blend weight of 1.0, enabled and Unbound. Itā€™s all of the same settings in the dcSkyTest map of . I have both M_Underwater_PP_Inst and M_Underwater_PP in my project and I donā€™t see anything unusual jumping out at me in those. I believe it can be reproduced.

Any other ideas?

I saw that post, but heightmap I use for is exactly the same heightmap I use for landscape so it should be ok. Right?

The oceanBP doesn;t work when i migrate my assets to an other project!

Sorry but when i migrate it to my project but the underwater wavy effect is not working,any solutions