Air bubbles inside liquid

Use this forum for general user support and related questions.
Forum rules
Please upload a testscene that allows developers to reproduce the problem, and attach some images.
Post Reply
User avatar
MetinSeven
Posts: 137
Joined: Sun Aug 18, 2019 10:19 am
Location: Netherlands
Contact:

Air bubbles inside liquid

Post by MetinSeven »

Hi,

What’s the correct way to create air bubbles inside liquid?

Right now I’ve got the normals of the air bubble meshes inverted inside the liquid mesh, but it looks odd.

Maybe the right way is to not invert the air bubble normals, but assign a separate material with an IOR of 1.0 to it?

Thanks in advance for your help.
visualizer • illustrator • animator • 3D designer — metinseven.nl
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Air bubbles inside liquid

Post by B.Y.O.B. »

Can you show a picture and maybe upload a small testscene?
User avatar
MetinSeven
Posts: 137
Joined: Sun Aug 18, 2019 10:19 am
Location: Netherlands
Contact:

Re: Air bubbles inside liquid

Post by MetinSeven »

Sure. I've attached the scene.

Maybe it's correct, but I'd expect the air bubbles to be lighter instead of darker.

Maybe it's caused by the blurry glass rays?

Any other LuxCoreRender advice, such as the optimum settings for caustics, and light strength vs. scene scale, are also very welcome.

Thanks!
Attachments
Air bubbles.blend
(390.2 KiB) Downloaded 157 times
visualizer • illustrator • animator • 3D designer — metinseven.nl
zeealpal
Posts: 59
Joined: Wed Jan 10, 2018 12:25 pm

Re: Air bubbles inside liquid

Post by zeealpal »

MetinSeven wrote: Thu Jul 09, 2020 8:46 pm Hi,

What’s the correct way to create air bubbles inside liquid?

Right now I’ve got the normals of the air bubble meshes inverted inside the liquid mesh, but it looks odd.

Maybe the right way is to not invert the air bubble normals, but assign a separate material with an IOR of 1.0 to it?

Thanks in advance for your help.
Ideally, I would create two separate materials. LuxCore has the concept volumes being separate from the material, and you can assign different volumes to the interior or exterior of a material.
Capture.PNG

To create this I used 2 volumes:
- Air: IoR 1.0, Priority 1
- Water: IoR 1.33, Priority 0 (default)

When volumes intersect, the higher priority volume is used. That way the bubbles can be modelled as usual, with normals facing outside.

Using the volumes for these materials:
- Water: Glass, Interior 'Water', Exterior 'Air'
- Air: Glass, Interior 'Air', Exterior 'Water'

When the water and air volume intersect where the bubbles are, the air volume is used as it has a higher priority.
Attachments
Air bubbles.blend
(288.47 KiB) Downloaded 184 times
User avatar
MetinSeven
Posts: 137
Joined: Sun Aug 18, 2019 10:19 am
Location: Netherlands
Contact:

Re: Air bubbles inside liquid

Post by MetinSeven »

Very interesting, thanks a lot! LuxCoreRender obviously needs a more scientific way of thinking, I like that.
visualizer • illustrator • animator • 3D designer — metinseven.nl
User avatar
MetinSeven
Posts: 137
Joined: Sun Aug 18, 2019 10:19 am
Location: Netherlands
Contact:

Re: Air bubbles inside liquid

Post by MetinSeven »

If I'm not mistaking, you can leave away the volume nodes in the water material. Only the air material needs both volume nodes.
visualizer • illustrator • animator • 3D designer — metinseven.nl
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Air bubbles inside liquid

Post by B.Y.O.B. »

Some notes from my side:
  • You don't need volumes for this particular case, using a single material and inverting the bubble normals is fine. Volumes are mostly required if you have more than one transmissive medium interacting with each other. However, they are also required for volumetric effects (absorption, scattering) which is why I used a single volume for the water material here (see below)
  • For physically correct absorption, use a volume with absorption color instead of the glass transmission color. It vastly improves the realism here, because the transmission color is simply applied at each bounce, while the absorption color takes the distance traveled into account and is independent from the bounce count.
  • This particular scene doesn't require "add light tracing" or the caustics cache, so I turned them off
  • I wouldn't use rough glass for water, but that's a matter of artistic decisions for the desired result
  • To capture all relevant specular bounces in the glass, you might need to raise the total and specular depths. In this scene I raised the depth step by step during a viewport render, until all black spots were gone. I ended up with 10 required bounces.
Attachments
bubbles.jpg
Air bubbles (1).blend
(297.86 KiB) Downloaded 163 times
User avatar
MetinSeven
Posts: 137
Joined: Sun Aug 18, 2019 10:19 am
Location: Netherlands
Contact:

Re: Air bubbles inside liquid

Post by MetinSeven »

Thanks a lot Simon! I'm learning more and more about LuxCoreRender, and like it more and more too!
visualizer • illustrator • animator • 3D designer — metinseven.nl
User avatar
MetinSeven
Posts: 137
Joined: Sun Aug 18, 2019 10:19 am
Location: Netherlands
Contact:

Re: Air bubbles inside liquid

Post by MetinSeven »

Here's the end result. Thanks again for your help.

Have a nice weekend!
Attachments
metin-seven_3d-print-modeler-toy-character-designer_cartoony-water-dragon-monster.png
visualizer • illustrator • animator • 3D designer — metinseven.nl
Post Reply