So I’ve been trying to fix this strange problem with no success:
I’ve setup a simple scene, a square domain, a container in that domain, fluid in the container, and a object that will impact the fluid. Trouble is, when I press Bake, the domain changes into this strange blob form, seemingly ignoring the obstacles and the location of the fluid, and the domain boundaries. What is going on?
untitled.blend (547 KB)
Fluids are a little counterintuitive if you don’t read up on them in detail. The domain is the fluid. Sort of. The fluid object you placed inside it is more like a marker for properties like volume and initial velocity. The domain’s original shape still forms the bounds of the simulation, but the mesh of the fluid comes from the domain.
As for why obstacles are being ignored, we’ll have to see your .blend file. There are a number of reasons this could happen.
Added .blend file to original post.
–Is there any way to see the original domain after the bake? I see that sometimes it will briefly flash on the screen when recalculating. But if I try manipulating the the “domain object” it uses this new blob.
Don’t worry about seeing the domain. There’s no need.
There are several problems here. First, you have scaled objects but not applied their scale. That always causes problems. Object>Apply>Scale.
The second problem is that you’ve used a cube as your fluid object. It’s best to use an icosphere from all I’ve ever seen.
The third comes down to resolution. Your simulation has a very low resolution, so it won’t be accurate. At this scale, the thickness of the obstacle is also probably too thin. For fluids in a container, it’s best to make an invisible duplicate with much thicker walls, so it only seems to be interacting with the container you want to see. I’ve attached a modifed .blend to demonstrate this for you. When you bake the simulation, note that it still looks like it’s coming through the sides a little bit. This is because I only bumped the resolution from the default 65 up to 100, which is still pretty low. But you can still see the improved interaction between the fluid and the container. You might also try subdividing the container a few times to give it more geometry to work with. A plain cube doesn’t give it a lot to compute.
Oh, and in that .blend, I moved the fluid object to layer 4, which isn’t currently visible. No need to see the icosphere in the final simulation, but you should know where it is. Here it is.
Ah, very thorough, thank you very much. If you don’t mind, I do have 1 more question…Do you know how to / have you ever applied a image texture to the fluid sim? I’ve been trying (in cycles) but the rendered fluid turns up black. I’ve used texture nodes in Blender Render and have used textures with “normal objects” in Cycles, but I can’t get any image color when trying this with the fluid sim (other than using RGB Input).
I haven’t tried, and I’m not sure why you would. Usually if you’re mapping an image onto a mesh, you’re mapping it to specific points on the mesh, as in UV unwrapping. A fluid’s mesh is completely dynamic, and an image is static, so what would you even map it to? Aside from that, I don’t even know what the advantage would be over just creating a good material with shaders.
Its a little convoluted, but here’s what I’m looking to do:
-Originally, I was looking to make an animation of an “object splashing into water” say a cannon ball / projectile. This animation would then be used in Unity 3D for when players miss their shots and the ball/projectile would land in water.
-So I got the fluid sim going (not the one I used in this thread) with an inflow, obstacles, etc to get a good splash, and all was well.
-But I noticed that the default “blender water” clear color, didn’t look very good when placed in the game scene (since its color was so far off from the ocean planes it would be spawned from). I tried just playing with the fluid color, but it was way to uniform and still didn’t match the colors of the ocean planes very well.
-At that point I wondered if I could just apply a texture to the fluid sim (the texture being one of the ocean planes) so it would color match well and would “look more dynamic” by virtue of using the detailed ocean textures I had.
-Your point about fluid being very dynamic, and perhaps being impossible to “texture” is well taken. Though I’ve also animated regular planes with displacement mods and null objects, which can warp the mesh fairly severely when dialed up …so I thought that perhaps it would work with fluid also (though what would happen when pieces break off and become truly 3d I had no idea what would happen).
–I attached a link to a video that is sort of what I was looking to do (wait for some of the larger splashes), but I wanted to use blender instead of a more traditional animated 2d sprite.
Hmmm. For splashes like that in a game, a fluid sim is probably overboard. Particles instead maybe? When you get into game engine stuff though, you’re beyond my knowledge.
It probably is a bit much, I gave it a shot though because I’m using the smoke sim for gun blasts (1-because the angles I need are awkward for normal particle systems 2-they look gorgeous). I’ll look into blender’s regular particle system more, and Unity has its own particle system also (which is nice, but you won’t get the almost photo-realistic results you can get with external programs).