Ocean foam flickering outside of the simulator

Please see this video here: https://www.dropbox.com/scl/fi/1a2tvj68n5qkuclfy24oe/Foam\_flicker\_and\_disappear.mp4?rlkey=ef3t93wp3m0y3bmo460otnv9h&st=1ua6objz&dl=0

Better download the video from the link, as the online player is downgrading the quality a lot, and the issue is not as noticeable.

It’s a simple scene with just the ocean and a ship. The lighting is made by an HDR dome. Only the foam is rendered in the video. I’ve hidden the splashes and mist to see the issue better. There are actually 2 issues. The foam is flickering in terms of brightness, and then the particles are randomly disappearing and appearing in the form of long stripes. All of that is happening outside of the liquid simulator. Inside it’s all good.

Here’s a screengrab of my foam shader:

I was able to solve the brightness flickering by increasing the vertical offset by 0.1m, but the particles still keep on randomly disappearing and appearing. Like this: https://www.dropbox.com/scl/fi/15fw1sio7o3onltempnvp/Foam\_disappear\_verticalOffset-0.1m.mp4?rlkey=aojgpqnk6zl9mwq8uef6132t1&st=sydc8am0&dl=0

By the way, for the vertical offset, I used the wonderful hidden switch “vertoffscond”, created by Svetlin Nikolov, to offset only the particles outside the simulator. You should definitely make it exposed in the UI in some next version.

Other than that, I tried some other settings of the foam shader, but nothing really seemed to help. I even tried rendering the ocean in a Cap Mesh mode, just to see if the water isn’t somehow killing the particles, but the same thing happens: https://www.dropbox.com/scl/fi/852z2tmfxc51u7uqqtgw4/Foam\_disappear\_CapMesh.mp4?rlkey=xwymek0gr1d0i8itdwq1pt9i2&st=8jqynue4&dl=0

The particle simulation itself should be fine because in the viewport it looks good: https://www.dropbox.com/scl/fi/wajq5lwmpjtjg8lzk0mdq/Foam\_viewport.mp4?rlkey=cb0uxfy5jxxihczcdekkx9gee&st=bkwsu6tl&dl=0

Also, if I change the foam shader to render as points, then it doesn’t flicker or disappear anymore. This is what it looks like: https://www.dropbox.com/scl/fi/u8qtafezzxkmedbp2h596/Foam\_points.mp4?rlkey=pesxra6iha67t62ov17j3c5uo&st=ky2a3lla&dl=0

However, I’d like to avoid using points because, as you can see in the video, the render quality is not as good as with the bubbles. Also, in my shot, the camera is moving from an overhead view smoothly to a close-up, and there the points wouldn’t really work.

Is there anything else that I can try to solve the disappearance of particles?

Oh by the way, I did all the rendering with the latest stable v5.23.00. I tried to render with the latest nightly build 33084, but 3dsmax would crash to desktop as soon as I hit the render button.

Hello,
Can you send a simplified version of that scene here?
support.chaos.com

Hi Zdravko, you can find the scene file at the support request number 375224. Let me know if you need any more info.

I simplified the scene as much as I could. Leaving only the liquid simulator, vray plane underneath, one HDR dome and a camera inside the scene. I rendered the first 10 frames just to confirm, and it is flickering.

Please check and let me know.

By the way, I found out that if I raise the vertical offset by 1 meter, it doesn’t flicker anymore, so it is a kind of a workaround I’m using right now, but it would be great to know what is actually going on there, as 1 meter offset is brutal…

Thanks a lot for looking into it!

Hello David, I’ve been looking at your scene, and it seems that the issue is caused by the particle shader’s inability to determine if the bubbles are above or under the water. It happens even if the Phoenix grid is not renderable and even if it is set to a regular ‘Mesh’, instead of ‘Ocean Mesh’. The issue is no longer visible if the ‘Liquid Simulator’ option is switched off inside the shader settings.

The reason for this behavior, and the pattern at which this happens (the long stripes/lines) could point to a potential bug. The scene will be logged into the system, and the developers will look deeper into the cause.

It could also be corrupt cache files or a compression issue. Unfortunately, I can’t resimulate it, since I don’t have the object or other needed elements. If you could test it with particle compression turned off and check if the issue persists, it would be really helpful.

Apologies for the inconvenience!

Hi Zdravko, I did a new simulation (less resolution this time to have it done sooner), but the problem remains. As soon as the foam leaves the simulator, it starts flickering. Please see this video: https://www.dropbox.com/scl/fi/0lq4vzz016r19it5iucxc/Foam\_disappear\_newSim.mp4?rlkey=fy0dbe0vy9ujbja3cdo6w3zmy&st=is9il1eb&dl=0

This is rendered with the latest Phoenix 5.24.

If it would help, I can send you a scene together with the boat model used for the simulation? So then you can do the simulation yourself. Let me know! Thanks!

Hello, hello?

Hey,

This looks like a bug and unfortunately it’s not something that we will be able to solve quickly I’m afraid. The workaround that I can suggest would be to make the simulator longer so that the foam can fit inside, though this will increase the simulation time.

Hi Georgi,

I see. Thank you for looking into the issue and hopefully having a quick fix.