Search Unity

Water4 issues

Discussion in 'Editor & General Support' started by thehosse, Mar 20, 2015.

  1. thehosse

    thehosse

    Joined:
    Nov 29, 2013
    Posts:
    35
    Hey all,
    This has been asked before but can't find an answer...

    I want to make a ocean for one of my scenes, Water4 looks to have the best quality overall but I can't figure out how to make the prefab scale up without the wave animation messing up.

    How is this feature supposed to work?

    Cheers
     
  2. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    hmm. I never really got it looking awesome, think it was pretty much related to the original meshes vertex density (so the coasts don't look as awesome).

    Let me just unfreeze my unity and I will have a quick go in 5_0
     
  3. thehosse

    thehosse

    Joined:
    Nov 29, 2013
    Posts:
    35
    Tried bringing in my own mesh, scaling that also screws it up. Really not sure how to make an Ocean with this water type....
     
  4. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    sorry. pizza arrived. looking now. and - oh - unfreeznig my editor. Sigh.
     
  5. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Okay so 1st lets define a few quick things "BIG", "OCEAN", "LOOK GOOD".

    BIG = goes all way to edges of visible space
    OCEAN = surrounded on all sides to edge of visible space
    LOOK GOOD = Here you have to help me. I will post what I have.

    I scaled up the mesh to 50,1,50 in the main prefab.
    Factor10.JPG
    Placed it on an island scene.

    Island.JPG

    I turn on edge blending but since this is a fairly low poly mesh the edges are never going to be beautiful.
    and stand back a bit.

    edgeBlended.JPG

    I check the specular + reflection looks okayish

    reflection.JPG

    I check the refraction and waves looks okay when in the water
    refractionAndWaves.JPG

    Are we talking about edge foam?

    Specifically - given some references pics now - what do you want to improve.

    Many thanks.
     
  6. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    and if you miss this, and I don't seem to reply - PM me (with the thread link)- sometimes the THREADS don't ping me an update.

    Thanks
     
  7. thehosse

    thehosse

    Joined:
    Nov 29, 2013
    Posts:
    35
    Thanks for the effort twobob, I have this now. The issue is how the 'Gerstner' script screws all the waves up wen the mesh is scaled up....
     
  8. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Okay - will have an eyball on that then. Let me fire it up.

    Heh, oh yeah - I remember now. it's all obfuscated away in the shader.
    Even the displace script is squirreled in the guts.

    Hmm

    so here is the 50x example wave viewed from far
    Waves101.JPG
    Here it is a 10x

    u5_0_10TimesScale.JPG

    those nasty lines are layered transparency artifacts that we will worry about if we get it going right...

    Let's look at that from the floor.
    u5_0_10TimesScale_gournd.JPG

    Looks pretty decent.

    Let's scale that back to 2x8 and see if we can spot what the displacement is expecting/doing
    ActualDisplacement.JPG

    Now, I don;t have access to the code, but I would suggest (as I did originally) that the horrible waves at the larger scales are in fact to do with over-sizing those individual "faces"/"triangles"/"whatevs" into really large ones. (like in Picture 1 above)

    Short of having the script, I would be reduced to creating my own (more dense) mesh via a turbo smooth or something and praying that the script doesn't "REQUIRE" a certain mesh geometry.

    I test this by throwing a random mesh at it. It seems to work okay but not great.
    I rethink the original design and note it is a "Tile" based solution. (there are probably reflection reasons for having four tiles but I ignore this.)

    I splatter in another 4 tiles via copy and run it again.

    ExtraTiles.JPG

    This appears to immediately "work" meaning that the script probably "scrapes" for things called "Tile" and auto-adds them to the "process" pile.
     
    Last edited: Mar 22, 2015
  9. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    So - to your " answer" - How do I scale the waves perfectly to suit an "all sizes" ocean?

    I would say "You Can't" but you could fudge together something.

    Water 4 was never really "finished" and that is exactly how it feels. Kinda unfinished.

    I did fiddle with the shader settings (amp, freq, blah) but for the waves they are little assistance in terms of scaling, that I could find.

    Here is that 8 tile example run from the ground.

    8_tile_2x8.JPG

    It's never going to be Triton3D or suimono or any of the other - better - more complete - NON free - water systems.

    With some kludging it can be made to look decent in fixed scenarios, the mesh size being linked to wave shape kills it.
    There is I suppose the possibility of having (a) high res central tile(s) and lower surrounding ones but it is always going to be massage and trickery at best.


    Stuff to Ogle while you consider your options.




    There are also "shader only" based solutions to this problem
    (CORE framework did some basic wiggles IIRC)
    This thing https://www.assetstore.unity3d.com/en/#!/content/10900
    and a bunch of others.
    I think - realistically - you are going to struggle with the OOTB tools.
    (which explains why there are so many alternatives)

    Cheers




    I may not have helped - but hopefully I saved you some time.
     
    Last edited: Mar 22, 2015