Can someone help me create this liquid shader in Firefly?
I'm trying to make a shader that looks like this hair cream. The only difference is I want it to be milky in some areas while mostly transparent in other areas.
What is a list of nodes I need to use for FireFly?
I think I need to use:
- Sub surface scattering
I'm not sure how to specify the diffuse texture so it's white in some areas and mostly clear in others.
If someone can even point me to a thread where someone has unlocked the secrets of liquid cream in Poser and bringing it out through the power of FireFly.
@zazop I'd use the Cycles Volumetric Scatter node plugged into the Cycles Root Volume input, which I found very effective at replicating water vapour (having wasted time trying Volumetric Absorption)
If you're after something like saliva, I have this example, which also works in both FireFly and SuperFly, with some caveats:
The Fractal_Sum in the transparency is giving the transparency vs cloudiness.
The compound Dispersion node uses a @bagginsbill technique to fake refractive colour separation (dispersion) with different IoR for the three primary colours.
You could certainly try combining the two techniques, using the Cycles Root, since the GlassBSDF nodes in the Dispersion will give glossy surface reflective effects which wouldn't be appropriate for my water vapour example.
@anomalaus That's for Suprefly only isn't it?
@zazop Drat! Sorry, I've just tested this and the cycles nodes don't appear to work in FireFly renders, sorry. I will have to dig up the FireFly shaders I was using prior to P11 for saliva, but I don't think they attempted to fake dispersion.
The transparency technique with the Fractal Sum node is still valid, though.
Again, apologies for inadequately parsing your requirement for a FireFly shader.
[Can't say I remember ever seeing a request for Custard shaders before ;-)]
@zazop OK dispersion is absolutely nicht und verboten in FireFly (until SM implements it), unless you fake it with colour ramps and sphere maps and ... forget it. Just, no (I've spent the last 45 minutes trawling threads from 2007 to 2012 where @bagginsbill dispenses his pearls and diamonds of FireFly wisdom). P11 won't actually let me do the things I used to do in P10 and earlier, like plugging a Refract node into a Component node to colour split the refraction into red, green and blue, with appropriately adjusted indices of refraction for each primary colour's Refract, before recombining them to simulate the fake dispersion I was doing in SuperFly. The connection between the Comp and Refract node shows up as dotted, so you just get black when rendered. Boo!
On the other hand, P11 FireFly has a Volume input on the standard PoserSurface root node, to which you can connect a Volume node (found under Lighting:Special), which has the Scatter options you want. I'd set the Absorption Density and Emission Strength to zero, and plug a texture map or Fractal_Sum node into the Scatter Density input to decide where you want scatter or transparency. That same texture/fractal_sum can plug into the transparency input of the root node, with a value of 1 or a bit less. That ignores wanting to see proper refractions and surface reflections, but give that a try and see whether you get the scattering you want, first.
@zazop I'm sorry to hijack your thread. I promise to get back on track soon with useful FireFly shaders, but I just had an epiphany about all the things the original shader was doing wrongly for any kind of realistic, heterogenous fluid.
The most irksome thing is the trap of leaving the PoserSurface root node, which led me completely astray. There is no such thing as a completely transparent fluid or solid (unless you include hard vacuum, which does have a refractive index of exactly 1.0). The kind of transparency that the PoserSurface node offers overrides the refractive effects of non-opaque materials, as the light rays will pass through without changing direction at all. That's just wrong.
So, to clear the deck, I started from just the Cycles Root node and built up from there (I promise I'll get to a FireFly version in a bit).
gives this effect:
The Transparency_Map node matches the prop the shader is designed for, and has black where you want clear fluid, and white where you want translucent fluid (matching your curl custard).
The first Mix_Closure is taking the Shadow Ray status and driving @bagginsbill 's tricky glass transparency helper.
The second Mix_Closure uses the Transparency_Map to select Translucency (the real key to hair goop, or milk, etc.) or clear fluid exhibiting fake dispersion (still can't think of a way to make this happen in FireFly without an enormous retainer fee for Messers Penn and Teller).
Since the translucent areas aren't having to deal with refraction, they don't get any of the dispersion or the last feature:
Volumetric absorption is applied to the clear fluid, so you can emulate coloured liquids or solids (and it also colours any light transmitted through and out the other side.
I'm really quite a lot happier with this now that I've stopped trying to make a hybrid render engine shader.
Now, FireFly (as promised).
The key realisation from this, is that translucence is already built right into the PoserSurface root node, when using FireFly. The Translucence_Color chip just needs to be white (or whatever the scattering colour of your fluid is) and the white=scatter, black=transmission image map or fractal_sum node or whatever plugs straight into the Translucence_Value.
If you want reflective effects on the whole surface (as your goop appears to have), then plug a Raytrace Reflect node into the Reflection_Color input. This doesn't need to be gated with... [TL;DR]
Here's a FireFly shader:
and Raytrace Preview:
which I think isn't too bad. I had to turn on a posing light as the scene wasn't set up for a FireFly render (Cycles shaders everywhere else).
More @bagginsbill techniques (Fresnel graduation between full refraction head on and full reflection at edges).
[Edit: Oh, if you want the values for the Edge_Blend and Fresnel_Blend colour chips, you can just sample them straight from these images, or ask me, if that doesn't work for you. They're not just black and white]
@anomalaus that looks good. Would you mind to upload the shader as MT5 files?
Here's the Cycles/SuperFly shader with a Fractal_Sum node as the Translucence/Transmission mask: Saliva LoResDisk Dispersion +.mz5 (a compressed .mt5)
@zazop This one's for you:
Here's the FireFly shader with an Image_Map node (image not supplied) as the Translucence/Transmission mask: Translucent Drool.mz5
@anomalaus Thank you!
A short note on the use of the LightPath info in your SF shader: You have to use both isShadowRay and isDiffuseRay to get it working with light emitters as there is, for what ever reason, no ShadowRay info for light emitters.
I posted this workaround some time ago in the colored glass shader thread (with render samples) and my workaround was confirmed by BB.
@nagra_00_ thanks, I hadn't seen that thread. I see the Add with clamp is efficiently providing "Is Shadow or Diffuse Ray".
Could you post a link to that thread so I can read up on it, please?
[EDIT: OK, found it. Super-Fly-Coloured-Glass]
@anomalaus yep its an OR operation.
here the link to the thread
Puh, had to wait forever until i got permission to post the answer, stupid forum software this is !
@nagra_00_ let's see if we can fix that, then.
When I looked over the thread again, I realised that I had seen it. My apologies for overlooking your pearl of wisdom in the face of utter bedazzlement with @bagginsbill 's gems. [Note to self: Investigate
worship offamiliarity with ALL the Gods, rather than just ONE, or None ;-).]