[Community Project] WIP Weather & Water Shader

Ahh, that’s too bad. Sorry for the troubles, I must have left part of it out…

I’ll post tomorrow morning with an update after I test it out :slight_smile:

No problem mate. It’ll probably turn out to be my fault somewhere along the line anyway, I’m sure :slight_smile:

Nah, pretty good I forgot to hook it back up, made lots of changes.

Hey btw since you have been using the new system, have you had any issues with the caledar/moon/sun at all? Even just minor annoyances if there aren’t any major problem you’ve run into so far. Any feedback on what you like or would like to see improved would be valuable to me.

I’ve discovered a couple bugs that only happen in a very specific case, which have now been fixed internally.

Also I would really like to hear what you are wanting as features for a weather system. Currently I plan to incorporate seasons exposed in a material parameter collection that can then be applied to foliage for example, which can be used to drive the colour of leaves/grass and more.

I have a lot of ideas, just not sure how far I should go. Couple things I plan to add include temperature, climate type, storms & wind that (partially) affect the using the Beaufort scale, and many more ideas.

Basically I want to know which features you want the most so I can work on them first, goes for anyone reading , please let me know!

Thanks guys!

SO glad you asked :slight_smile: Well…about anything would be nice, as I will need plenty weather stuff more down the road and way I can save some time and focus on improving other aspects of my project a little more.

Rain - Please…I never got that one working…I see the particles in the editor but rain never appears…also it seems a bit heavy (resource wise) a blendable (sliders) weather system would be great, and rain that is realistic is really important for me. (No rain indoors, but can see the rain that is outdoors through a opening such as a window or entrance) It’s been on my plans for a long time but I have been too busy doing other stuff unrelated to weather.

Storms and Wind - Yes please, I also don’t like the lightning effect we currently have, it seems like everything on screen turns blue instead of just the sky…way too bright or something. Didn’t got the time to look into it.

Seasons - Would be cool yes but for me personally I probably won’t be able to use them logistically :frowning: I might give it a go but probably won’t happen.

Fog - fog/haze effect, blendable with a slider.

As for the Beaufort scale - I think we all want that, by the way…since you are working on moon phases internally, do they affect the beaufort scale as well?

The most important thing to bear in mind for me is that the weather conditions are blendable and can be overriden by code, meaning…my C++ or BP can control “ok…now much rain!, now much of storm” I would have to change the code if they are full automatic with no option to disable.

No issues here, even went as far as using the moon and sun and time + timezone to rough guess where you are in the world and seems as accurate as I need, up until the 60’s early navigation systems that didnt use a sextant. when I create a sextant, then the accuracy will come into play… and I’ll need to make real stars o_O

Looking into it.

I’ve had alot of success with my own particle systems and SuperGenious’ WeatherFX pack. If you plan on releasing anything in the next year or two i wouldnt hold my breath on the project (nto saying it wont get there, just cant put your eggs in internet baskets)

That’s a really good point, would make it easier to migrate all of the content. I had considered adding the content to the plugin itself (it is a content enabled plugin), but decided not to because most people would want to modify the base blueprints rather than create a new one that had BP_Ocean as it’s parent class. Not positive how content plugins handle changes to the assets it contains, whether it will save it into the plugin, or save it as a separate file. Will look into that some more too, at least for the content, wouldn’t put all of it in there of course.

Thanks for the suggestion!

One of te few things that I dislike during large upgrades, ive stucek to the original folder structure to save manhours.

Sorry I’ve been ill so haven’t been on my computer. Any update on the I was having with the darkness and time of day stuff?

As for any calendar issues, well I’ll look into it. I did change the default month/day as I seem to remember it behaving strangely but I can’t remember why at the moment. I think the moon was almost fully up when the sun was just going down and it made things look odd? I dunno, I’ll have to check it out again.

As for future features, that all sounds great! My big thing I’d like to see would be a full weather system, with definable values to calculate chances of certain weather from appearing, and then a sub value to randomise how ‘bad’ the weather is when it does come.
So for example:
Rain: 33 (0 - 100 percentage )
Severity range: 1 - 75 (1 - 100, higher the value more severe the weather. will randomly pick between 1 - 75 when the ‘Rain’ weather starts. You could even say that over 75 severity it comes with a proper thunderstorm and wind etc)

You could do that for all weather types to allow us to customise which weather patterns we see, how often to look to change the weather pattern (if at all) etc
would make a great addition to the project and could be used as a basis for your seasonal approach too (having these values I mention for each weather pattern, but definable by ‘season’ or ‘month’ or even by ‘day’ for the really picky ones?

I love the idea of leaves, grass etc changing with the seasons. Though I think winter might be tricky due to the snow that would appear on surfaces and terrain etc? I of course have used custom materials that have snow as a displacement but to do on the fly, well I have no idea if it’s even possible. Anyway, weather stuff would be a great place to start and something similar to what I wrote above would give us a lot of control over the weather without being too difficult to set up.

Cheers,

P.S - Random addition but you guys are very knowledgeable and I don’t seem to get answered anymore on AnswerHub. If anyone can help me with the following question about Imported Tiles (levels) in world composition tools, I’d be very grateful. It;s stopping me from working on my game and I’m really peeved about it!
questions/439571/world-composition-half-of-my-tiled-levels-are-not.html
Thanks!

@dazuk1978

I too haven’t been feeling well either and was unable to work in UE4 for a couple of days, so apologies for the delay…

I’ll reply to in more depth later on, but I think I know what is causing the Skylight. I switched the time interval from minutes to hours, meaning if you enter 10 into the SkylightCaptureInterval variable, it’s only going to update once every 10 hours. With both UseSkylight & UpdateSkylight set to true, try entering in 0.08 (5 minutes) and see if that fixes it.

If not, please open up the UpdateAtmosphere function in BP_Sky and make sure it looks like (I may have changed it post release, but does work):

The next update will be using custom logic to blend between multiple pre-captured skylight cubemaps, eliminating (and it’s performance hit). I upped the time speed to 500 to test it, there is noticeable hitching when it gets re-captured, so much that Physics simulation doesn’t run properly. If you look at the ships sails you will see they ‘reset’ every time a capture occurs.

The blending is for more than just the skylight, it will include everything from light intensity, to post processes, cloud color and much more. It’s based off the system in the Kite Demo from Epic, and seems to be working well already. Just need to integrate the skylight part, which I plan on doing today.

I’ll get back to you on the rest shortly, thanks! :slight_smile:

That sounds good, look forward to your full reply.
I have a question though. Does the update interval scale with the time scale multiplier? I set that to 2000 for testing, and the 0.08 you’ve suggested doesn’t work. Could that be because the two aren’t linked, like time scale multiplier is using real world time or something?

Cheers

EDIT: @ My Update Atmosphere had an extra bit on the top left but ultimately the Use Skylight was not connected to the ‘AND’. Once I did that, I could indeed get the update working as intended. As you say thugh there is a noticeable hit on performance so it will be GREAT to get your update with the blends and no performance hit :slight_smile:
as always

So far I’ve got everything working great in our game using plugin, but only recently during an optimization pass on our textures/meshes did I come to realize that the terrain heightmap being used to control the height of the waves near shore is way too big.

The steps I’ve taken to incorporate our heightmap is to select the landscape, export the heightmap and import it into the content browser, then apply it to the appropriate slot in the actor settings. However, the size of the exported/imported heightmap is 4081x4081, and takes up around 65mb of texture memory, so it’s by far the most expensive texture asset in our game and takes up a large portion of our texture budget. It’s set to not have any MIP maps by default when used with the plugin, so I can’t make use of the LOD bias to reduce the texture memory load. So based on that, I just tried to manually drop the texture size in photoshop down to 2048x2048 and reimported that into the editor, but upon saving and then reopening the editor the waves no longer get reduced based on the heightmap, so basically the terrain heightmap isn’t working anymore with the lower resolution texture.

Tried just about everything I can think of to get texture memory size reduced to something more appropriate but so far I haven’t had any luck.

Is there anything that can be done to solve ? Does the terrain heightmap texture need to be very specific depending on the terrain size? It doesn’t seem like it would really need to be all that high resolution to get the results I require as my shoreline is pretty smooth and isn’t highly detailed. Any help would be greatly appreciated as heightmap texture is really hogging a lot of the texture memory budget for our game lol :stuck_out_tongue:

Thanks! Keep up the great work, project keeps looking better and better every time I come back to see the progress :slight_smile:

You can use a lower res texture but you will have to do some changes so that you can pass the original landscape size manually via parameter… currently if you plug a low res texture then it will assume your landscape is smaller and therefore will not match the actual landscape in the game.
Open BP_Ocean and check out the Set Global Parameters function, the heightmap size x,y is taken directly from the texture via GetSizeX, GetSizeY… you can switch that to a variable which then you can manually set.
You will also have to do a similar change in the OceanManager.cpp thought so that buoyancy is synced :stuck_out_tongue:

Fantastic work guys, thanks for that! :slight_smile:

As far as I can tell from my first experiments the plane simulates the earth’s curvature, is that right? And if so, could someone guide me to the proper blueprint so I could take a look how it’s implemented? Thanks :slight_smile:

So that seems to have worked, in that I am seeing the wave size is being controlled now by a 1024 texture while manually setting the landscape size of 4081x4081 in the function within BP_Ocean. However now causes my game to crash when trying to simulate in the editor :frowning: The crash seems to have something to do with linear color? I’ve tried to look into crash but can’t figure out what could possibly be causing , any ideas?
**
EDIT** - Looks like I spoke too soon! For some reason upon importing the texture, the compression settings were not applied to the new lower resolution texture which was causing the crash. Just went in and manually changed the texture compression settings to match the settings that was automatically applied to the previous high resolution heightmap.

Hi there,

First off thanks for making , it looks incredible. Unfortunately I’m having trouble getting it to look exactly like some of the example maps, in my own map.

The is the area around the beach, I noticed in the example maps that you have it working where the waves die down and you get foam along the shoreline.

Right now in my project the water just continues to wave right through the landscape.


How would I fix ? and is it possible to do it without a height map? I just built the landscape in UE4 and don’t have a height map to import.

Thanks!

is awezome. Tried it with TrueSky and its great for me that enjoys storms and lightning. Now I can simulate my own storms, when its not a real storm outside :slight_smile:

When you select the ocean_bp in the details panal you can select to use your landscape. Did you do that?

I did do that before I posted here but it didn’t seem to have any effect :confused: Any other ideas?

There is a Heightmap/mask right under the landscape on the BP_Ocean. If you load the Default map and change that Heightmap your are going to see what you are talking about, i guess it controls the density/movement of the waves based on black, normal wave movement to white, no movement at all.

i didnt read part:

try to export it as a png file from the landscape menu, here is the answerhub question related to it.

questions/11999/export-landscape-heightmap.html

Hope it helps

Okay, I’ve done before but for the life of me, I can’t remember how, and I’ve read about 20 pages of the thread… how do I disable/modify the crosshair in the HUD when it switches to first person?