Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Ceto (Scrawks Ocean)

Discussion in 'Assets and Asset Store' started by scrawk, May 4, 2015.

  1. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    There is a also a setting for the ocean. Sorry thought you saw that one as someone posted the same question a few posts before you first asked about it.

    Ceto does not match up when shifting the scene as the projected grid does not have a world space. It works in camera space so when you shift the transform it has no effect. There is a offset you can apply to the ocean from a script to make it match your scene offset.

    Code (CSharp):
    1. Ceto.Ocean.Instance.PositionOffset = yourSceneOffset;
    This needs to be the total amount you have offset the scene by during game play. Cant remember if its meant to be negated (-yourSceneOffset) so try that if it does not work.
     
    twobob, ernov and Tony-Lovell like this.
  2. Saevax

    Saevax

    Joined:
    Nov 3, 2012
    Posts:
    58
    That works perfectly thanks!

    The absorption of light doesn't appear to scale with depth. Past 250 meters the fog should basically be black.
     
  3. Ralack

    Ralack

    Joined:
    Jul 12, 2012
    Posts:
    13
    Sharing an article I found on boat physics today. Fairly nice treatment of the topic with mathematical shortcuts to improve simulation performance. The results look very nice in the demos as well.

    This is not necessarily something Scrawk will implement, but I thought some of you guys using his asset would be as interested as I was in reading it.

    http://www.gamasutra.com/view/news/...ion_model_for_boats_in_video_games_Part_2.php
     
  4. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    How about.... Testing the depth every few frames, and making the fog have less luminance based on height!

    :) crazy I know
     
  5. rageingnonsense

    rageingnonsense

    Joined:
    Dec 3, 2014
    Posts:
    99
    Oh that is a relief to hear! I thought it was going to be some annoying thing that happens only to me. haha. Scrawk should probably put that in the documentation; common problems was the first place I looked.

    If he has been chasing it for this long though, might make sense to just add a call to OnApplicationFocus that force reloads everything when in the editor. It is dirty, but it would work. Maybe a public boolean to disable the auto-reload if you don't want it for some reason.

    The unusual thing about this is that it happens at any point after pressing play, even if the scene is still loading. I didn't notice it at first because my terrain generation code is quite slow at the moment, and it takes around 110ms from start to finish to generate the terrain. I usually press play, then go on reddit for a few minutes waiting for the game to load. so all I was seeing is the ugly water. It wasn't until I made some quick changes to reduce the load time (and the quality) of my terrain that I made the connection.
     
  6. rageingnonsense

    rageingnonsense

    Joined:
    Dec 3, 2014
    Posts:
    99

    I just found out it was a long standing bug. I'll try to help in any way I can. Here are some relevant (and not so relevant) specs of my system from dxdiag:

    Code (csharp):
    1.  
    2. ------------------
    3. System Information
    4. ------------------
    5. Time of this report: 1/8/2016, 20:58:41
    6.   Machine name: HAL9000
    7.   Operating System: Windows 7 Ultimate 64-bit (6.1, Build 7601) Service Pack 1 (7601.win7sp1_gdr.151019-1254)
    8.   Language: English (Regional Setting: English)
    9. System Manufacturer: System manufacturer
    10.   System Model: System Product Name
    11.   BIOS: BIOS Date: 05/12/11 15:00:51 Ver: 08.00.15
    12.   Processor: Intel(R) Core(TM) i7 CPU  950  @ 3.07GHz (8 CPUs), ~3.1GHz
    13.   Memory: 12288MB RAM
    14. Available OS Memory: 12280MB RAM
    15.   Page File: 3241MB used, 10036MB available
    16.   Windows Dir: C:\windows
    17.   DirectX Version: DirectX 11
    18. DX Setup Parameters: Not found
    19.   User DPI Setting: Using System DPI
    20.  System DPI Setting: 96 DPI (100 percent)
    21.   DWM DPI Scaling: Disabled
    22.   DxDiag Version: 6.01.7601.17514 32bit Unicode
    23.  
    24. ---------------
    25. Display Devices
    26. ---------------
    27.   Card name: NVIDIA GeForce GTX 460
    28.   Manufacturer: NVIDIA
    29.   Chip type: GeForce GTX 460
    30.   DAC type: Integrated RAMDAC
    31.   Device Key: Enum\PCI\VEN_10DE&DEV_0E22&SUBSYS_13603842&REV_A1
    32.   Display Memory: 4051 MB
    33.   Dedicated Memory: 723 MB
    34.   Shared Memory: 3328 MB
    35.   Current Mode: 1920 x 1200 (32 bit) (59Hz)
    36.   Monitor Name: SyncMaster 245B/245BW/245BPlus(Digital)
    37.   Monitor Model: SyncMaster
    38.   Monitor Id: SAM02B6
    39.   Native Mode: 1920 x 1200(p) (59.950Hz)
    40.   Output Type: DVI
    41.   Driver Name: nvd3dumx.dll,nvwgf2umx.dll,nvwgf2umx.dll,nvd3dum,nvwgf2um,nvwgf2um
    42. Driver File Version: 9.18.0013.0697 (English)
    43.   Driver Version: 9.18.13.697
    44.   DDI Version: 11
    45.   Driver Model: WDDM 1.1
    46.   Driver Attributes: Final Retail
    47.   Driver Date/Size: 10/2/2012 17:21:00, 18252136 bytes
    48.   WHQL Logo'd: n/a
    49.  WHQL Date Stamp: n/a
    50.  Device Identifier: {D7B71E3E-4D62-11CF-4B59-6D331CC2C435}
    51.  Vendor ID: 0x10DE
    52.  Device ID: 0x0E22
    53.  SubSys ID: 0x13603842
    54.  Revision ID: 0x00A1
    55. Driver Strong Name: oem39.inf:NVIDIA_SetA_Devices.NTamd64.6.1:Section024:9.18.13.697:pci\ven_10de&dev_0e22
    56.  Rank Of Driver: 00E02001
    57.  Video Accel: ModeMPEG2_A ModeMPEG2_C ModeVC1_C ModeWMV9_C
    58.  Deinterlace Caps: {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(YUY2,YUY2) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_PixelAdaptive
    59.  {F9F19DA5-3B09-4B2F-9D89-C64753E3EAAB}: Format(In/Out)=(YUY2,YUY2) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY
    60.  {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(YUY2,YUY2) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY
    61.  {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(YUY2,YUY2) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_BOBVerticalStretch
    62.  {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(UYVY,UYVY) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_PixelAdaptive
    63.  {F9F19DA5-3B09-4B2F-9D89-C64753E3EAAB}: Format(In/Out)=(UYVY,UYVY) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY
    64.  {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(UYVY,UYVY) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY
    65.  {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(UYVY,UYVY) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_BOBVerticalStretch
    66.  {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(YV12,0x32315659) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_PixelAdaptive
    67.  {F9F19DA5-3B09-4B2F-9D89-C64753E3EAAB}: Format(In/Out)=(YV12,0x32315659) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY
    68.  {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(YV12,0x32315659) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY
    69.  {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(YV12,0x32315659) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_BOBVerticalStretch
    70.  {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(NV12,0x3231564e) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_PixelAdaptive
    71.  {F9F19DA5-3B09-4B2F-9D89-C64753E3EAAB}: Format(In/Out)=(NV12,0x3231564e) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY
    72.  {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(NV12,0x3231564e) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY
    73.  {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(NV12,0x3231564e) Frames(Prev/Fwd/Back)=(0,0,0) Caps=VideoProcess_YUV2RGB VideoProcess_StretchX VideoProcess_StretchY DeinterlaceTech_BOBVerticalStretch
    74.  {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(IMC1,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    75.  {F9F19DA5-3B09-4B2F-9D89-C64753E3EAAB}: Format(In/Out)=(IMC1,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    76.  {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(IMC1,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    77.  {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(IMC1,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    78.  {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(IMC2,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    79.  {F9F19DA5-3B09-4B2F-9D89-C64753E3EAAB}: Format(In/Out)=(IMC2,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    80.  {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(IMC2,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    81.  {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(IMC2,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    82.  {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(IMC3,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    83.  {F9F19DA5-3B09-4B2F-9D89-C64753E3EAAB}: Format(In/Out)=(IMC3,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    84.  {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(IMC3,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    85.  {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(IMC3,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    86.  {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(IMC4,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    87.  {F9F19DA5-3B09-4B2F-9D89-C64753E3EAAB}: Format(In/Out)=(IMC4,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    88.  {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(IMC4,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    89.  {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(IMC4,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    90.  {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(S340,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    91.  {F9F19DA5-3B09-4B2F-9D89-C64753E3EAAB}: Format(In/Out)=(S340,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    92.  {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(S340,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    93.  {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(S340,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    94.  {6CB69578-7617-4637-91E5-1C02DB810285}: Format(In/Out)=(S342,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    95.  {F9F19DA5-3B09-4B2F-9D89-C64753E3EAAB}: Format(In/Out)=(S342,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    96.  {5A54A0C9-C7EC-4BD9-8EDE-F3C75DC4393B}: Format(In/Out)=(S342,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    97.  {335AA36E-7884-43A4-9C91-7F87FAF3E37E}: Format(In/Out)=(S342,UNKNOWN) Frames(Prev/Fwd/Back)=(0,0,0) Caps=
    98.  D3D9 Overlay: Supported
    99.  DXVA-HD: Supported
    100.  DDraw Status: Enabled
    101.  D3D Status: Enabled
    102.  AGP Status: Enabled
    103.  
    Something you could try to band-aid fix this is to make use of OnApplicationFocus(), and have it reload the entire ocean from scratch when in the editor; also a public boolean to allow us to turn the behavior on and off. It all loads fairly fast anyways, and since it is just an editor issue, it might just be a "good enough" fix. Good enough for me at least.


    I just tried the transparent version again (without switching focus to make sure that is not part of the issue). It is still failing for me with the same error. I have used the prefab straight from the prefabs folder, no changes whatsoever. Both materials are the transparent materials.

    I checked the shaders as you requested and yes, there IS an error:

    "Failed to open resource file: 'OceanShaderHeader.cginc'"

    I saw this error once before in the console when I had placed Ceto in the folder I wanted it to be in (I like to put third party stuff in a subfolder within assets). I then moved it back to /Assets and the console error went away, but the ocean did not show.

    I just added a space to the problem shader (OceanTopSide_Transparent) to force a recompile, and the ocean showed up immediately! I didn't test anything else though yet (there is no water choppiness, but that is probably just the focus bug). Maybe the #include "OceanShaderHeader.cginc" line should be #include "./OceanShaderHeader.cginc"?


    This is a perfect segue into a small gripe I have about the plugin. It REALLY want to be in /Assets/Ceto. It would be very nice to be able to place this anywhere in the assets folder (and sub folders). Right now, it is the only third party plugin I have that is violating my organization rule. I can live with it, but my ocds be tinglin'.
     
  7. spraycanmansam

    spraycanmansam

    Joined:
    Nov 22, 2012
    Posts:
    254
    I would hazard a guess and say it's the shaders losing their texture references. The problem can be replicated when saving changes to the shader at run-time in editor. It might be worth trying to copy the SetTexture/SetGlobalTexture calls into the update method to test if that fixes it. I haven't had a chance to look at exactly what textures need reassigning though...

    Just a thought :)
     
  8. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    The underwater stuff is still pretty basic.

    It will be improved some more in a later update.

    Im thinking of making a game (when I have time) that is all underwater so this is a area of interest for me.

    Ok, thanks for the info.

    OnApplicationFocus() could be a good band aid. I should have added the issue to the common problems. Will add it if I cant find a fix before next update.

    I dont know why that shader had that error for you. Unity sometime does some odd things when importing a asset into your project. Normally if you just right click on file and reimport it fixes the issue.

    Not sure what your mean about it wanting to be in the /Assets/Ceto folder. I can put Ceto into a sub folder and it still works fine for me? Im also a bit OCD so I feel your pain :)
     
  9. dradb

    dradb

    Joined:
    Jan 10, 2015
    Posts:
    86
    I've only just noticed your post. It's quite old but it is exactly what I was looking for.

    Unfortunately, the app doesn't run at all. It shows the unity screen, then drops out.

    Does anyone have a more recent apk I could test please? As basic as possible is fine ... no foam etc.
     
  10. rageingnonsense

    rageingnonsense

    Joined:
    Dec 3, 2014
    Posts:
    99
    Well, to be fair I have not tried to put it in a subfolder again. I had a perfect storm of issues so the first thing I did was assume that the subfolder had an issue. I should try to move it again, for ocd's sake. haha.
     
  11. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    Will Ceto eventually support spotlight light sources? Right now, if the spotlight tips below "level", it just kind of lights up the water around the position of the spotlight(almost like it's being treated as a point light source).

    edit: Another question: Is it possible to get the normal of the wave with the results of a WaveQuery?
     
    Last edited: Jan 9, 2016
  12. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804

    Hi,

    For performance reasons the ocean shader does not have a add pass by default so it will just use one directional light.

    To get the spot light working can you go into the OceanTopside ( there will be a transparent and opaque one. Use the one that matches what prefab your using) shader and remove the noforwardadd tag. It's been awhile since I've checked this but it should work.

    Can't get the wave normal using a query at the moment. Should be in next update.
     
    ernov likes this.
  13. dradb

    dradb

    Joined:
    Jan 10, 2015
    Posts:
    86
    No problem guys. I stumbled across this. Looks great and runs fantastically even on a low end mobile.
    https://github.com/eliasts/Ocean_Community_Next_Gen
     
  14. Tony-Lovell

    Tony-Lovell

    Joined:
    Jul 14, 2014
    Posts:
    127
    That is precisely the method I was implementing a few years ago -- calculating pressures on the facets of the mesh. It ran about 1000x as fast in Java as in Unity (at that time). Perhaps Unity has made a more efficient mesh querying call (or I was overlooking the right way of doing it)

    tone
     
  15. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    I think mesh querying will still be slow in Unity but there would be faster ways of doing it.

    Maybe make a copy of the ship hull mesh data and just work with that. Also you wont be able to work directly with Cetos projected grid mesh. Maybe just make a small grid that covers where the ship is and then use Cetos height queries to set the wave heights at the grid verts.

    Either way its a cool article and I will certainly be taking a close look at it when I redo Cetos buoyancy scripts.

    Thanks @Ralack :)
     
    Bartolomeus755, ernov and Ralack like this.
  16. ernov

    ernov

    Joined:
    Sep 17, 2014
    Posts:
    21
    Deeply new buoyancy, thank you Scrawk
     
    twobob likes this.
  17. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    171
    Just purchased Ceto. Looks fine but does seem to be eating a fair bit of CPU - about 12-13 ms. Is there any way of reducing this? - I have tried tweaking various settings but nothing seems to make much difference..
     
  18. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Hi Redrag,

    Thats sounds like way to much CPU time. It normally only takes about 1ms per frame.

    Could you please make sure there are no error messages being spammed to the console as that will kill the frame rate.

    Can you disable Cetos WaveSpectrum, PlanarReflections, and UnderWater components one by one to see which one is causing this issue.

    It may also help to have a look in the profiler to see what the source of the issue is.

    There is one thing in Ceto that may cause this. Can you make sure your not using a GPU Fourier size with 'disable read backs' unticked on the WaveSpectrum script as this is very expensive to do.

    It not really recommended to use this option for most set ups. It will read back the height data from the GPU and is to slow for most applications.
     
    twobob likes this.
  19. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    171
    Thanks for that. There are no errors or warnings.

    1) Wave Spectrum on its own = 7.5ms approx

    2) WS + planar = 8ms

    3) WS + planar + underwater 10ms

    Foam seems a big issue

    4) WS + planar + underwater - foam disabled = 7.5ms

    5) WS only with foam disabled = about 2ms

    Looking at Profile is gfx.waitforpresent causing ost f the problem. (By this way this is the demo scene - 8 core 64bit PC)
     
  20. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    You've definitely got something strange going on. I'm running the demo scene with some extras(Time of Day and Volumetric Clouds) and I'm not getting anywhere near that kind of slow performance:



    This is on Unity 5.3.1p1, a GeForce 660Ti and a relatlively old 2600K processor(no overclock).
     
  21. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Remove the V Sync. That sometimes fixes it.
    Or increase the load on the scene, all those values sounds like circa 50 FPS wait states which reminds me of this thread
    http://forum.unity3d.com/threads/gfx-waitforpresent.211166/
    maybe http://forum.unity3d.com/threads/gfx-waitforpresent.211166/#post-1493972
    or for info on what it is http://forum.unity3d.com/threads/gfx-waitforpresent.211166/page-4#post-2113568
    or a possible alternate reason here http://forum.unity3d.com/threads/un...renderered-useless-because-of-fps-lag.348949/
    Hope it helps. Editor issue I believe not Ceto
     
    Last edited: Jan 14, 2016
  22. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    If the profiler shows that the gfx wait for present is the source then it normally means that unity is waiting for the GPU to finish rendering before it can end the frame.

    This basically means the work load for the GPU is to high. You might have a very old PC with a large screen or your don't have a dedicated GPU card.

    It might be worth going into your graphics settings and checking what windows is using as the GPU. Sometimes windows ( like after a update or system restore, or on a new PC) will reset to using the integrated graphics chip which is very slow.

    And yes the foam is expensive. Faster options will be added at some point.
     
  23. mfCleRIC

    mfCleRIC

    Joined:
    Jan 14, 2016
    Posts:
    7
    Hello, scrawk!
    We are planning to create a game with a lot of water on iPad Air or any other iPad.
    Does this asset work on iOS?
    What a performance your water will be on those devices? And what options do I need to use for that?
     
  24. Marked

    Marked

    Joined:
    Feb 24, 2015
    Posts:
    32
    I don't know if anyone has mention it , but if you are in the editor and the ocean goes flat you can reset it to normal by changing the Fourier Size to something different. It will reset it and you can change it back to the previous setting.
     
    AdamGoodrich, John-G and scrawk like this.
  25. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Hi,

    I know that Ceto is not working on some iOS phones but dont know about iPad sorry. I only know of one person that tried it. They said it worked for them but I dont really have enough info to recommend Ceto for iPad at the moment.

    It could be a bit slow but there are some options you could turn down that may help. The fourier size and the mesh resolution probably have the biggest impact.

    The next version has had some major work done on the spectrum code (30%-40% faster) and there will be some options that may perform better on lower end hardware.

    You can always buy it and give it a try. If it turns out to not be suitable for your needs just send me the invoice number and I will authorize a refund. If you send me the invoice number I will even give you early access to the latest version if you want to see if it performs better.
     
  26. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    171
    Could you provide help on how to make shoreline effects? Thanks
     
  27. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    The shoreline stuff is something people have struggled a bit with (and I have struggled a bit to explain it) so I am adding some new helper scripts in the next update to make it easier to do. The manual says 'to be done' as I though it best to wait until the new scripts are in.

    Note - The overlays used to do the shore masks are not currently working on Mac. If you have a Mac you will need to wait until next update when this is fixed.

    The basic idea is very simple. John G post a good explanation on this page (its near the bottom).

    The basic idea is...

    1 - create a new game object and add Cetos AddShoreMask script.

    2 - Change the width, height and rotation until the yellow box fits the terrain size.

    3 - Create a mask which is a texture where white is the mask and black is no mask.

    To create a mask for the terrain you need to make the texture white where the terrain is above the sea level and black below. If you made the terrain in world machine it can do that for you. If you have Gaia it can do it as well. You can then edit the mask in photoshop to customize it if you need.

    You must make sure the mask is in the texture alpha channel. Easiest way is to go to the textures advanced settings and tick alpha from greyscale.

    The helper scripts I am adding in next update will make it easier to make the mask and there will be a new AutoShoreMask script that you just add to your terrain and it does it all automatically.

    There are 5 texture slots on the script so you may need 5 textures but you can reuse the same one for most and you can just leave the slots null if you dont want that bit masked.

    The height mask will mask the wave heights where it is white. Good to fade the waves near the shore.

    The foam mask will mask the white cap foam and the normal mask will fade the wave normals. Both also good near the shore. I normally use the same mask for these as the height mask.

    The edge foam text will add foam where it is white. Good to get that white rim around the terrain. I normally use a slightly burred version of the height mask texture.

    And the clip mask will cut a hole in the ocean where it is white. Good for areas that have caves going under the ocean.
     
  28. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    171
    Thanks Scrawk - I might wait for the update - any idea when it will be released?

    Update: Just tried the instructions above and it does seem to work. The only issue is getting the mask accurate enough, so I am hoping that your next release might help.
     
    Last edited: Jan 15, 2016
  29. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Was planing for end of the month but it might be a week or two late so mid Feb maybe. didn't get as much done in December as I was hoping.

    The new auto shore line script should help with the accuracy issue.
     
  30. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    171
    Could you give me a few pointers on the buoyancy scripts? For a boat it looks like the Buoyant Structure would be placed on the boat object with a rigidbody. Then place x number of child objects with buoyancy scripts. I assume that you could just do one (it seems to work) but you get more accuracy by placing (say) one object at each corner?
     
    Last edited: Jan 15, 2016
  31. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    That's exactly how it works. The buoyant structure script need to be at the root and you then place the buoyancy scripts as children. One at each corner is best.

    I have not written anything about the buoyancy scripts yet as it's still unfinished so is not a advertised feature of Ceto.
     
  32. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    171
    I am struggling to make the water less transparent. it looks really odd when you can see underwater objects in the distance. Is there some way to do this? I thought that changing the absorption would do it.
     
  33. Redrag

    Redrag

    Joined:
    Apr 27, 2014
    Posts:
    171
    Thanks for that. I assume the x and y coming from the buoyancy scripts is horizontal displacement from the wave?
     
  34. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Not sure what your mean by this. The Buoyancy scripts have a WaterHeight property. That's the y position of the waves at that's scripts xz transform position.

    To make the water less transparent you can increase the scale on the inscatter setting on the under water script. You might also need to play around with the inscatter mode.
     
  35. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Im coming to a bit in my current project that calls for various bodies of water, from streams to puddles to lakes and so on and was wondering how feasible it was to peturb the direction of the water with a flowmap overlay?
     
  36. The_Geoff

    The_Geoff

    Joined:
    Mar 22, 2014
    Posts:
    7
    Thank you for this incredible asset - I've just switched over from using Triton and I couldn't be happier with the results. Excellent work!

    One question - is there a way to use a layer culling mask with the Under Water Post Effect script? I would like to make certain objects only visible while the camera (or part of the camera) is underwater.

    Basically I have a particle effect emitting rising bubbles on an underwater object and I would like to make the bubbles invisible above the surface. It seems to me that the easiest way to do this would be placing the particle effect on a layer which is only visible when the camera is underwater.
     
  37. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    494

    Would it be ok if you just killed each bubble effect as it reached the surface, so you could see them from above, but they wouldn't float out of the water?

    If that's enough, go into the particle system and set a collider plane to be a big flat square at (whatever your water height is). Then have the particles lose all their life on collision, and they'll just vanish when they hit the water surface.
     
    scrawk likes this.
  38. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    The underwater effect does not use a culling mask. It just gets applied to every thing in a post effect shader so its not so simple sorry. I think @Jesus had the most practical solution.

    The only other way would be to use a custom shader for the particles that use Cetos underwater mask.
    You can then just set there alpha to zero if the particles pixel is above above water. This does presume you can write shaders of course and you would have to make sure the particles are rendered after the ocean other wise the mask will not be up to date.

    If you look in Cetos UnderWaterPostEffect shader there is this line

    Code (CSharp):
    1. float mask = IsUnderWater(IN.uv).x;
    the mask is 1 if the screen pixel is underwater and 0 if its above the water. The IN.uv would be your screen uv.

    You can find the mask texture for each camera like so...
    Code (CSharp):
    1.  
    2. CameraData data = Ceto.Ocean.Instance.FindCameraData(cam);
    3.  
    4. //if mask null this camera has not rendered the ocean yet
    5. if(data.mask == null) return;
    6.  
    7. Shader.SetTexture("Ceto_OceanMask", data.mask.cam.targetTexture);
    Sorry, I feel like every time you ask me something I say its not possible.

    But...

    Using a flow map to change the direction of Cetos waves in the shader is going to be impossible.

    I think it would be far more practical to use the overlays to mask out the waves height, foam and normals where your lakes are so the water is flat and then use another overlay to add normals (the text slot on the normal overlay texture) where ever you need to. That way you can just rotate the overlay to face what ever way you want and you can use a couple of them to change direction in different spots. You will need to animate the overlay uv to make the waves move however.

    I have not really tested using the overlays to add normals to the ocean so not 100% sure its working at the moment.
     
  39. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    It's ok cheers for the answer anyways!
     
    scrawk likes this.
  40. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    For those of you who have had the 'IsFinite' error with Unity 5.3 and particles in Cetos reflections (@InfiniteDice @SargeRho ) I had a look at this a few days ago and looks like it is a bug in Unity and not Ceto.

    There is a Unity patch for 5.3 that fixes the issue (checked it and it worked for me).

    You can download it here. Its the 5.3.1.p1 one with the fix.
     
    kideternal and John-G like this.
  41. kideternal

    kideternal

    Joined:
    Nov 20, 2014
    Posts:
    82
    Yeah, I saw that and would have mentioned it here but I still receive the error in patches p1 thru 5.3.1.p3:

    IsFinite(outDistanceForSort)
    UnityEngine.Camera:Render()
    Ceto.PlanarReflection:RenderReflectionFor(Camera, Camera) (at Assets/Ceto/Scripts/Reflections/PlanarReflection.cs:467)
    Ceto.PlanarReflection:RenderReflection(GameObject) (at Assets/Ceto/Scripts/Reflections/PlanarReflection.cs:242)
    :(

    There were two errors, and now one of them is fixed with p1. I'll probably have to fuss with particle layers or debug the included ImageEffects as you mentioned, I suppose, but other stuff has been keeping me busy.
     
    Last edited: Jan 18, 2016
  42. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    I thought you would have already know that but thought it was worth mentioning.

    The patch seemed to fix it for me so I dont really know what is going on here. The scene I used was pretty basic. Maybe I need to try something more complicated.
     
  43. Vrumugun1

    Vrumugun1

    Joined:
    May 24, 2015
    Posts:
    1
    Hi scrawk,

    i purchased Ceto some days ago and i like it so far. But i have an issue in a scene with 2 cameras:

    The cameras are configured in the following way:

    Main camera:
    Near clipping plane: 1000
    Far clipping plane: 60000
    Depth -1
    Clear flags: solid color

    Second camera:
    Near clipping plane: 0.3
    Far clipping plane: 1000
    Depth 0
    Clear flags: Depth only

    In my test scene i did place two cubes. When i look up (the ocean is no longer visible) i get a strange graphics bug (see second screenshot). The bug only occurs if ceto is in the scene and 2 cameras are used. If i disable Ceto the bug is gone or if disable the second camera and change the near clipping plane of the main camera to 0.3.

    test_scene1.png test_scene2.png

    Any idea why this happens and what i can do to avoid this issue?
     
  44. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Yep, thats a Ceto bug. Will be fixed in next update.

    To by pass the issue you can go into the ProjectedGrid script and on line 444 in the ApplyProjection functions there is this line...

    UpdateBounds(go, cam);

    If you comment that out it will fix the issue. Catch is you cant have receive shadows ticked on the projected grid script as it will break the shadows for the scene.

    If your trying to draw the ocean with two cameras for large scenes your going to have a issue with a line going across the ocean where the cameras meet. I don't have a solution for that at the moment.
     
  45. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    494
    This is a bit of a doozy because I use the same camera method (actually, 3 cameras) and in trying to develop my own system I wanted to manage the same issue.

    On a similar note, the reflection/refraction is also something that has to be handled manually if you have 2 view cameras but only want one (reflection) camera.

    What I've got so far is that with the projected grid you can work out where, in distance from the camera, the transition occurs, and to make sure there is sufficient detail there. Since the cameras are using the same FoV (I assume this would always be the case, if not just take one camera's FoV to be "right"), you should be able to use that as a base for one mesh that is partly rendered by each camera.

    Another thing I've found helps (though this may just be me mistaking it for being dirty) is to have the far camera near plane at 1000, and the near camera far plane at 1024. If they're both 1000 sometimes a pixel will 'fail' or give funny results with texture filtering (I think that is it?).
     
  46. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804

    Using multiple cameras like this not something I had considered when developing Ceto so it does not handle this well at the moment.

    I think most of the issues could be sorted out easily and I will take a look at it at some point. The projected grid issue will be the most complicated bit to fix.

    At the moment all the cameras use the same settings so for example if one has refraction then they all do. I was planing to add per camera settings soon. Might even be in next update.
     
    John-G likes this.
  47. Saevax

    Saevax

    Joined:
    Nov 3, 2012
    Posts:
    58
    upload_2016-1-20_10-1-1.png

    When looking at the ocean from below at a depth of about 2000m and with a camera angle around 80-85 degrees (90 degrees being looking directly up). The ocean starts flickering rapidly and the FPS drops like a rock.

    This effect decreases the closer you are to 0 depth. I believe but haven't tested the effect is mirrored above the ocean. Camera angles of around 80-89 degrees effectively break the ocean at high distances.
     
  48. Jesus

    Jesus

    Joined:
    Jul 12, 2010
    Posts:
    494
    Saevax, could it it the far clip plane is too small to see the ocean surface from that depth? What happens if you're 2000m above the ocean looking down on it from a similar angle?

    I don't know how he's doing the projection math and how it handles when the ocean plane is beyond the far plane, but that's my gut feeling. Also, maybe you use stretched Unity Cubes to make a big plus sign directly over the camera, and see if the FPS drops when the point directly above the camera is visible?
     
  49. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    I know about the flickering issue but I didn't know the fps drops.

    I will take a look at it. The projection math currently does not handle looking up at the ocean from a far distance. I would have thought the underwater fog would stop it being visible from that distance anyway.
     
    Last edited: Jan 21, 2016
  50. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232