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

Ceto (Scrawks Ocean)

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

  1. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Forge networking not useing unity networking?
     
  2. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    This is a quick example. Have not tested but should work.

    You do need to check if the ocean instance is not null. It will be null if no ocean in scene or ocean is disabled.

    This script does presume that ocean is enabled during its start function.

    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. using Ceto; //1. Add Ceto
    6.  
    7. [RequireComponent(typeof(NetworkView))]
    8. public class NetworkTimeSync : MonoBehaviour, IOceanTime //2. Implement interface
    9. {
    10.     public static NetworkTimeSync instance;
    11.     private float deltaTime;
    12.     public static float time;
    13.     public float netTime;
    14.  
    15.     //How often we sync our time with the servers time, to avoid someone going way off time
    16.     public float syncRate = 3f;
    17.     public float lastUpdate = 0f;
    18.     protected float lastUpdateTime = 0f;
    19.  
    20.     NetworkView networkView;
    21.     void Awake ()
    22.     {
    23.         instance = this;
    24.         deltaTime = -(float)Network.time;
    25.         networkView = this.GetComponent<NetworkView>();
    26.     }
    27.  
    28.     void Start()
    29.      {
    30.  
    31.           //3. Add to ocean. Ocean will now call this Now function to get its time.
    32.  
    33.           if(Ocean.Instance != null)
    34.                Ocean.Instance.OceanTime = this;
    35.  
    36.     }
    37.  
    38.     void OnServerInitialized ()
    39.     {
    40.      
    41.      
    42.     }
    43.  
    44.     void OnConnectedToServer ()
    45.     {
    46.      
    47.         networkView.RPC("GetServerTime",RPCMode.Server);
    48.      
    49.     }
    50.     public float Now { get { return netTime; } }
    51.  
    52.     void Update()
    53.     {
    54.      
    55.         time = (float)(Network.time + deltaTime);  
    56.         netTime = time;
    57.      
    58.      
    59.         if(Network.isClient)
    60.         {
    61.             if(Time.time-syncRate > lastUpdate)
    62.             {
    63.                 networkView.RPC("GetServerTime",RPCMode.Server);
    64.                 lastUpdate = Time.time;
    65.             }
    66.         }
    67.     }
    68.  
    69.  
    70.     //server function
    71.     [RPC]
    72.     void GetServerTime(NetworkMessageInfo info){
    73.         networkView.RPC("SetDeltaTime", info.sender, time);
    74.     }
    75.     [RPC]
    76.     void SetDeltaTime (float serverTime, NetworkMessageInfo info)
    77.     {
    78.         deltaTime = (float)((serverTime + (Time.time-lastUpdate)/2) - Network.time);//serverTime - (float)info.timestamp;
    79.         lastUpdateTime = (float)Network.time + deltaTime;
    80.         Debug.Log("NETWORK TIME: " + Network.time + " TIMESTAMP: " + info.timestamp + " Delta " + deltaTime + "  serverTime =  " + serverTime.ToString() + " RealTime: " + (serverTime + (Time.time-lastUpdate)/2) + " DELAY: " + (Time.time-lastUpdate)/2);
    81.     }
    82.  
    83.  
    84.     public static float ConvertTimestamp ( double timestamp )
    85.     {
    86.         float timeDifference = (float)(Network.time-timestamp);
    87.         return (NetworkTimeSync.time - timeDifference);
    88.      
    89.     }
    90.  
    91. }
     
    twobob likes this.
  3. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    I will test it tomarrow, now i can only test it local, but then we have no delay so just network.time will also work.
    will let you know. ;)
     
  4. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Ok so to make it work in my game with the Ocean spawning after the player is created in a world, on server join.
    A bug will show up, the "AddShoresMask" will not register and will not work.

    EDIT: Work around is to enable them after spawning the Ocean ;)
     
  5. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Testen de network script with someone outside this local network and its working, but you need to have this on player spawn:

    Code (CSharp):
    1. if(Network.isServer)
    2.         {
    3.             Network.Instantiate(MyOceanObject, Vector3.zero, Quaternion.identity, 0);
    4.         }
    So the the ocean will spawn on the server and will be in sync. :)
     
  6. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    We have the ocean already in the scene but do the time change to the new IOceanTime object using an OnPlayerConnected event. That way it doesn't have to wait for the player connect to show in the scene, it just changes to the new time keeping when it actually connects and the water will shift to the new time point.
     
    twobob likes this.
  7. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    That will also work.
     
  8. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Ok. I will fix that in next update.
     
  9. mehrankan

    mehrankan

    Joined:
    Apr 12, 2015
    Posts:
    60
    I am working on a beach scene and i was wondering if ceto can help me improve the quality of the sceme, the thing I am most interested about is the part where the water meets the sand. from the examples I have seen of ceto I can judge that it does water surface very nicely, but what about the surf area at the beach? how will I do that?
     
  10. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    If you look at the demo scenes there is a flat area around the cubes that always stays flat even if the wave size increases.

    Ceto has a system to modify the waves at any location using mask textures.

    You can mask the waves so they fade towards the shore and clip away areas for parts of the terrain that are below sea level.

    You do need to make a mask texture that matches the shape of your terrain which is a bit tricky but helper scripts to do that will be added soon.
     
  11. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    A picture speaks a 1000 words.

    Raised Lake in Island scene (we made this last night)
    You can see the gizmo for the HeightAddOverlayExample beneath the lake, it is significantly bigger than the actual extrusion owing to the mask we applied and the general "loose skirting" of the extrusion applied by the HeightAddOverlayExample effect. (I.e. it uses a gentle rolloff in the Y rather than ridiculous sharp edges)
    upload_2015-12-7_15-19-7.png

    Here it is seen in-game
    upload_2015-12-7_15-21-58.png

    And here is the implementation seen from underneath the terrain level
    upload_2015-12-7_15-23-48.png

    A lump of water is raised out of the main body to intersect the terrain. Edge Fading does the rest.
    The side effect of the surrounding water being flattened in fact aids us in our managing the islands underwaves, thus precluding the absolute need for a shore mask.

    But we could easily add one via the Gaia toolset at this time, or with a bit more effort via other top-down isometric capture methods.

    So that is a practicle application of the HeightAddOverlayExample in action.

    For our Required Textures we simply used CircleMaskSoft and White both of which are tiny sprite sized images and included in the Unity Default effects (I think). It was zero hardship.

    upload_2015-12-7_15-31-19.png
    As you can see we used the Mask in Waves_And_Overlay_Blend mode which gave us the "Calming" effect that we required for the still lake.

    Hope it helps visualise how this might be used, and how the extrusions/intrusions exhibit physically, in this case also masked (Still with a fairly loose skirt, you can play with the Alpha for greater intensity)

    Alpha = "30"
    upload_2015-12-7_15-41-16.png
    In our case we just wanted to reveal the "flattened top" area, it could easily be inverted to Alpha = -30 to create a sinkhole for example. Funs!

    Cheers
     
    Last edited: Dec 7, 2015
  12. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Is there a way to make a mask based of a height map of a terrain?
    Then we can automaticly make it so that islands are equiped with a mask right ?
     
  13. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Ok so i have this issue with a floating object, with stickyness put to 100 so its nice and dry on top when this object is outside water its forced down into the ground makeing it glitch when trying to move it around.

    Moveing the floating points down will also not work as the object needs to work upside down to.
    It there a easy way to do this or do i have this object detect when it hits water to then set stickyness to 100, else its 0 ?
     
  14. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    "You do need to make a mask texture that matches the shape of your terrain which is a bit tricky but helper scripts to do that will be added soon."

    Hi, I am not sure exactly what script you are talking about. We added a minimum Y value to a few of the example scripts (Stick to Surface for example), that allowed us to limit the movement vertically based on a single float value.

    Do you mean something like that? The scripts are extremely basic right now, just examples. The ocean is main focus.
     
    Last edited: Dec 8, 2015
  15. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    The issue is when stickyness > 0 but the object is like 50.0Y above water, somewhere on a terrain, it will be pushed downwards.
     
    twobob likes this.
  16. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    "Hi, I am not sure exactly what script you are talking about"
    Can you just do a screenie of the problem, if you mean like the terrain height is not being honored then I would presume that only the ocean height lookups are being performed in the script.

    Have you looked? I havent seen any ray-cast examples so far and that sounds like what you would need.
    Which script specifically - by name - do you mean. Save me searching, I am am currently working on something else cheers.
     
  17. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    The stickiness setting was added as I was having trouble making the buoyancy stable. It was not a very good idea.

    New better buoyancy scripts will be added at some point. In the mean time just leave the stickiness at 0 if you can or set it to that only when the object goes out of the water.

    Yes you can make a shore mask from the terrain height map. Something to do this automatically is planned for next update.
     
    Last edited: Dec 8, 2015
    twobob likes this.
  18. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    Is there a way to detect when a object hits the water?
     
  19. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Yes. You can use a wave query to sample what the water height at any location is. Have a look in the manual for code example of this. It's under the sub systems section.
     
  20. imtehQ

    imtehQ

    Joined:
    Feb 18, 2013
    Posts:
    232
    That worked great, i sample the height if the pos x, z changed, to then compare the water height to the object with a correction. Then toggle off and on the stuff. ty :)
     
    scrawk likes this.
  21. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
  22. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
  23. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    New version (1.0.9) is now on asset store.

    I did post this on last page but Im going to repost as there was a couple of last minute additions.

    Ceto Version 1.0.9

    - Fixed a issue if no skybox material was being used then the transparent prefab was not rendering correctly.

    - Now hiding system io for web player

    - Fix a issue where reflection and underwater was not rendering correctly if the camera view port rect was not 0,0,1,1

    - Fixed a issue where the default sky color was not being used if no reflection script added to ocean

    - Fixed a issue where changing the projected grid transform was causing it to not render correctly.
    Note - The projected grid objects are hidden by default and there transform should not be used.
    Because of the way the projected grid works it has no world space so its position can not be modified
    by using the transform.

    - Fixed a bug where the overlay height alpha was being set to 0 in the AddWaveOverlay start function.

    - Fixed a issue where the overlay manager was clearing a null texture was causing other cameras in the scene to not render.

    - Fixed a issue where Ceto was causing the scene view tab to go black.

    - Fixed a issue where clicking the camera in the scene was causing the scene view window to go black.

    - Fixed issue where particles where being draw other ocean even if under the surface.

    - Refraction cmd will now only grab the depth texture. It wont do a screen grab. If you have removed the grab pass
    in the shader you need to add it back. If you have no idea what Im talking about then you dont need to do anything.

    - Fixed bug where if depth blend was > 0 with USE_OCEAN_DEPTH_PASS the underwater effect was much darker than it should be.

    - Opaque materials now have a edge faded added. Edge fade setting has been moved from material to underwater component.

    - Memory allocations have been reduced by 2kb

    - Projections math has been reduced from 0.33ms to 0.17ms.

    - removed some redundant files.

    - Wave overlays can now subtract from ocean wave height as well as added to it.

    - UV offset has been added to wave overlays. This should make animations easier.

    - Fixed a issue where some sky assets (like ToD) where having the skybox in ocean reflections.

    - Fixed a issue where some overlays not being added to ocean if ocean starts disabled.
     
    _invalidusername, imtehQ and twobob like this.
  24. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Hi mate.

    Two things.

    A) since we have encountered FPS as a common non-namespaced class across a few apps please could make it

    Code (csharp):
    1.  Ceto.Common.Unity.Utility.FPS m_fps;
    2. // Snip...
    3. void Start()
    4. {m_fps = GetComponent<Ceto.Common.Unity.Utility.FPS>();
    5. // Snip...
    in GUIDisplay.cs

    and
    B)

    Please could you help us to understand how we could render some world space text over the undersea fog?
    We spent most of the day fiddling about triying to get it going.

    we tried
    Code (csharp):
    1. ZTest Off
    2. ZWrite On
    and
    Code (csharp):
    1. Tags
    2. {
    3.  "Queue"="Overlay"
    4.  "IgnoreProjector"="True"
    5.  "RenderType"="AlphaTest"
    6.  "PreviewType"="Plane"
    7. }
    in the UI/Font shader but to no avail

    Clearly we are not writing an alpha tested copy to the Z-buffer but we thought that might do it...
    Any clues Oh Sage of Scrawkines?
    Very much obliged.
     
    Last edited: Dec 10, 2015
  25. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804

    FPS issue no prob.

    The text with the underwater stuff is a bit more complicated.

    The effect will render over everything as it runs after everything has been drawn..

    If you can get the text to write to the depth buffer that will help. The underwater effect will still be applied to it but it should be based on the objects correct depth values which should look ok. Try changing the text queue to opaque.

    To actually have the text over the fog theres two options.

    You can render the text from a script in the OnGUI function. This renders over everything but you will need to do use Unitys low level GL functions. You can in theory draw anything this way but its a bit of a pain. If you have ever coded directly using OpenGL then this should be familiar.

    You could also try the using the stencil buffer. Have the text shader write to the buffer and change the underwater post effect shader to not where the stencil is. If your not familiar with the stencil buffer then this could be tricky.

    Neither of those option are good but its all I can think of at the moment.

    I might be able to add a feature where objects can write to the masked and then not have the effect applied to them if neither of those options work for you.
     
    Last edited: Dec 12, 2015
    twobob likes this.
  26. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Cheers we will try the "Geometry" layer then
    and perhaps have a look at the stencil buffer. Much obliged for your thoughts

    EDIT... Hmm... Or maybe a custom function to scale/move the world elements in Overlay space to the equivalent world space locations.... that would be handy.
    I'll think on it. thanks again


    EDIT EDIT: We used this and left it here for others, thanks. It requies a mesh renderer to operate and the various public bits to be populated.
    GenerateTextObjectAndPositionDuringRuntime
    https://gist.github.com/twobob/79b7d1a3c8260733a0f9

    Supporting Class WorldToCanvasPosition
    https://gist.github.com/twobob/003b067a65db7addb4a3

    If coupled with a 2 or 3 stage LOD group it can effectively decide your draw distance for the labels

    Piggy bits in an LOD group...
    upload_2015-12-11_17-18-12.png

    With Label Nearby:
    upload_2015-12-11_17-8-19.png

    Outlined at mid distance (No Label)
    upload_2015-12-11_17-16-43.png

    "Normal" rendering when far (No label)
    upload_2015-12-11_17-17-45.png

    The prefab is just a gameobject with a Text component, thusly
    upload_2015-12-11_17-9-46.png

    You can also optionally use a stencilled font shader such as https://gist.github.com/twobob/ddf03ec7605d07874a58 (Shown here as TopMostFont material) to draw over trees, seaweed and such...

    This type of thing will be required to label things that are undersea from above the sea...
    Hope this helps save someone else some time since it took us a little to get our heads around it.

    A nice addition would be to scale the Text FontSize based on distance... ;)
     
    Last edited: Dec 11, 2015
    hopeful likes this.
  27. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    271
    CETO + Cinematic Image Effects (Pre Release) package
    Ceto_CinematicFX_DOF.jpg
    Hope this image is helpful.
     
  28. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    I don't know if there are any relevant differences yet, or how well in sync the two will be in future, but when talking about Unitys Cinematic Image Effects it might be a good idea to state whether its the current asset store version or the latest github version.

    I kind of doubt that it will make any difference to your issue in this case, but I couldn't help throw but throw that out there since the thought popped into my head as we enter a phase of seeing how well these new effects from unity will play with the work of others.
     
    twobob likes this.
  29. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    twobob likes this.
  30. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Last edited: Dec 11, 2015
  31. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Im not sure if your reporting a problem. A bit more info as well as a image would be helpful.

    From the image I think I might know what the issues is.

    Can you check in dx9. If its the issue Im thinking of then the problem should not show up in dx9.
     
  32. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    271
    DX9 / DX11 + CETO + Cinematic Image Effects (Pre Release) package DOF
    Ceto_DX9_CinematicFX_DOF.jpg

    Testing the Cinematic Image Effects (Pre Release) package, Depth of Field and noticed the underwater sphere looks strange.
     
    scrawk likes this.
  33. rgrlee71

    rgrlee71

    Joined:
    Sep 11, 2012
    Posts:
    37
    Hi,

    I love this asset so much!! I have been wanting to build my own ww2 submarine game for a long time and Ceto finally gave me the motivation to get it started. I only have one tiny problem ( that may be my lack of understanding ), but I can't get my particle systems to render properly underwater. I'm attaching a pic to illustrate what I mean. The bubble particle comes from the submarine prop and renders fine against the sub but seems to be clipped against the water.

    Am I just missing something simple?

    Unity 5.3
    Windows7
    GTX 970

    Thanks

     
    Last edited: Dec 12, 2015
  34. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Hi,

    Your not missing something. Transparent particles won't show up correctly as they don't write to the depth buffer and the underwater effect renders over them and will then use the depth value of what ever is behind the particle. That's why they show up against the submarine.

    I'm aware of this issue and don't have a solution at the moment.

    The only thing you can try for now is to use a particle with a alpha tested material instead of a transparent one. That should work but have not checked yet.
     
    rgrlee71 likes this.
  35. rgrlee71

    rgrlee71

    Joined:
    Sep 11, 2012
    Posts:
    37
    Thank you for such a quick reply. I will try what you suggested and see how it works, maybe you'll get this worked out down the line. I have faith!!
     
    scrawk likes this.
  36. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Just for fun, In the sprit of "What if": We added the foam trail script to the heads of a species of water based animals.

    upload_2015-12-14_13-37-25.png

    Hippopotami are good choices as they do a lot of surface stuff.



    Pretty decent result. Go Go Motor Hippo!
    mp.jpg
     
    Last edited: Dec 14, 2015
    AdamGoodrich and hippocoder like this.
  37. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Oh wow, that worked pretty well. :)
     
    twobob likes this.
  38. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I can only agree. Probably the best thing I've ever seen (or looks fun anyway!)
     
    twobob likes this.
  39. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    When spawning via a multiplayer I get.

    upload_2015-12-15_16-27-42.png

    which is seemingly non-fatal. Just thought I should report. I suspect there simply is no ocean for a little while as the asset is pulled down however there IS a camera... Sounds error worthy to me ;) Certainly something to do with serving the ocean via an assetbundle, which works seamlessly other than this warning.

    QED:
    upload_2015-12-15_16-29-33.png

    Cheers


    EDIT: Hmm digging looks like it's get_DisplacementBuffer()... hrrm, I'll have a play
     
    Last edited: Dec 15, 2015
  40. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746
    I've got a new issue that I can't recall happening before this latest version. If I have refraction intensity up at all I get the above-water obects showing refraction.

     
  41. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    @twobob :

    Thanks. I know what the error is from. Its because theres a call to sample the wave height before the wave spectrums start function has been called and it has not created the buffers yet.

    It throws a cast exception as it thinks a cast resulted in a null object when really the object was null to start with. I will try and sort that out but you may need to find which height query is doing it and make sure its not in a start function.

    @CaptainMurphy : Opps, sorry. Had to rewrite some of the underwater code as it had some issues. Looks like I created a new bug. Have fixed it and attached the fixed OceanUnderWater file. Can you try and add it to Cetos Shader folder and see if it fixes the issue.

    You need to change the file extension from txt to cginc as Unity wont let me attach a cginc file.
     

    Attached Files:

    twobob likes this.
  42. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Hmm. some camera weirdness, will continue to test.


    On another note - I see you have the exception handling done via System.

    I was hoping there might be a way of removing all the references to using System; if it was only used for the exception handling. that would save me another 1mb in the builds...

    Much obliged ;)
     
  43. CaptainMurphy

    CaptainMurphy

    Joined:
    Jul 15, 2014
    Posts:
    746

    Close, just got some speckles now.
     
  44. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804

    I think theres always been some specks. Ive seen them in previous versions and I know whats causing them.

    Im not sure why they have only just started to show up for you. Maybe something about the last version made them more visible.

    Regardless, I will try and find a solution.
     
  45. DivergenceOnline

    DivergenceOnline

    Joined:
    Apr 19, 2015
    Posts:
    244
    Hey dude.

    First off, thanks for all the help you've been giving on getting my system up and running with CETO.

    Second, while people are commenting how gorgeous it looks in our game, I didn't realize until just today, going through and trying to optimize the game as much as i can, going through the profiler with a fine-toothed comb, that the single biggest eater of framerates is apparently the planar reflection of CETO. It's huge. Huge, huge huge. I mean it's the difference between 25fps and 48, roughly 50% drain just for having it turned on.

    Is there anything i can do do chop this down? No combination of settings even seems to make any difference at all; Not even 1fps between the highest resolution with all options enabled and "everything" selected as a mask, and all options unchecked, resolution lowest, and only "default" as the layer.

    Thanks. Screenshot 2015-12-12 00.05.36small.png
    Screenshot 2015-12-12 00.08.34small.png
     
  46. scrawk

    scrawk

    Joined:
    Nov 22, 2012
    Posts:
    804
    Yes there are some things you can. Reflections typical have a big impact on performance as everything in them needs to be rendered a second time.

    So can you first set the reflection mask to nothing. That will only have the sky in the reflections. If that brings the frame rate back to normal then it's just a draw call issue.

    I dont know how your layers are organized but if you have not done anything special then everything will probably be on the default layer anyway which is why theres no difference between having the mask on default and everything.

    You need to go and decide what really needs to in the reflections. Make a special layer for those objects and only use that in the mask.

    Most games typically only choose to have the player, the terrain and any large object near the water in the reflections. Having all those trees may not be practical. At the very least have a layer for the trees near the water and thats it.

    Its also common to have a separate low res mesh of (especially for the terrain) those objects and use that for the reflections instead. The reflections dont need to use the normal high res mesh and shader as that normally kills performance.
     
  47. VirtualisDev

    VirtualisDev

    Joined:
    Jul 21, 2015
    Posts:
    30
    Hello,

    Simple question :


    Can parameter a main wave in amplitude and frequency with your system ?
     
  48. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Last edited: Dec 17, 2015
  49. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Not "directly" via the front end,
    Not sure if you could imply certain frequencies in the back end, with a lot of love maybe. It wouldn't be easy as far as I know
     
  50. VirtualisDev

    VirtualisDev

    Joined:
    Jul 21, 2015
    Posts:
    30
    I don't mean just a main wave, by tweeking wind and wave speed we can actually produce a sort of main wave, but is it with a constant frequency ? That's a part of my question.