User Tag List

Page 1 of 2 12 LastLast
Results 1 to 40 of 75

Thread: Dynamic physical ocean

  1. #1
    0
    Samaritan
    Join Date
    May 2014
    Posts
    107

    Dynamic physical ocean

    I wanted my objects to float. This water is updating object using a heightmap lookup.



    Added tutorial in the wiki
    https://wiki.unrealengine.com/Render_Target_Lookup

    Updates: You can still follow the wiki but I've updated my project to used a mathematical approach.

    Name:  thumbnail.png
Views: 8416
Size:  247.8 KB

    Buoyancy tutorial: https://www.youtube.com/watch?v=kkxJeyG2whw
    Gerstner Waves: https://www.youtube.com/watch?v=PBWLfpm0K0o
    Last edited by Handkor; 08-13-2014 at 01:25 AM.

  2. #2
    0
    Looks pretty good, I'd be interested to see the code/blueprints (whatever you used) on how you did this, I've been looking for something slightly similar but without the ocean e.g: imagine a floating object say a flying car that when flying over uneven terrain will wobble / move with the terrains height map due to the way the air pressure underneath it is working.

  3. #3
    0
    Samaritan
    Join Date
    May 2014
    Posts
    107
    I will be putting up a tutorial soon.

  4. #4
    0
    This is really cool. I liked watching the boxes float up from resting on the floor when the wave come.

    Looking forward to seeing your tutorial for this!

  5. #5
    0
    Luminary


    Join Date
    Mar 2014
    Posts
    1,653
    Looks great!

  6. #6

  7. #7
    0
    Really nice. Well done!

  8. #8
    0
    Samaritan
    Join Date
    May 2014
    Posts
    107
    Tutorial link added to the OP.

  9. #9
    0
    Looks cool, I like your ocean and physics!

    I'm using the same approach for ships physics, but with reading from Texture2D, not RenderTarget2D.


    Btw, how do you simulate buoyancy? Are you using crossed tension dots, or splitting mesh into volumes?
    Last edited by ufna; 05-30-2014 at 12:09 AM.
    Developer. Bass player. Cats owner. Unreal Engine addicted. Check my.alyamkin.com
    [Plugin] VaRest - REST API with blueprintable JSON plugin
    [Plugin] VaTexAltas - simple way to use texture atlases for UMG

  10. #10
    0
    Samaritan
    Join Date
    May 2014
    Posts
    107
    Nothing sophisticated, I use a very inaccurate approximation by placing points around the hull of the ship. I then apply buoyancy at each point by dividing the mass/displacement evenly across all points. Right now it give decent non-realistic results. I plan on improving the calculation in the future.

    I have not heard of crossed tension dots, what is it?

  11. #11
    0
    Quote Originally Posted by Handkor View Post
    Nothing sophisticated, I use a very inaccurate approximation by placing points around the hull of the ship. I then apply buoyancy at each point by dividing the mass/displacement evenly across all points. Right now it give decent non-realistic results. I plan on improving the calculation in the future.

    I have not heard of crossed tension dots, what is it?
    I mean the same approach - dots around the object. It's common way, but not the best results, because it doesn't count real archimedes force influence. I've used volumetric approach on Unity, and I think I should find time to move the trick to UE4
    Developer. Bass player. Cats owner. Unreal Engine addicted. Check my.alyamkin.com
    [Plugin] VaRest - REST API with blueprintable JSON plugin
    [Plugin] VaTexAltas - simple way to use texture atlases for UMG

  12. #12
    0
    Promoter
    Join Date
    Mar 2014
    Posts
    156
    THIS IS SO COOL!!!!!!!!!! This is exactly the sort of thing I was looking for! you did some really great work on this, I would really love to use this in my game since I am planning to make a island with a ocean that looks realistic, I tried to do in Cryengine 3 SDK but the engine was a bit too complicated for me. I will do my best to follow the wiki.

  13. #13
    0
    This is awesome!

  14. #14
    0
    Infiltrator
    Join Date
    Mar 2014
    Posts
    19
    Looks great!!!!

  15. #15
    0
    Unreal Engine Support
    Join Date
    Apr 2014
    Posts
    636
    Amazing work Handkor!! Can't wait to give the tutorial a shot.

  16. #16
    0
    Amazing work. Looking forward for tutorial
    i5-3570K @ 4.5 Ghz
    ASRock Z77 OC FORMULA
    24 Gb Corsair Vengeance 1600
    2x GTX 970 SLI 1460/7600
    Samsung 840 EVO 256 Gb
    EVGA G2 850W
    LG 34UM95

  17. #17
    0
    Very good work, thank you for going to the trouble of creating such an in-depth tutorial.

    Is there any way to make it so the height map can be affected by actors? Like moving through the water creates ripples, etc.

    I did something similar to this in UDK using a material which read it's normals from a fluid surface actor.

  18. #18
    0
    Unreal Engine Support
    Join Date
    Apr 2014
    Posts
    140
    Great job! I'm looking forward to the tutorial.

  19. #19
    0
    Samaritan
    Join Date
    May 2014
    Posts
    107
    Quote Originally Posted by CharlestonS View Post
    Very good work, thank you for going to the trouble of creating such an in-depth tutorial.

    Is there any way to make it so the height map can be affected by actors? Like moving through the water creates ripples, etc.

    I did something similar to this in UDK using a material which read it's normals from a fluid surface actor.
    Yes, create another render target and have your actors render concentric circles or ripples on it at their location. Blend this target over the wave generator and send that to the render target that is read by the code. That is is you want the ripples to also affect height for other actors. If their are esthetic only then blend those ripples to the bumpmap and have them shown in the displacement map only.

  20. #20
    0
    Samaritan
    Join Date
    May 2014
    Posts
    107
    Made the boat drivable


  21. #21
    0
    Very nice!!! Congratulations!!!

  22. #22
    0
    Very nice, now you just need a little splish splash!

  23. #23
    0
    amazing work!!

  24. #24
    0
    Samaritan
    Join Date
    May 2014
    Posts
    107
    Started playing around with adding wakes to the boat and as much as I wanted to stick to a mostly blueprint approach, drawing to a Render Target with a canvas is working pretty well so far.

    Anybody know how to draw a material to a canvas, it would help me skip a step?

  25. #25
    0
    Luminary


    Join Date
    Mar 2014
    Posts
    1,653
    Canvas has a DrawMaterialTile function, that could serve your needs.

    Your overall approach is quite expensive though as you're reading from waves in the texture to drive your gameplay - before getting too involved with what you're currently doing, I would consider changing the technique so that you're writing from the gameplay code to the texture instead

  26. #26
    0
    Samaritan
    Join Date
    May 2014
    Posts
    107
    I know this is all expensive, I'm mostly using it for rapid prototyping. The wave calculations can be changed to a mathematical approach at some point and bypass the RenderTarget read part of the project. The wakes so far are only one way where the actors draw to a texture that is then used by material

    I'm actually doing this to build the rest of the game until we get nVidia's WaveWorks or UE4 has a built in water/ocean system.

    Although when I was working in XNA, which just wraps DirectX 9, the render target read was not that expensive and you could get to it's buffer directly like you can with a texture.
    Last edited by Handkor; 06-06-2014 at 11:50 AM.

  27. #27
    0
    Samaritan
    Join Date
    May 2014
    Posts
    107
    Added a video tutorial on how to add buoyancy to pawns


  28. #28
    0
    Mythic

    Join Date
    Apr 2014
    Posts
    2,233
    Quote Originally Posted by Handkor View Post
    Added a video tutorial on how to add buoyancy to pawns
    Awesome! Thank you for making a tutorial on this, great work!

  29. #29
    0
    I always like some good fluid dynamics.

    I've been meaning to make a fluid simulator one day.

    Good work.

  30. #30
    0
    UE Community Manager
    Join Date
    Mar 2014
    Posts
    1,971
    Wow, the tutorial video is so useful. Thank you so much for showing the community how you achieved this. Handkor, would you mind if we made a page for your video on the Epic Wiki?
    Twitch /unrealalexander| Twitter @UnrealAlexander
    How to report a bug? | Installation & Setup issues?
    Call me to a thread by posting this: [MENTION]Alexander Paschall[/MENTION]

  31. #31
    0
    Samaritan
    Join Date
    May 2014
    Posts
    107
    I don't mind. I had already attached the video to my other wiki entry as this is a disconnected part 2. This technique works for anything you can get a height value from.

  32. #32
    0
    Unreal Engine Support
    Join Date
    Mar 2014
    Posts
    1,872
    Hi Handkor,

    I have a wiki page for your new video, here is the link: https://wiki.unrealengine.com/Adding_Buoyancy_to_Pawns
    Adam Davis | Marketplace Support | Epic Games
    How to report a bug? | Installation & Setup issues? | Answerhub Bug Reports | Twitter

  33. #33
    0
    Quote Originally Posted by Handkor View Post
    I don't mind. I had already attached the video to my other wiki entry as this is a disconnected part 2. This technique works for anything you can get a height value from.
    is your ocean material in first tutorial can wave? mine is like freezed.(i put it into teselated(waterplane)plane)

  34. #34
    0
    Samaritan
    Join Date
    May 2014
    Posts
    107
    Quote Originally Posted by ihavenick View Post
    is your ocean material in first tutorial can wave? mine is like freezed.(i put it into teselated(waterplane)plane)
    Did you attach a panner to your UV for the textures and are each texture using a different speed.

  35. #35
    0
    Hello,

    Thanks for sharing the material, it looks great

    Only problems I have with all my water shaders are shores...

    http://puu.sh/aMuXQ/c507fe7789.jpg

    Do you have any idea how I could smooth correctly transitions between water and landscape without having to use transluency and depthfade? (because it removes specular lighting...)

  36. #36
    0
    Samaritan
    Join Date
    May 2014
    Posts
    107
    No I haven't tackled shores yet.

  37. #37
    0
    Quote Originally Posted by Handkor View Post
    Did you attach a panner to your UV for the textures and are each texture using a different speed.
    Opps i forgot the speed input.So sorry.But there is no big waves.Where we will set big waves ?

  38. #38
    0
    Quote Originally Posted by ihavenick View Post
    Opps i forgot the speed input.So sorry.But there is no big waves.Where we will set big waves ?
    There is one or two parameters included in his material you can tweak to obtain big wave
    Also make sure the plane is big enough, and not only a heavy-scaled little plane shape.

    Quote Originally Posted by Handkor View Post
    No I haven't tackled shores yet.
    I just found a hacky way to do what I wanted actually...

    I create 2 different materials and place 2 big planes.
    On the first plane, I apply a "far" material which is opaque and masked. If the distance from the camera is < 5000 for instance, the opacity mask is 0.

    On the second plane, I apply a "near" material which is translucent and create my shores and tweak a bit the reflection so it doesn't look that bad..
    I then fade it so the transition from the near to the end material doesn't look bad.

    That way I have great reflections on the far of my ocean and nice transition between water and landscape seen from near.
    Last edited by Shelby; 08-10-2014 at 04:47 PM.

  39. #39
    0
    Thanks alot for that 30min video tutorial. Amazing !

  40. #40
    0
    It seems that the OceanManager class is not included in tutorial? So basically I have to modify HeghtMapReader, I mean add those new functions?
    Last edited by jmietola; 08-12-2014 at 01:36 AM.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •