Search Unity

Ocean Renderer

Discussion in 'Works In Progress - Archive' started by scrawk, Feb 24, 2013.

  1. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    272
    @scrawk Excited to know you are working on this again!
     
  2. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    I thought you'd left the projects behind so i'm really pleased to see you back on these, that performance increase is remarkable, i can't wait to get my hands on the updated whitecaps project, assuming you're returning to that, i think i'll finally be able to make my ideal ocean
     
  3. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    That would be pretty cool, people can expand it into a lot of ocean renderer solution
     
  4. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Yer I know that project is quite complicated and hard to follow. Its mostly a byproduct of how complicated the original was.

    I was thinking of doing a project that was just a example of the projected grid on a flat surface (not a planet, it gets complicated) with nothing else. That way people could adapt it for other uses without having to go through the Proland code.

    I wasnt going to add the ocean stuff but will provide a shader that will render the grid and you can add your own displacement method.

    How does that sound?
     
    Jither and odival like this.
  5. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Thanks but Im just trying to update everything to Unity 5 and before that do some tidy up and add a few thing I should have done before like run the Indie one on a separate thread.

    The projects like the white cap one that run on the GPU probably wont change to much. I will try and add the ability to change the wave conditions during run time though as that's probably the most asked for feature.

    I am currently working on a personal project (Terrain engine) and will soon be adding the ocean code. There maybe a few features that carry over to these public ocean project but cant say so for sure at this moment.
     
  6. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Sounds Perfect! I think it will help a lot for people to understand it and extend it with their water solution.
    Thanks!
     
  7. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Ok, no prob.

    I want to sort out these projects first and will do that after. May take a month or 2.
     
    Luckymouse likes this.
  8. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    I would love to see this on mobile still... all water packages for mobile are so so unless you have a computer like mobile
     
  9. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Doesn't the community ocean work on mobile?

    In any case Im not really set up do mobile projects. Im not that familiar with them. I dont have a phone to test it on, I have a iPhone but dont have a Mac. (iPhone 3 as well, time for a upgrade :) )

    Im pretty sure the Indie ocean project will work on mobile? Im sure Ive seen people run it on a mobile device?
     
  10. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    Yeah community ocean works on mobile but looks pretty bad for big oceans. The tiles are pretty visible (repeating tiles) and when it is big it's hard to make any kind of realistic looking waves. I use it already on my game www.dogfightplay.com if you have an iPhone 4s at least you should be able to see it.
    You can also see it from a computer using facebook https://apps.facebook.com/1511898672358195

    Nowhere near what it should look like in 2015 for a mobile phone though. I'm constantly on the look out for a better looking water system but so far no luck. Yours looks pretty nice, specially the white caps versions. I'm pretty sure that runs on an iPhone 6.

    As for your existing system, I would be curious to see it near land, shore lines are one of the most complex things to get right on any ocean system.
     
  11. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    So bit of a update and a slight change of plans...

    First of most of these projects have now been updated to Unity 5. The Indie, Pro and BRDF 'Get Heights' projects all have Unity 5 project files.

    The BDRF dx9 and the white cap projects are not working in Unity 5.

    The BRDF dx9 works if you enable dx11 so Im guessing its some sort of shader compilation issue.

    The white cap project works if you comment out these lines in the ocean shader.

    Code (CSharp):
    1.              
    2. v.vertex.xz += tex2Dlod(_Map3, float4(uv/_GridSizes.x, 0, lod)).xy * _Choppyness.x;
    3. v.vertex.xz += tex2Dlod(_Map3, float4(uv/_GridSizes.y, 0, lod)).zw * _Choppyness.y;
    4. v.vertex.xz += tex2Dlod(_Map4, float4(uv/_GridSizes.z, 0, lod)).xy * _Choppyness.z;
    5. v.vertex.xz += tex2Dlod(_Map4, float4(uv/_GridSizes.w, 0, lod)).zw * _Choppyness.w;
    6.  
    The textures for the xz displacement are no longer working for some reason.

    I will look into these issues further.

    Nothing has been done to the Phillips Ocean project. The fourier transform will get moved to its own thread like the indie version. I will get to this some time soon.

    I have also finally decided to do a proper ocean project for the Asset store. This will be a paid for project with all the features people would expect of a ocean like waves, buoyancy, foam, underwater, boat wakes etc. The project will be in Unity 5 and will hopefully have the BRDF model added to Unitys new light model.

    I will be using the projected grid method and have coded a working implementation in the last few days. This does mean that I will no longer be doing the Projected grid project I mentioned in the last posts. Sorry to those who were looking forward to that.
     
    odival, elbows, Jither and 6 others like this.
  12. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    That sounds much more interesting to me. I'd be happy to test it on console and desktop Unity. Some mild early requests? just speed, and tonnes of it :) we have plenty of cores to play with and dx11 compute shaders on all our platforms (even sony's).

    Also source is probably a must-have. And please don't be shy of using Unity's Ubershader format as it can then be really fast/optimised if we don't need a specific feature of it.
    Also river support is a sexy thing if you're going that far.

    Also: Unity 4 doesn't really need to be supported given that all free customers migrated to a single feature set version (5) overnight :D
     
  13. creat327

    creat327

    Joined:
    Mar 19, 2009
    Posts:
    1,756
    That's great. Just one detail, check for shore lines. It's a painful part of all ocean projects I've seen. Many look awesome in the middle of the ocean but as soon as you arrive to shore... it looks so crappy it's scary.

    In any case, if you need me to beta test it on mobile, pc or console I can do them all: xbox one, ps4, pc, mac, android, ios, windows phone, windows 8.1
    I'll be more than happy to help out, I'm always on the lookout for new water systems for my games.
     
  14. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    love this news, as you well know id love a look any time, i always intended to make a proper ocean system out of this myself
     
  15. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Are rivers, in your opinion, a highly demanded thing? Ive been working on an idea for ages
     
  16. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Of course they are. The reason people don't do rivers much is because they're a pain to make :D
     
  17. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Oh nice. :cool: Hope it's works on Dx9. :oops:
    BTW, do not forget to add an option for "spherical ocean".
     
  18. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    People still rock DX9?
     
    ZJP likes this.
  19. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Yes... :p
     
  20. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Right i'll consider that a challenge then if scrawk doesn't pick it up!
     
  21. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Phillips Ocean project has just been updated as mentioned in last post.

    Thanks for everyone's feed back!

    Performance should be very good. I will be running the fourier transform on the CPU using a multithreaded task system I have written for some personal projects. Hopefully the project will only require a few milliseconds of main thread time per frame.

    The core set of features will not require any dx11 (ie compute shaders) but there maybe optional components for those with dx11 support. I would still need to support dx9 platforms.

    No plans for rivers in first version but will keep it in mind. As mentioned they can be a bit of a pain.

    Yes, shorelines in most project look rather poor. I have a few ideas on how to do this better. Its something I will be adding and will be getting a lot of focus to make sure they look as good as possible.

    Thanks for your offer of testing. I may well need it. I dont really have access to so many platforms!

    It will work on dx9.
    No plans for spherical oceans in first version. Maybe latter.

    The projected grid gets very complicated for spherical oceans. Also people would try and use it on very large planets and dealing with the precisions issues makes things even more complicated.
     
    super77gg likes this.
  22. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Thanks for the reply.
     
  23. Uli_Okm

    Uli_Okm

    Joined:
    Jul 10, 2012
    Posts:
    95
    Hi scrawk!
    Do you have any idea of when you will release (or have a beta version) of this ocean solution you are working on?
    I'm searching for some options for a game i'm developing, and even these tests/research you did look really good
     
  24. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    I can't give a release date as it's still very early in development. It really depends on how much spare time I get and if I get stuck on something.

    I might have a beta version in about 2 or 3 months. I may start a WIP thread for it in a few weeks.
     
    super77gg and John-G like this.
  25. Samsson

    Samsson

    Joined:
    Oct 12, 2010
    Posts:
    165
    Just tested some projects you puted at the first page, it's really a nice job ! Gongrats !
     
  26. Chaerephon

    Chaerephon

    Joined:
    Jan 3, 2013
    Posts:
    8
    Just adding my voice to the chorus, your initial ocean projects were fantastic Scrawk, looking forward to the asset store versions!

    My project calls for large scale top-down oceans, most water implementations have bad tiling in this context.
     
  27. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Thanks Samsson and Chaerephon.


    When I did the Unity 5 updates I did not realized that float and half formats have now been added to texture2D/3D objects.

    The indie project has now been updated to use float formats allowing the wave heights to be much larger. The Pro project has been updated to remove the encode/decode scripts as they are now redundant.

    There was also a bug in the Indie projects height sampling. This has now been fixed. The BRDF GetHeights project has also had its height sampling bug fixed.

    Thank you to Arainami for pointing this out.
     
    Chaerephon and SAOTA like this.
  28. SAOTA

    SAOTA

    Joined:
    Feb 9, 2015
    Posts:
    220
    I have access to mac/pc/ios and oculus. scrawk to the rescue.
     
  29. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Hi there scrawk,

    I'll start by saying awesome work! What you're doing looks so darn good. I'd love to see you continue to build onto this. I seem to be getting some strange glitches with my BRDF.

    http://gyazo.com/42d7bb21ab2a543faa908af15ee0885a

    That is what it looks like when I run the game in the editor. I downloaded your Unity 5 project files and for some reason all the materials are black. Seems very strange. Let me know if you have a solution.

    Thanks for your time,
    Matthew
     
  30. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    The project was working fine for me in Unity 5. The Unity 5 BRDF project only works in dx11 so make sure you have that but other than that I am not sure what the problem is sorry.

    I do sometimes updated these projects and fix bugs but in general they are unsupported.

    Please see the new thread on creating a asset for the store from these projects.
     
  31. dradb

    dradb

    Joined:
    Jan 10, 2015
    Posts:
    86
    Hi scrawk,
    It looks absolutely brilliant. However it won't run on my Samsung Android mobile. It just shows a flat black ocean.
     
    Last edited: Oct 4, 2015
  32. steveh2112

    steveh2112

    Joined:
    Aug 30, 2015
    Posts:
    314
    its works great with my rift, very realistic, in fact if you look at the sea too long you start to get sea sick

    nice project, thanks
     
    theANMATOR2b likes this.
  33. joshua-lyness

    joshua-lyness

    Joined:
    Jul 30, 2013
    Posts:
    8
    Hi scrawk, i know you probably wont read this but is the BRDF lighting model a shader, and if so will it work with philips ocean?
    Also at the minute the mesh for all the oceans is circular except for philips ocean, is it an easy change to make it a different shape?
    Ha and also, ceto looks really cool but i read it doesnt work on mobile devices.... Are you thinking of making it work on mobile?
     
  34. Studio_Akiba

    Studio_Akiba

    Joined:
    Mar 3, 2014
    Posts:
    1,423
    @scrawk In both the example scene and my own scene my water is completely black.
    The example scene has a small patch of white on that follows around below the camera (even in scene view), and nothing I do will allow me to make it look like the screenshots, what am I doing wrong?

    Using the BRDF version for U5 btw.
     
  35. nobodyliang

    nobodyliang

    Joined:
    Jul 26, 2016
    Posts:
    1
    @scrawk The links are not working now, can you post it again?
     
  36. JohnSmith1915

    JohnSmith1915

    Joined:
    Apr 21, 2016
    Posts:
    143
    Any new free ocean solution for Unity with decent quality, this project die a year ago?
     
  37. bigkahuna

    bigkahuna

    Joined:
    Apr 30, 2006
    Posts:
    5,434
    Check the link on the first post.
     
  38. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Oh my God !!! Bigkahuna !!! :eek:
     
  39. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788