Announcement

Collapse
No announcement yet.

[Community Project] WIP Weather & Ocean Water Shader

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    Originally posted by Rama View Post
    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 James 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.
    I'm already making good progress



    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!

    Leave a comment:


  • replied
    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

    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 everyone throws in what they got working when they do.

    DC, dont forget bitbuckets free private git repos, rama is a much more appealing contributor than myself
    Last edited by Nsomnia; 07-09-2016, 08:49 AM.

    Leave a comment:


  • replied
    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, everyone 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, Rama, consider me all for this notion.
    Last edited by Yoyomike; 07-09-2016, 08:25 AM.

    Leave a comment:


  • replied
    Originally posted by TK-Master View Post
    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 ), but in my opinion it's not worth the time at this point.
    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 James 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://forums.unrealengine.com/show...l=1#post561546


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

    If any of the core folks in this thread dont like me mentioning this 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, [MENTION=1127]TK-Master[/MENTION] ?



    Rama

    PS: Summary: omg I miss fluid surface ripples affected by moving characters from UE3/UE2
    Last edited by Rama; 07-08-2016, 06:11 PM.

    Leave a comment:


  • replied
    Originally posted by Yoyomike View Post
    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 this happens i need to restart windows.)

    But, I've applied the Ocean material to it, using the 'ultra' shader, and i got good results, I'll post results here when I can
    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 ), but in my opinion it's not worth the time at this 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 this:
    Click image for larger version

Name:	EIhBs.png
Views:	1
Size:	61.9 KB
ID:	1111700

    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 this 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 feature in multiplayer (no buoyancy, not accurately synced).
    I'm implementing something like this that will compliment the FFT simulation, I should have something demo-able soon.

    Leave a comment:


  • replied
    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 this happens i need to restart windows.)

    But, I've applied the Ocean material to it, using the 'ultra' shader, and i got good results, I'll post results here when I can

    Leave a comment:


  • replied
    Originally posted by TK-Master View Post
    FFT-based Ocean Simulation WIP!

    So after a lot of headaches and red bulls (sponsor me please? lol) I finally have a working FFT implementation.

    Test #1.

    (Don't pay too much attention on the material look, this is meant to showcase the displacement)

    This is simulating a 128x128 grid on the CPU at about 4ms on a separate thread.
    The plan is to implement a GPU-CPU combo for maximum performance and quality.
    The CPU will simulate a smaller FFT (up to 128) which will be used for height readback queries only (for buoyancy etc.) and the GPU will be able to simulate a larger grid (up to 2048) with normals, energy-based foam etc. which will be used for rendering.

    The simulation above is using the classic Phillips spectrum from the tessendorf papers which produce nice sharp "choppy" waves and is meant to represent a fully developed open ocean state, but there are other spectrum models out there (which I have partially implemented) that are more "physically correct" and can produce different style of waves.

    There is still a lot of work to be done so don't expect any of this to be released anytime soon, I'm doing this in my free time as you know
    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 this kind of "crisp messy".
    Last edited by Raziєl; 07-07-2016, 10:53 PM.

    Leave a comment:


  • replied
    Originally posted by DotCam View Post
    Hi there,

    We have done a lot of work trying to get that plugin to play nicely with the ocean project, and it is (partly) possible to do. The problem isn't so much performance, but rather hard driver crashes when using it. A small grid is not too expensive to render, but using both the ocean waves and the fluid surface on a large scale is. Here's a video I made to show [MENTION=1127]TK-Master[/MENTION] it was working with this project a while back:



    As you can see the grid is pretty small, anything larger than that and my video drivers would crash both UE4, and Windows too in some cases.

    There is something in the code that doesn't work properly on DX11 (my best guess since it was ported from an older version), triggering a crash after a few minutes of use (with Nvidia drivers at least, I have a 980). I would really appreciate any help, if anyone can find out how to get it working properly I would gladly implement it fully into the project. It is very complex though, requiring C++ and HLSL shader code, which is why it has been backlogged for now. Both the FluidSurface actor and FFT are advanced techniques we are in the process of exploring further.

    Thanks

    EDIT: The error message you are getting just means the plugin code needs to be recompiled for your version of the editor. I wouldn't recommend using the code provided from that thread anyways, there have been major changes to the rendering engine since that project was abandoned. I have a working copy (as of 4.9) in my git repo list, but that too may require further changes to get it working correctly with ver 4.11 or 4.12.
    REALLY glad you're working on the fluid surface actor, absolutely stoked to see this integrated, and I'm sure a lot of other people are, this 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 issue, is there a way to to turn off wave displacement, and just have the blueprint there for changing material params?

    Leave a comment:


  • replied
    Originally posted by TK-Master View Post
    FFT-based Ocean Simulation WIP!

    So after a lot of headaches and red bulls (sponsor me please? lol) I finally have a working FFT implementation.

    Test #1.

    (Don't pay too much attention on the material look, this is meant to showcase the displacement)

    This is simulating a 128x128 grid on the CPU at about 4ms on a separate thread.
    The plan is to implement a GPU-CPU combo for maximum performance and quality.
    The CPU will simulate a smaller FFT (up to 128) which will be used for height readback queries only (for buoyancy etc.) and the GPU will be able to simulate a larger grid (up to 2048) with normals, energy-based foam etc. which will be used for rendering.

    The simulation above is using the classic Phillips spectrum from the tessendorf papers which produce nice sharp "choppy" waves and is meant to represent a fully developed open ocean state, but there are other spectrum models out there (which I have partially implemented) that are more "physically correct" and can produce different style of waves.

    There is still a lot of work to be done so don't expect any of this to be released anytime soon, I'm doing this in my free time as you know
    Oh my!

    Do let me know when this 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

    I'll be waiting to hear more about this!!!



    Rama

    Originally posted by DotCam View Post
    Thanks Rama, let us know if you have any issues and/or suggestions!

    Good to hear from you as always, have fun with it!
    Rock on DotCam!



    Rama

    Leave a comment:


  • replied
    Well going extremes is usually the easiest way to find bugs :P Thank you very much, Santa Claus will be pleased to know. I hope you're feeling better, wish you all the best.
    Last edited by DavidNSilva; 07-05-2016, 01:58 PM.

    Leave a comment:


  • replied
    Originally posted by DavidNSilva View Post
    Hey [MENTION=5439]DotCam[/MENTION] I have been playing a bit with your new skydome, shoudn't the sun at the north pole never set around 21th June? It's pitch black at 20:00 for me...sounds a bit early for a midnight sun. Maybe I did something wrong? I use 90º for the latitude, and 0 for longitude (but longitude shouldn't matter much for the poles). I might very well have done something wrong so please forgive me if so :P
    Thank you for pointing that out! Had not tested that far north/south.

    The reason that is happening is I fade out the sun once it "should" be below the horizon (when it's hour angle is less or greater than 110 degrees) and create a variable named Sun Height that get's passed to the material, reduces sun brightness, increases moon brightness, and fades in the stars.

    Obviously (it's obvious to me now at least ) that isn't going to work properly, and not just at the poles, it's not adjusting the value by latitude at all. I actually just created a new function to get the exact sun rise/set times which is needed for the skylight & TOD settings blend, should work well for this issue too. I'll try switching it over to the new function soon, but for now I'll see if multiplying the value based on latitude (0-1 scale) is feasible. Might be a quick fix, will let you know asap.

    Leave a comment:


  • replied
    Hey [MENTION=5439]DotCam[/MENTION] I have been playing a bit with your new skydome, shouldn't the sun at the north pole never set around 21th June? It's pitch black at 20:00 for me...sounds a bit early for a midnight sun. Maybe I did something wrong? I used 90º for the latitude, and 0 for longitude (but longitude shouldn't matter much for the poles). I might very well have done something wrong so please forgive me if so :P
    Last edited by DavidNSilva; 07-05-2016, 01:09 PM.

    Leave a comment:


  • replied
    Originally posted by Rama View Post
    [MENTION=5439]DotCam[/MENTION] [MENTION=1127]TK-Master[/MENTION]

    Wow! This offering of yours is tremendous! Thank you thank you!

    I am sorry I am only just noticing this thread for the first time

    I tried it out and I especially loved the breaking up of waves along the shoreline, your landscape feature. The buoyancy and Gerstner waves are great, tho personally I think of them as DotCamWaves

    This is one awesome community contribution, thank youuuu!



    Rama
    Thanks Rama, let us know if you have any issues and/or suggestions!

    Good to hear from you as always, have fun with it!

    Leave a comment:


  • replied
    Originally posted by TK-Master View Post
    FFT-based Ocean Simulation WIP!

    So after a lot of headaches and red bulls (sponsor me please? lol) I finally have a working FFT implementation.

    Test #1.

    (Don't pay too much attention on the material look, this is meant to showcase the displacement)

    This is simulating a 128x128 grid on the CPU at about 4ms on a separate thread.
    The plan is to implement a GPU-CPU combo for maximum performance and quality.
    The CPU will simulate a smaller FFT (up to 128) which will be used for height readback queries only (for buoyancy etc.) and the GPU will be able to simulate a larger grid (up to 2048) with normals, energy-based foam etc. which will be used for rendering.

    The simulation above is using the classic Phillips spectrum from the tessendorf papers which produce nice sharp "choppy" waves and is meant to represent a fully developed open ocean state, but there are other spectrum models out there (which I have partially implemented) that are more "physically correct" and can produce different style of waves.

    There is still a lot of work to be done so don't expect any of this to be released anytime soon, I'm doing this in my free time as you know
    Its obviously amazing work, but I miss the foamy water on the top where the waves crush, you know what I mean :P?

    Edit: Ignore my post. I made the mistake by not reading the text just watching the video x_X. You are working on it and its great! <3
    Last edited by Jenyer Jiyoon; 07-04-2016, 04:46 PM.

    Leave a comment:


  • replied
    Thanks a lot, DotCam.
    It seems PhysX supports IOS, and we tried cutting off Apex features, repackage, this time it worked except for some material node errors during cook time.
    Theoretically, if we ues animation or material system to simulate apex features and rewrite some unsopported material nodes, we can port the project to IOS. Am I right? Any suggest about that ?

    Leave a comment:

Working...
X