I am using the fluid simulation in Blender Cycles to poor milk onto a cylinder. It is going pretty well, except when the milk is rendered there are a lot of dark spots on it, and I’m not sure why. Here is a picture showing my problem:
I have found that if I apply the fluid modifier the black spots will still render. However as soon as I go into edit mode after it has been applied, and then back to object mode the black places are gone. However, this obviously will not work for rendering an animation. I also found that if I give the fluid a subsurf modifier that the black places will disappear, which would work fine except that it increases the vertex count 4x, which in turn will probably also increase render time. If anyone had any other ideas to get rid of the black spots for an animation, that would be very helpful.
It looks like it could be related to whatever material you’ve got on the milk. Volume, SSS, glossy, glass and similar shaders depend on the normals of the faces. The fluid sim might be screwing up some normals occasionally, and going in and out of edit mode recalculates them.
Check if these spots still appear with a plain diffuse shader. If they don’t, then it is indeed the material causing them and there are some little tricks you could try to prevent them.
By the sounds of it, the black spots are simply due to using the smooth mesh setting on a low poly/sharp corner edges, hence why subdividing it fixes the problem.
Gregzaal: I also thought that it might have something to do with the milk material, but I already tried changing it to a regular diffuse material, but the problem persisted.
Zeealpal: I think you’re right, because the black spots only appear wherever the edges are very close together, but the resolution of the fluid simulation is set to 250, which is very high (creating a lot of geometry) so it is surprising that making the mesh smooth would cause that problem.
I will keep trying to find a solution, but if not then giving it a subsurf modifier isn’t too bad, it just makes it slower and a bit harder to work with.
Ok, I think that I found the problem! In the Fluid Boundary section of the fluid settings, I had the subdivision set to 1 and the smoothing to 2.5, and I think that having a smoothing value this high was causing it to mess up on the really thin pieces of milk. I set the subdivision to 2 and the smoothing to 1 and baked the simulation again and this is what it looks like:
Also I found that even if I set the smoothings to 2.5 but turn up the subdivision to 2 it will still not render the black places. I guess you just can’t set the smoothing too high without turning up the subdivision too.
Here it is with a subdivision of 2 and smoothing 2.5: