15

I made an ocean using the ocean modifier, and placed into the ocean a floating object - basin, using this lesson: https://www.youtube.com/watch?v=11F1NRpqrzY

How to make water not pass through the bottom of the basin?

enter image description here

Ulf Aslak
  • 541
  • 3
  • 13
Rumata
  • 2,697
  • 7
  • 34
  • 70
  • Thank you very much, @Chebhou it would be just what i need but I faced a strange problem using this method. For some reason, if the object have "no cap,", if there is no plane above the surface of the water - it draws bad indinamic paint mode . Why is this happening and how to fix it? – Rumata May 01 '15 at 21:07
  • @Chebhou I found this problem after I chenged dinamic paint mode from "displace" to "paint". I did it, because I could not understand, why does this method works bad in my case. – Rumata May 01 '15 at 21:17
  • @Chebhou Here are two screenshots to make clear what i mean. In the first screenshot the sphere has a polygon on top:

    http://www.pixentral.com/show.php?picture=1GXnjmTMWSLhJQtfedxzjvFPeSPIoe

    In the second screenshot the sphere has no polygon on top:

    http://www.pixentral.com/show.php?picture=13HgzaxI4ziBIyHfVU7xJhD4zDRsi

    – Rumata May 01 '15 at 21:23
  • since the object you are using is circular it could work if you change the Paint_source to Object_Center and adjust the distance until you get a good result – Chebhou May 01 '15 at 23:01
  • Thank you, @Chebhou! But how to make the Object_Center to be the center of the pelvis and not the center of the ocean? I check the "Object_Center" in the settings of the pelvis (it is dynamic brush). But as a result, it began to draw not near the center of the pelvis but near the center of the ocean (there was the center before I added repeat x and repeat y) http://www.pixentral.com/show.php?picture=102bf4agkeunWtXQWAhKj6pOauIPUq1 – Rumata May 02 '15 at 09:17
  • @Chebhou Sorry, this is ridiculous translation mistake))) I did not mean pelvis but basin – Rumata May 02 '15 at 09:36
  • @Chebhou http://www.pixentral.com/show.php?picture=1upCtXFkxI1SgJLw8tCL6B77HMhuo1 – Rumata May 02 '15 at 11:08
  • 1
    the dynamic paint modifier should be under the Ocean modifier, and you should check "dissolve" option and set small number – Chebhou May 02 '15 at 12:45
  • I think it should be possible to do so by turning on the "Collision" setting in "Physics". – Mark Nixon Jun 21 '15 at 22:01

1 Answers1

3

You can create an object of a shape similar to your floating object (bowl, boat, whatever) but lower-poly. Then select your ocean object and add a Boolean Modifier. The Operation mode should be set to Difference, and the Object slot should of course be set to your low-poly boolean object. Normals must be facing the correct directions or you'll get unexpected results.

Here is a screen shot of my test doing this with a simple cylinder:

Object with a subtractive boolean on an ocean

Now there are just a few more things to do.

  1. Prevent this boolean object from being rendered.

You can do this by finding the object in the Outliner and turning off visibility for the render, and for the viewport if you like (although this makes it no longer selectable).

In my screen shot I have set the Maximum Draw Type to Wire, and that's why I can still see and select my boolean object. However this leaves it visible during viewport rendering, so to fix that I simply gave it a material with a Transparent shader (with the color set to white for full transparency).

  1. Parent it to your original floating object, so it moves with it.

Pretty straightforward. Select your boolean object, then select your floating object and press [Ctrl P]. Set Parent to Object.

  1. Fix possible issues with ugly shading on the geometry of your ocean where it touches the boolean object.

With your ocean object selected, navigate to the Mesh Tab. Check the box for "Auto Smooth". Also, in the Tools panel set the object's Shading to Smooth.

Mentalist
  • 19,092
  • 7
  • 94
  • 166
  • I tried this solution, it's not practical for me. The rendering time jumped from 0.6s to 15s for a frame (for a 1200 frames animation this would be going from 12mn to 5h), just by adding the boolean to the Ocean object. – mins Oct 19 '15 at 20:26
  • I see. This is because the Boolean has to calculate all the verts of the Ocean object in each frame and remove some of them. A couple of things you can try: 1. Reducing the Boolean shape to a simple cube. 2. Lowering your Ocean resolution. 3. Take a compositing-based approach instead. 4. Use a Shrinkwrap Modifier on the Ocean instead - if carving out of the ocean takes too much time, instead just suck the ocean down in that spot. This is the alternative I would try first. Add a low-poly object like a Cube under the Ocean, make it the Target of the Shrinkwrap, and set the direction to Negative. – Mentalist Oct 20 '15 at 00:08