KeyShot Forum

Technical discussions => Materials => Topic started by: cjwidd on October 25, 2017, 08:33:16 PM

Title: Oily film on liquid
Post by: cjwidd on October 25, 2017, 08:33:16 PM
I've spent a couple days trying to nail this material but coming up short. I then cruised the forum and searched online, but haven't found a solid answer.

Trying to recreate thin-film interference that occurs on the surface of coffee (see attached); unfortunately, you cannot pass the thin film shader (oil) into a dialectric (liquid coffee).

EDIT: Best solution I've found is to take an existing hi-res roughness map and use the 'liquify' filter in Photoshop to create the swirling pattern.
Title: Re: Oily film on liquid
Post by: Will Gibbons on October 26, 2017, 01:10:56 AM
I would say that yes... using an image-based texture is a good start. But, you could try applying a metal label to the top of the liquid... then apply an opacity map to the metal, so it's more subtle.
Title: Re: Oily film on liquid
Post by: Will Gibbons on October 26, 2017, 01:11:22 AM
Quote from: Will Gibbons on October 26, 2017, 01:10:56 AM
I would say that yes... using an image-based texture is a good start. But, you could try applying a metal label to the top of the liquid with a view-direction color gradient... then apply an opacity map to the metal, so it's more subtle.
Title: Re: Oily film on liquid
Post by: cjwidd on October 26, 2017, 01:14:08 AM
Yeah, I'm still working on it (see attached). I'm actually trying something like this^, only with a transparent plastic instead. I find lighting - as usual - goes a long way to achieving the desired result, but it's also about matching the transmission color of the plastic, roughness, etc.

v0
Title: Re: Oily film on liquid
Post by: cjwidd on October 26, 2017, 03:29:40 AM
v1
Title: Re: Oily film on liquid
Post by: cjwidd on October 26, 2017, 04:56:09 AM
v2
Title: Re: Oily film on liquid
Post by: cjwidd on October 26, 2017, 05:22:31 AM
v3

Title: Re: Oily film on liquid
Post by: DMerz III on October 26, 2017, 11:11:26 AM
This is a great exploration! It is amazing to me that we've come this far to start looking for ways to solve this realism. Keep it up
Title: Re: Oily film on liquid
Post by: cjwidd on October 26, 2017, 03:23:55 PM
Yeah it was a challenging material for me, but it's funny how you can achieve a complex material with a relatively simple graph.
Title: Re: Oily film on liquid
Post by: Will Gibbons on December 18, 2017, 02:20:18 PM
Not sure how I missed where this went, but I love the result. Very nice. Well-done. Did you ever create a final rendered piece? I'd love to see the final.
Title: Re: Oily film on liquid
Post by: cjwidd on December 19, 2017, 12:43:33 AM
Really appreciate it, thanks! Also, thanks for the Efficient KeyShot User - Materials webinar, very nice.

I got distracted with some other tasking and sidelined the project temporarily. I'll post final renders to the Amazing Shots thread when they are ready.

When I did return to the material, I realized there was an issue that just wasn't resolvable using the matgraph above: I'm passing a transparent material into the main material as a label - it is transparent, and as such, you can see the inside faces of the other piece of the liquid based on the mask; following the method described here (https://youtu.be/HlxF9peYod0?t=37m16s). A backface culling mask did not help matters.

As it seems to happen when I'm developing a seemingly complicated material, I end up with a fairly simple matgraph, which in this case consists of multiple combined bump maps and a roughness map. You can see where I left off in the attached image.
Title: Re: Oily film on liquid
Post by: Will Gibbons on December 19, 2017, 08:22:50 AM
In regards to issues with transparent labels.. correct. This is why I avoid them at all costs. I'll try a duplicate surface offset by a very small amount (.1mm) or using opacity to make an opaque material appear more transparent. You may be able to get some improvements using the gem material in place of liquid at times.
Title: Re: Oily film on liquid
Post by: cjwidd on December 19, 2017, 07:38:20 PM
Will, I'm experiencing some sort of artifacting on the inside face of this glass material. It looks like a low res reflection from an adjacent piece of geometry. Can you identify this?
Title: Re: Oily film on liquid
Post by: Will Gibbons on December 20, 2017, 07:18:20 AM
Hmm. Assuming you have enough Ray Bounces (default of 14 should be plenty), I think this has to do with the geometry and some co-planar faces... how is the glass modeled?