Trying out the 4.2.0 alpha Thin Film Iridescence

Lukas Stockner’s gonna put up a test file, in the meantime I wanted to try out the new thin film iridescence:


Used build blender-4.2.0-alpha+main.38fcaf9ab93f-windows. That’s a roundcube with verts randomly moved a bit (to give it some distortion) and a Solidify modifier. Thin Film Thickness 0.0 nm in the left image, 800.0 nm in the right image. Please note that I don’t really know what I’m doing or why pretty much any of this worked, just playing around.

v4p2p0alpha_Thin Film Iridescence_005.blend (142.0 KB)

screenshot.2024-05-03 10.00.15

@joseph for his slider.

Edited to add:

See this post for details.

Edited to add:

See this post for details.

12 Likes

Or not. :cry: I was hoping for a few examples of the thing producing the intended results – I couldn’t’ve managed a Droste Effect with the new Ray Portal BSDF without the example provided by david494’s, tv_scene_packed.blend.

1 Like

There’s a test file up now – not sure how much help it is given that this is the render result:

However, it did make it clear that the Solidify modifier I used in my earlier attempts was unnecessary / contraindicated. Removed that, set Transmission Weight to 1.0, scaled the bubble down to a more realistic size, and put the Thin Film Thickness back down to 400nm:

v4p2p0alpha_Thin Film Iridescence_007.blend (142.8 KB)

Alaska said about the Thin Film IOR: “ . . . why do I use a IOR of 1.33 while the original pull request uses a IOR of 1.7 for the soap bubble . . . the paper probably just used an IOR of 1.7 to exaggerate the effect. I used a IOR of 1.33 because that’s water. Maybe the IOR of a soapy water is 1.7 due to the soap?”

Several attempts with the Thin Film IOR between 1.33 and 1.70, both these test renders use the one that looked more soapy to me, Thin Film IOR 1.52.

Although the test file was (mostly) a bust, I found the text explanation informative, especially this bit:

  • Configure your Principled BSDF for your “base material” (what’s under the thin film)
  • In the case of a bubble, the “base material” is air. So that means setting transmission to 1.0, roughness to 0.0, and IOR to 1.0 or close to it.
  • Now you can add a thin film on top of your base material. >This is done by:
  • Setting the thin film IOR (soap bubbles are made out of soapy water, so I will use a IOR of water, 1.33)
  • And setting the thin film thickness (soap bubble typically range between 10nm, and 1000nm), so I will pick a value between these two that looks nice, or add some variable thickness with textures.
2 Likes

Also thought this one came out particularly snazzy:

Still Thin Film IOR 1.52, Transmission changed to 0.0, Base color HEX 000000.

20240511_v4p2p0_Thin Film Iridescence_009x.blend (3.6 MB)

1 Like

There are a few helpful IOR value lists out there – Wikipedia has one, but I think the most thoroughly useful for 3D one I’ve seen is Pixel and Poly’s here.

I’ve found none that have dish soap (what blown soap bubbles are usually made out of), or even any kind of soap. This article claims “ . . . A soap bubble would have a Refraction IOR of almost 1 . . . ” but it doesn’t seem like a good rec for the Thin Film IOR value.

Not a big deal, I’m pretty happy with my guestimate above. But if anybody knows it, or a link to more IOR values? Post ‘em if you got ‘em pls!

2 Likes

I guess these are still the reference papers from the last years.
https://hal.science/hal-01518344/document
and some IOR reference settings from this paper

for a colorful soapbubble you usally dont want a thinfilm thickness higher than 500-700 nm.Because the higher the thickness the more the colorshift effect vanish.

a quick soapbubble render

3 Likes

Come full circle. First link in this topic’s first post is the pullreq, first post of that links to the papers where they got the Thin Film calculations for this update to the Principled BSDF – those papers, that you linked there. In a later post in the pullreq Alaska (quoted by me above) disputes the 1.70 IOR from those papers, hence me wondering what it really is.

There’s a Soapbubble Wiki? There’s a soapbubble fandom that put up a soapbubble wiki?!?!? :exploding_head: That . . . did not occur to me.

Nice – I think the new Thin Film stuff’s gonna be a lot of fun.

3 Likes

Anything that could have a wiki, has a wiki

4 Likes

Benzene water puddle.Barrel from polyhaven.

5 Likes

Map Range for the Thin Film Thickness, geez that looks realistic! :clap:

So a soap bubble film is generally thinner on the top and thicker on the bottom. I used a Gradient node into a Map Range node (thanks pixelgrip!) for 240nm at the top to 640nm at the bottom. Lighting is a Nishita Sky node in World, closest Blender comes to “sunlight with a normal angle of incidence”. The colors came out remarkably similar (IMHO) to what the chart at the wiki shows for that nanometer range:

Used a Noise Texture node to get some distortion in the film kinda like the photos show. This is on a UV Sphere shrinkwrapped to the distorted roundcube I was using in earlier tests – needed the UV map to get the noise to wrap the way I wanted it to. Rendered in 4.2.0-alpha+main.4a1597e39adb-windows.amd64 from the Daily Builds page.

20240513_v4p2p0alpha_Thin Film Iridescence_005.blend (178.9 KB)

5 Likes

No soup is generally thicker at the top due to croutons.

Liking these tests so far though!

2 Likes

Dang it, it passed the spellcheck! :roll_eyes: Thx.

1 Like


Another benzene puddle

5 Likes

I wish there was some sort of “strength” setting for this. How did you get those lovely saturated colours?

I tried using Khronos PBR Neutral but even then ended up adding 2 shaders for it to stand out.

3 Likes

The first barrel render has a seperate “disc” mesh with a transparent thin film material,to simulate a benzene water mix.

At the last saturated render i dont used a seperate disc.I used only the barrel with its material as is and i added just the thinfilm settings to it (the thickness map).And i lowered the roughness map to 0.1 with a math multiply,to get a more reflective wet look,thats all.

In my “old” thin film node group renderings ,where the thin film output was the color,you could tweak it a bit with the color node for more sat or value etc.I think this is more difficult to do with the principled thin film as you know.

I think the problem with the desaturation is the transparency.Or how the shader handle the color with transparency.If you look on photos from real soap bubbles,they can look quite colorful.Real thin film has outside fresnel white reflection plus the colorful internal reflection from the thin film layer.

here the saturated barrel setup.I used thickness values starting from 0.this way you get no thin film effect at these parts,and the material color itself is rendered then.

3 Likes