Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Triton Oceans and 3D Water for Unity Pro / Windows [DEPRECATED]

Discussion in 'Assets and Asset Store' started by sundog, Sep 20, 2012.

  1. Jammars

    Jammars

    Joined:
    Apr 25, 2013
    Posts:
    2
    Hi there, I've downloaded the trial an am very impressed, I think this is going to be the solution for my application.

    I have a couple of questions:

    1. You mentioned earlier in this thread that it simulates Beaufort 1-9, however the scale is 1-12 (http://en.wikipedia.org/wiki/Beaufort_scale). Was that just a typo?

    2. The buoyancy examples don't appear to be in the trial download. Am I overlooking something?
     
  2. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    Hi Jammars, thanks for having a look.

    1. You can specify higher Beaufort scales than 9 (strong gale), but the results won't be accurate above 9. This is due to a mathematical limitation of the size of the FFT array we use. If you need to go higher than 9, you can configure Triton to use a larger FFT array, but it will come at a steep performance cost. In practice Beaufort scale 9 results in some pretty darn rough seas.

    2. Perhaps you're looking at our older Unity 3.5 demo? We stopped updating that awhile ago - make sure you're using the Unity 4.0 version if possible. There should be a cube floating in the water in the trial scene, with a buoyancy script attached to it.
     
  3. Jammars

    Jammars

    Joined:
    Apr 25, 2013
    Posts:
    2
    Thanks for the quick reply - you're right I had installed the older version as the .exe originally put me off.
     
  4. Gunhi

    Gunhi

    Joined:
    Apr 18, 2012
    Posts:
    300
    Could you please share the setting of this demo? I tried many times but I have not gotten that results like that scene?


     
  5. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    Hi,

    If you're talking about the wake, the settings will vary depending on the size, shape, and origin point of your ship model. This particular ship is 153 meters long and 20 meters wide and its origin at the stern of the ship. So, we set the length to 153, the beam width to 20, and the bow offset to 153. We left the prop wash offset at 0 since the origin is at the stern.

    There is also a sphere in our sample scene that leaves a wake behind it that you can look at.

    If problems persist, it's usually due to unrealistic or unstable ship velocities. Starting with a ship moving at a constant, realistic rate (say 10 m/s) and getting that looking good in calm water is usually a good way to start.

    If you want to send me a video of what you're seeing I can probably offer more specific advice. (support@sundog-soft.com).
     
  6. erichope

    erichope

    Joined:
    Dec 12, 2012
    Posts:
    4
    I'm evaluating this plugin for a project, and it looks, so far, like it provides all the necessary features except being able to run in a Web Player. Is there any chance of this being supported in the future, even in a limited fashion (only specific operating systems, browsers)?
     
  7. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    Unity doesn't allow native plugins in web deployments, I'm afraid. I hope you'll keep us in mind for your desktop projects however.
     
  8. erichope

    erichope

    Joined:
    Dec 12, 2012
    Posts:
    4
    Thank you for your quick reply! I knew it was a long shot for that reason, but since it hadn't been asked yet, I figured I'd broach the subject :)
     
  9. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
  10. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    You asked and we listened! Our initial release of Triton Oceans and 3D Water for Unity Pro is now available for Mac OS X. I have pictures to prove it:

    $Triton_SS_2.png

    There are some differences between the Mac and Windows version you'll want to know about described here - mainly they use different approaches for handling water / coastline boundaries. But, this should finally enable studios using MacOS for their designers to be productive with Triton.

    This did just come out, so definitely be sure to take advantage of our free trial and demo application for Triton on MacOS at our website prior to purchasing. We want you to try before you buy. If you do run into any trouble with it, please let us know at support@sundog-soft.com.
     
  11. Tom Stevenson

    Tom Stevenson

    Joined:
    Aug 21, 2013
    Posts:
    3
    Hi, recently purchased the package for use in our current project and I am very impressed, especially with the speed and low overheads of the simulation.

    I do have a couple of issues however, hopefully you can give me some pointers towards resolving them. Both are pretty much essential to the project.

    1. Rendering of particle effects: You mentioned finding information on a work-around to get a camera rendering after the triton simulation could be found in your documentation, I can't seem to find it however.

    2. Inputting a heightmap: The documentation on how to pass a heightmap to Triton has left me completely confused, entirely my own lack of knowledge of course. I've noticed Triton creates a "Heightmap camera" at runtime but I can't see what if any effect it has on shoreline water depth or on breaking wave effects.

    Seems like I'm missing something fairly obvious somewhere, but any assistance would be appreiciated. My dev pipeline is bottlenecked on this problem atm.

    Developing for windows standalone on DX11.
     
  12. plink

    plink

    Joined:
    Mar 23, 2012
    Posts:
    23
    Hi Frank,

    I've downloaded the Mac trial version of the package for evaluation but I'm getting a pretty serious performance hit so far. Right now, in a new project with nothing else imported besides Triton, I'm only getting 2 frames per second.

    I'm currently running Unity Pro 4.2.1f4 on OS X 10.8.5, my machine is a 3.33 GHz 6-core Mac Pro and my graphics card is an ATI Radeon HD 5870.

    Thanks for taking a look!
     
  13. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    We have found that Triton for Mac is having trouble loading some of its FFT acceleration dependencies, but a fix is currently being tested. Expect an update soon - I'll announce it here when available.
     
  14. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    Hi Tom, thank you for your purchase.

    I'm pasting the relevant part of the documentation on particles and other transparent effects below.

    There is nothing special you need to do with height maps, other than enabling the "Coastal Effects" option in the prefab. When this is on, Triton will render a height map automatically. If you terrain slopes below sea level, it will use this information to determine the water depth, and make the water more transparent near the shore. If breaking waves are enabled, this depth information will also control the breaking wave heights.

    I wonder if you're using an older version or older documentation somehow - any chance you're using the old Unity 3.5 version of Triton? If not, be sure to get the latest from our website or the asset store.

    Triton and Transparent Effects
    Unity's architecture only allows native plugins such as ours to render at the end of a Camera's rendering. This can lead to sorting issues with transparent objects, such as particle effects, since transparent objects should always be rendered last in the scene.
    The way around this limitation is to create a separate camera for transparent objects. If you assign your transparent objects to the "transparent FX" layer, you can then use culling masks and the camera depth order to keep transparent objects out of the main camera, which Triton draws over, and into another camera that draws after Triton. You'll need to ensure the "transparent camera" is kept in sync with the main camera's orientation by using the same camera controller, and that this transparency camera does not clear the color or depth buffers.
    An example project illustrating this technique may be found at http://media.sundog-soft.com/TritonRTTProblemTrans.zip
     
  15. Tom Stevenson

    Tom Stevenson

    Joined:
    Aug 21, 2013
    Posts:
    3
    Thanks for the swift reply.

    I had tried the coastal effects, but the water suface was still very transparent, crystal clear right to the bottom in fact. This is what led me to think it was not working.

    My terrain was made from y0 then the y axis dropped to -50 to give me 50m depth, would this cause the problem? And if so would altering the altitude setting of the prefab correct it. If not I can just re-do the terrain but I would rather not do that it if it can be avoided.

    I re-downloaded and imported the package yesteday so I should have the up to date plugin.
     
  16. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    That does sound like a plausible explanation - the water would be transparent if Triton thought the underlying terrain was at or above sea level. You might try instead changing the altitude of the Triton prefab as you suggested; that will effectively change its concept of "sea level."
     
  17. plink

    plink

    Joined:
    Mar 23, 2012
    Posts:
    23
    Thanks for the reply! I'll keep my eye on this thread.
     
  18. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    I've uploaded a new version of Triton for Unity Pro / Mac to our website, and hopefully it'll be available on the asset store within a few days. This new version should greatly improve performance on MacOS.

    It now accelerates Triton using CUDA on NVidia-based Mac systems, and falls back to using Intel's Integrated Performance Primitives on AMD/ATI systems for acceleration. We've also tuned Triton for Mac's configuration settings to be optimal on MacOS.

    The Windows version is unchanged from the previous release.

    Go get Triton 3D Oceans Water for Unity Pro here. There is a free trial version available there that allows 5 minutes of usage per run, as well as a standalone demo.

    Thanks for your patience everyone.
     
  19. Olafson

    Olafson

    Joined:
    Aug 7, 2012
    Posts:
    255
    Hey there!
    Do you think it would be possible to implement this system in a Multiplayer Game?

    The problem here, is that we would have to sync the waves etc. with all other players, so their positions are all the same?
     
  20. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    Yup, that shouldn't be hard. The waves are deterministic for a given time stamp, so you would just have to ensure the same time stamp is being used each frame for each player - something you'll need to do anyhow most likely.

    If you examine the Draw() method inside our TritonUnity.cs class, you'll see this line:

    UnityBindings.SetUnityTime (Time.timeSinceLevelLoad);

    If timeSinceLevelLoad isn't consistent amongst your players, just replace that with your own consistent time stamp.
     
  21. Olafson

    Olafson

    Joined:
    Aug 7, 2012
    Posts:
    255
    Awesome :) Thanks alot. Will probably purchase it tomorrow.
     
  22. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    Great!

    By the way, the new version of Triton for Unity Pro with performance improvements for MacOS users just got approved in the asset store. So, if you do purchase it, you'll get the latest version.

    A new batch of enhancements is already in the works, so stay tuned.
     
  23. Marionette

    Marionette

    Joined:
    Feb 3, 2013
    Posts:
    349
    Frank, quick question. I was just on your site checking things out and saw this:

    "Round-Earth support (WGS84 coordinate systems)"

    can you elaborate? would it be as simple as creating a sphere and applying the shaders to it (grin)?
     
  24. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    Hi Marionette,

    Generally speaking I wouldn't recommend using WGS84 coordinates with Unity. You will likely encounter precision issues with Unity that would make camera motion unstable, along with other challenges. But, to answer your question...

    There is a checkbox in Triton for "Geocentric coordinates." If you check this, the water surface will be drawn over the WGS84 ellipsoid, instead of an infinite plane at Y = sea level. So, instead of a coordinate system where Y = 0 represents mean sea level, and positive Y is "up", everything is relative to the center of the Earth. This means your coordinates end up being very large, and the "up" direction will vary depending on what part of the Earth you are over. Triton won't manage any of that complexity for you, but it will happily draw an infinite ocean covering the entire Earth, with the center of the Earth at 0,0,0, that you can place terrain etc. on top of. You won't actually see this ocean unless you figure out a point just above the Earth's ellipsoid, and place your camera there.

    So, it's simple to enable this in Triton, but it's certainly not simple to develop a terrain in Unity that is positioned and oriented correctly in a geocentric coordinate system, or to avoid jitter in camera and object motion that would result from the very large coordinates involved. There are tricks to mitigate this, but as far as I know Unity doesn't have them built in.

    Short story: I doubt it's worth the trouble. If you really need a terrain that covers such a large area that the curvature of the Earth becomes important to model, I'm not sure Unity would be my first choice of an engine for that.
     
  25. Marionette

    Marionette

    Joined:
    Feb 3, 2013
    Posts:
    349
    here's something kind of cool. I've got procedural planets generating fine via the cubed sphere methodology, Ideally, i'd love some sort of solution where the water shader is 4d, similar to my noise shaders for a sphere. that way I could literally create a sphere, apply the shader and then size the sphere around my planet to simulate ocean level and voila, instant planetary water ;)

    I have something almost working now with the built in unity water, but it looks a right mess along vertical alignments.. since planetary 'sizes' are relative given the viewpoint, this wouldn't necessarily be needed to scale to a literal planet size ;)
     
  26. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    Well... if you're feeling adventurous...

    You will find some settings inside of the TritonResources/Triton.config file that define Triton's concept of how big the Earth is. You can set smaller, non-realistic radii for your planetary ellipsoid that way, if you can assume that your planets are centered at 0,0,0 and remain a fixed size.

    In principle, setting those radius values consistent with your planet model and turning on geocentric mode may do the job for you. That's definitely something you want to try with our trial before you buy - you'd be breaking new ground in Unity there :)
     
  27. Marionette

    Marionette

    Joined:
    Feb 3, 2013
    Posts:
    349
    I already have the geometry as well as the noise etc: (I have them separated to show the segments)

    $cubed-sphere.jpg

    i'm working on the procedural texturing, vegetation and of course water ;)
     
  28. theLittleSettler

    theLittleSettler

    Joined:
    Jul 14, 2012
    Posts:
    36
  29. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    Thanks for using Triton! If I understand what you're showing us, this isn't really a bug so much as pointing out that the spray on impact feature can be expensive. When you enable "emit spray on collision" on an object with Buoyancy attached, we need to do an intersection test on each of the buoyancy voxels with the ocean surface every frame (which is expensive) and then spawn a new spray particle system when there is a hit (also expensive.) If you have many buoyant objects generating spray, this cost just gets multiplied again.

    The best way to reduce this overhead is to lower your slices per axis and voxels limit as low as you can get away with, while maintaining stable buoyancy. This will improve buoyancy performance in general. Often, if you make your box collider on the object shorter than the object itself, you can get away with fewer slices / voxels.

    You might also try making the spray particle effects less expensive by emitting fewer particles. To do this, open up the TritonResources/Triton.config file in a text editor, and find the setting for impact-num-sprays. Try reducing that number and see if it helps.

    Hope this helps.
     
  30. theLittleSettler

    theLittleSettler

    Joined:
    Jul 14, 2012
    Posts:
    36
    Thanks for the information, but I don't think that's what's going on.

    Particles should have been generated at the same rate at the start as at the end, therefore the cpu should show it basically consistent. I'm suggesting the particles (or something related to them) are not destroyed.

    Edit: just to add to that to convince you...I first noticed this with just three objects added to the example scene. It built up over several minutes.

    I'm creating a flood scene, with a large amount of debris so that info is sure to come in handy.
     
    Last edited: Dec 19, 2013
  31. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    There is a fixed-size buffer of spray particles. Once it fills, older particles get deleted and their slots re-used. So, I think reducing the size of this buffer will prevent you from reaching your CPU's limits before it fills. We also stop drawing particles after enough time has elapsed that we're confident they are below water, but if you are emitting new spray particles faster than this happens, you'll see CPU usage increase until that upper bound on the number of particles gets hit.

    Short answer: in Triton.config, lower the settings for wake-max-sprays and impact-num-sprays. I bet that helps.
     
  32. theLittleSettler

    theLittleSettler

    Joined:
    Jul 14, 2012
    Posts:
    36
    Ok, thanks. I'll see how it goes.
     
  33. veddycent

    veddycent

    Joined:
    Jul 22, 2013
    Posts:
    108
    Hey,

    Is it possible to add a public variable to control the transparency of the sea? If so how and where?

    Thanks for the help
    Regards
     
  34. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    The transparency of the water is a function of its depth. If you're not using the coastal effects option to automatically blend the sea with terrain, simply decreasing the "depth" setting on the Triton prefab will make the water more transparent.

    If you are using coastal effects, placing some geometry below sea level for it to blend with will cause it to become more transparent, as that geometry gets closer to the water surface. Adjusting the "below water visibility" setting will control how quickly the water becomes opaque with depth.

    Hope this helps!
     
  35. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    Check out our new demo video featuring the Triton 3D Ocean asset! It's a pirate battle scene created entirely with Unity Pro, using our Triton Ocean and SilverLining Sky 3D Cloud assets.

    [video=youtube_share;dMiBHSIR9AY]http://youtu.be/dMiBHSIR9AY

    A free evaluation is available. This video is designed to showcase many of Triton's features, including:

    • Thousands of simultaneous GPU-accelerated 3D waves
    • Beaufort scales 1-9
    • Buoyancy simulation of ship and debris
    • Foam and spray effects
    • 3D ship wake waves
    • 3D water displacement from impacts
    • Smooth coastline blending
    • Automatic reflections

    Enjoy!
     
  36. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    Also, here's a shorter, one-minute version of our new demo video for Triton. Enjoy!

    [video=youtube_share;ordh9UHfHx4]http://youtu.be/ordh9UHfHx4
     
  37. veddycent

    veddycent

    Joined:
    Jul 22, 2013
    Posts:
    108
    Hey, thanks for the reply.

    I was thinking of using that but the problem is that it effects wave heights when decreased in value. If there's no other way then it will suffice.

    Thank you for your time.
     
  38. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    veddycent, the waves get dampened as the transparency increases not only to simulate the effects of shallow water, but also to hide artifacts that can result from seeing through the waves to back faces that shouldn't be visible (it's complicated, but back face culling doesn't help in this case.) You're probably best of using the existing depth-based system for adjusting transparency for this reason.

    That said, if you are feeling adventurous, you could remove or adjust how waves are dampened with transparency by editing the flat-fft-patch.fx shader inside the TritonResources folder. Look for this bit inside the displace() function:

    float opacity = 1.0 - transparencyDepthBreakers.x;
    displacement.z = lerp(0.0, displacement.z, pow(opacity, 6.0));

    Commenting that out will remove the wave dampening with transparency. Be sure to back up this file before modifying it, as even small errors can make Triton inoperable.
     
  39. veddycent

    veddycent

    Joined:
    Jul 22, 2013
    Posts:
    108
    Thanks for the reply.

    Ah I see. I understood its purpose for shallow water when a height map is not available but didn't know about the back face culling artefacts.

    I have commented out the two lines of code but unfortunately it doesn't effect it, the waves are still dampened.

    Out of interest, why does back face culling not work? Is it because the mesh is transformed via the fx file and cannot use back facing culling?

    Thank you for the help.
     
  40. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    If you're using an older version of Triton, you may need to make that change in the flat-fft.fx shader instead of flat-fft-patch.fx. It should remove the wave height dampening (just tested it here to be sure), but you will still see the waves change as the depth gets small. The wave spectrum considers depth as one of its parameters, so you might end up jumping from being near a wave crest to a trough which might create the illusion of the waves getting smaller than they really are.

    That said, I do see the point that a simple way to just adjust the transparency and nothing else could be a useful control to have. We are right on the edge of the complexity a shader can have in DX9, but if we can add that in for our next release we will.

    As for why we don't render the mesh with back face culling - it has to do with viewpoints that are inside the zone between the wave peaks and troughs. As waves pass over the viewpoint, you might be seeing the "back" of the wave passing over you and the "front" of waves above you at the same time. With backface culling on, you just see big empty holes on the water surface in this case.
     
  41. veddycent

    veddycent

    Joined:
    Jul 22, 2013
    Posts:
    108
    That explains the reduction in wave height. With the issue with back face culling it would probably be best that the wave heights drop to give the user a clear view through the sea instead of seeing the "back" of the waves.

    Just to give a little insight. I'm building a model of an offshore wind farm for a client who have requested the ability to make the sea transparent to show the foundations and sea bed through the sea.

    I think that adding that would be a useful feature for future and current users of your great product :)

    Thank you for your help and time.
    Regards
     
  42. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    One thing I already have coded up for the next release is the ability to turn the water surface rendering on and off quickly at runtime. So if a fully transparent sea will meet your needs in that particular mode - you will definitely get that!
     
  43. veddycent

    veddycent

    Joined:
    Jul 22, 2013
    Posts:
    108
    Excellent!
    Thank you again
     
  44. AstroWolf

    AstroWolf

    Joined:
    Jan 28, 2014
    Posts:
    2
    Hey there
    I recently bought Triton for Unity Pro and when i drag the prefab into the scene and run it i crash to my desktop.
    I cant offer up anymore info than that. Anyone got any advice?
     
  45. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    AstroWolf,

    I just received your support email so I will take this issue offline. At a minimum we'll need a copy of your log file following the crash to get some sort of idea about what might be going on. We have seen some issues with the latest NVidia driver that we're putting together a patch for, so if it's that there is a workaround I can tell you about in the meantime.
     
  46. veddycent

    veddycent

    Joined:
    Jul 22, 2013
    Posts:
    108
    Just a quick one.

    Is there a way to extend the reflection cut off distance?

    Please image below:

    $Reflection.jpg

    Thanks
     

    Attached Files:

  47. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    Veddycent,

    Looks like you're using SilverLining, and just need to increase the scale on your _SilverLiningSky object. By default the sky dome only goes out to 1000 meters which looks like about the cutoff I'm seeing in that screenshot.

    Also - we seem to have resolved AstroWolf's issue. FYI if you are using DirectX9 and the new NVidia 332.21 driver, you may encounter problems until our next patch. The workaround in the meantime is to set disable-cuda=yes in the TritonResources/Triton.config file, or switch to DX11 if you can.
     
  48. veddycent

    veddycent

    Joined:
    Jul 22, 2013
    Posts:
    108
    Thank you! Worked perfectly.
    Didn't think it would be that simple to be honest but glad it was.

    Regards
     
  49. OrekaIngenierie

    OrekaIngenierie

    Joined:
    Jul 6, 2012
    Posts:
    67
    Hi i just buy triton i try to add a post effect on my camera, it seem to not work !

    I need to have on my camera a post effect to simulate under water distortion effect. How to do this.

    Thanks
     
  50. sundog

    sundog

    Joined:
    Dec 29, 2009
    Posts:
    429
    I'm not entirely sure what you mean by not working. Is the water disappearing or appearing inverted when your post effect is active, or is the effect simply not affecting the water (but is affecting the rest of the scene?)

    If the latter, try creating a new camera with the depth set higher than your main camera, matching the FOV and clipping planes of the main camera, and with a clear flag of "don't clear." Try applying your effect to this new, secondary camera. If the problem is that Unity was trying to apply your effect before it told Triton to draw the water, that might work around it.

    If it's the former, then Triton guessed wrong about when Unity flips the scene internally. If so let me know; there is a workaround for when that happens.