So what was the bug? Was it something in my code?
Nope not at all, your code works amazingly well! Hardly any measurable impact on performance for a single object. I thought calling GetWaveHeight and recreating each wave cluster for each test point on Tick would be more taxing, but it works great even with multiple actors!
Ah yes, so about that bugā¦ Well it ended up being something I totally overlooked. The default value of a variable was reset to 0 within a migrated blueprint, which shouldnāt happen, it was within the blueprint itself not in the scene. Migrating between projects has turned up a couple of issues in the past as well, should have expected itā¦ The value controlled how often to update the Skylight capture, which is very costly performance wise. Instead of updating every 10 minutes it was updating every Tick, causing a CPU stall every other frame preventing the BuoyancyComponent/OceanManager from executing.
Yes it was a bit of a stupid mistake on my part (just a little), but good news is I now know how to use the profiler properly! So something good resulted from my utter failure.
Big thanks for everything though, it is working great! In the process of putting together a drivable boat right now, itās a lot of fun!
Great, good you found it. btw the demo video looks great.
Now lets see if all work is invalidated by what the engine guys are showing in the twitch stream.
So some interesting stuff was shown in the twitch stream (although nothing mind blowing tbh :p), I can easily see a combination of all that foam/normal panning stuff + the current gerstner wave displacement to make it look more alive.
In regards to displacement however, the ideal and āfinalā solution will probably be WaveWorks (or some equivalent FFT implementation anyway) with some gerstner waves blending for the shallow areas perhaps (really wish I could get buoyancy working with WaveWorks to test that out :rolleyes: I will try to ask again about that boat demo).
Has anyone checked the 4.8 branch by any ? it is said to have improved specular highlights/reflections on translucent materials :eek: about frickin time I guess
Yes exactly, Tessendorfās technique is what WaveWorks uses, combination of Gerstner waves and FFT. It is a stretch goal, but one I plan to figure out and implement some time in the future.
But to be clear, absolutely no time-frame, no guarantee, might not happen, weāll have to see, etc.
Here is the Tessendorf paper outlining how it works: http://graphics.ucsd.edu/courses/rendering/2005/jdewall/tessendorf.pdf
AC: Black Flag (and AC 3) used the same technique as well with some stunning results, using it as a reference for techniques as well: Assassinās Creed III: The tech behind (or beneath) the action ā fxguide
Adding in a height field with noise is a simple solution for now, it adds a lot of choppiness to the waves. The waves shown on the twitch stream today are very close to the ones shown in the GDC 2014 demo available for download in the Learn tab of the launcher. I have been taking pieces of it apart and adding them to the material with some success, I just didnāt include it in the dl from the other day since it is still WIP. It does add a lot of dimension to the waves, and will be included at some point.
Yeah I noticed that as well, planning to go through it all later today or tomorrow. The one (only) image Iāve seen so far is promising, it looks much better than it currently does. Here is the image:
https://.unrealengine.com/showthread.php?32543-What-Are-You-Working-On-Community-Screenshots-amp-Videos&p=207538&viewfull=1#post207538
Hey ,
Amazing work! My project team has been using your buoyancy + and it looks amazing. We are anxiously awaiting the release of an underwater FX version, since the game we our creating will be featured mostly underwater. We were wondering if you have messed around with light shining through your water material. We are trying to get a realistic water effect and light beams that shine through, have any advice? Also do you have an ETA on your release for underwater FX? Would like to know if you plan to release it before March. Thanks for great project and keep on trucking :)!
Oh yes it will certainly be before then! Iām just working on polishing up a few aspects, I donāt want to give a hard date since it always seems to take me a couple extra days, but very soon!
The light shining through is going to have to be faked right now using a Godray mesh/material, I have one set up and it works fairly well. I am trying to figure out the best solution to spawning these in game though, having them there all the time is just not going to work performance wise. It could be done in a blueprint, but it seems a bit overkill. One idea is to make them into particles that spawn inside a radius around the player when they enter the water. That should be doable, keep their lifetime up high enough and sort of fade in and out. I can easily output a parameter from the particle system that takes in the suns position so they are angled properly. Then we need the caustic on the floor as well, I have the material for that done, just need to work out a system of applying it as a light function only while underwater.
Iām trying to consolidate all of these ideas, so I decided to set up a Trello board. There are a few things missing, itās not quite done, but if you guys want to vote which features you want feel free! I will try and keep it up to date and add in more notes/cards as new ideas come in.
So, Trello board for project can be found here:
If you have a you want included but is not yet listed, please post your idea here and I will add it in.
Thanks guys!
Focus is obviously on the , but some suggestions:
- Lunar / Moon cycles (material based moon crescents, etc.)
- Tidal shifts / changes (changing water plane height offset based on time of day / lunar cycles)
- Wind variation (fuzzy directional/strength wind which changes cloud / rain / snow direction (and perhaps spray, too)).
I might have a go at helping out with some of the above. I had a pretty decent random wind direction/speed setup in an older project.
As for the underwater god rays, I would say particles is the best approach. Itās only really something youāll see when looking up and near the surface, so spawning particles when needed wonāt be too difficult.
Really loving whole project. Hopefully the community can pull together and create the best video game water/environmental system possible!
Trello board man Iām especially excited about the interaction stuff (fluid surface plugin style!) but I guess thatās going to take some time
Personally I have been trying to implement a subsurface scattering effect and depth-based color (as shown in that AC III article) but I havenāt gotten the results Iām looking for yet :rolleyes:
Here is what I have got so far (huge image warning!):
Unfortunately it looks a lot worse in motion though
Here is the mat. function if you are interestedā¦
http://i.imgur.com/9WMfKrql.jpg
Thatās getting pretty close! Wouldnāt the effect be less obvious in the waves but more obvious towards the shore?
Wow, very nice!
How can I test in my own project? I tried to migrate to another project ( folder ā> Migrate) but when I try to open BP_Ocean blueprint after migration I get following message:
"The following member variables in blueprint āBlueprint /Game//BP_Ocean.BP_Oceanā have invalid type. Would you like to remove them?
Wave Set 1Parameters
Wave Set 2Parameters"
and
āBlueprint could not be loaded because it derives from an invalid class. Check to make sure the parent class for blueprint hasnāt been removed!ā.
Well you are getting pretty darn close! That looks excellent TK! With the HF noise displacement (choppy waves on the surface) Iām adding in right now, these two should look when used together
That is looking really cool, great work man! Weāll have to merge these together sometime. Do you use at all? I was thinking of using it so itās easy to organize it all. Anyways for now itās fine how it is, but something I might get to work on soon.
That would be if you are able to help!! Itās been a fun project so far, but I would love to have contributions!
Those are great suggestion! I will add them to Trello momentarily.
Speaking of contributions, a good friend of mine āā has graciously provided a swimming animation and a treading water idle animation I will be retargeting onto the blue guy, so we will be able to swim!
So a big thank you to for doing that, he will also be added to the contributors list! Itās still a small list, but I am thrilled to see it is growing! Thanks guys!
Iām sorry to say that migrating the out is waaay to difficult at the momentā¦ Sorry about , I am currently looking into how difficult it would be to package it up as a plugin. Currently you have to do a lost of copying/pasting code, generating the code, etc.
If you are using blueprints there is no simple way to do , I hope to have fixed ASAP! I just need to read up on the documentation, and if it is fairly easy to do, I could have it done within a week or two. Sorry for the inconvenience.
Sounds good and no rush. is something so nice I can wait Too bad Iām not skilled enough (at least not yet) to contribute and help with matter.
Does anybody here have a file with the C++ code for the buoyancy? I was trying to implement it into my , but I donāt have an OceanManager blueprint like the one in 's, with the code. Thanks.
I have it all working in my project available for anyone to download and use in their games. has even gone so far as to provide some of the code needed for buoyancy, as well as the material displacement.
In order to get working in your project, look through the project and see which features you have and which you donāt have yet. The code itself will not work in another project by just copy/paste, it needs to be modified to your projects API.
I will be packaging the code as a plugin in a future release, but as of right now, it is very difficult to get working. Hereās the download, all files are there.
Here is the Preview of version 2 - With Working Buoyancy
<Link Removed - Now on GitHub>
GitHub Link -
BTW Iām not sure if anybody modified the height method to fix or that anyone even noticed but the height value returned for position (x,y) is not actually the height for the calculated point at (x,y). The full gerstner equation is not what is being solved in my code.
The actual height value at a point is returning a height but also a x and y displacement. So using the height directly at x and y is inaccurate. I was eventually planning on fixing to return true height of wave at x,y instead of the 3d displacement of point x,y. The difference is not that big but if you use large waves with a high steepness on a small object, you will see that object is floating in front of the crests. is not really an for for boats as that are many wavelengths in size usually.
A quick solution is to modulate the height value by how much it is displaced in the x,y plane giving you a tighter fit to the actual wave otherwise the true solution requires you to solve a parametric equation for each wave.
Has anyone seen ? watch?v=rnGi2rtnmVY
He shares his code, looks really nice! would be great if it can get implemented with project
Hello guys, Iāve been trying to tackle 's bouyancy Tutorial for a while and glad that you guys made a community thread about (Been stuck on the C++ forever to get the buoyancy working). I will be trying to add to your project with my own progress of adding patrolling boats that use an AI behavior tree. I already have flying AI down and would like to see if I can simulate the same effect on your Gerstner waves. If you need to reach me, please check out my YouTube Channel or message me. I would also like to ask for permission to use your community project in my video updates and of course I would provide a link to give you guys credit. Iām not much of a tutorial person, but I do provide quick rundowns of my blueprints so it can give people an idea of how I created my progress.