Impossible effect, due to pathtracing means of working?

Hi

I’m watching a let’s play of Witcher 3 where grass foilage is being lit by the moon, and where there is an apparent translucent highlight on back faces of the grass leaves. Translucent is similar to diffuse (for back faces) and doesn’t create any highlights. Refraction is similar to glossy and can create highlights on back faces if it has roughness (transparency shader have no ray splitting so unusable for this). I can do this, but only if I add thickness to the leaf (otherwise refraction will fail). Creating a big populus of this foilage would possibly crash my system, so ideally I would like to have refraction (without IOR bending) on a flat plane, but then roughness doesn’t kick in (needed for the highlight).

I don’t expect there to be a good workaround for this. I’m more wondering, is this a limitation originating from the nature of how path tracing works? Is it possible, not using nodes but at Cycles programming level, to have on of:

  1. Some sort of highlight/sigma control on the translucent shader?
  2. To have refraction react to roughness even with 1.0 in IOR?
  3. Roughness (and normal input) on the transparent shader?

I have no idea how others do this, if at all.

I am pretty sure you can achieve this in realtime using upbge and instancing, and I believe translucency is in the material panel in upge as well as sub surface scattering inside the game engine.

I mean in Cycles.
Glossy can reflect multiple rays to cause a blurred reflection from a flat face.
Refraction can refract multiple rays to cause a blurred refraction, but requires a solid and IOR>1.
In a pure raytracer we could manipulate spawning of multiple rays at will.
The setup that will eventually fail using flat planes (most significant nodes are red):



The lower drawing is what I think should be possible to achieve, but I’m wondering if there are any technological reasons this is not possible.

humm… that is an interesting problem…
Fixing the IOR in the backface is relatively easy.
For something like «blured transparency», maybe…
maybe changing the normal… ohhh I must test this :slight_smile:

Does this help?


it produces this effect:



I used a vertical gradient for the roughness, and the plane (it’s actually a grid) has some faces with flipped normals for testing.

edit: the value 10 is probably too big. In the test scene I used 3.

Incoming -> Refraction Normal??? Wtf? :smiley: That’s completely bizarre and would never have dawned on me, so thanks for that. I understand why that might do a trick like that, although I’m not sure how I would mix in a regular bump/normal map. Then again, maybe a color mask (diffuse, refraction and translucency shaders) would probably be enough and influence normals on the other shaders would work. Will have to experiment.

What would be a proper way of blending these shaders? I guess most just add diffuse to regular translucency, so maybe adding diffuse with a fixed mix of translucency and refraction with glossy fresnel mixed on top would be good enough?

Good idea to flip some faces in a grid for testing. Have to remember that as well for these experiments :slight_smile:

Still, is thin refraction blurriness something that should be requested (since glossy can do it) as a feature?

simply plugging the incoming vector into the normal socket of the bump node. :wink:

What would be a proper way of blending these shaders?

Dunno… maybe with fun?! :stuck_out_tongue:
One thing I remembered right after making this setup, was to use it for architectural frosted/hammered glass. (basic fresnel/refraction/glossy custom glass, with this setup replacing the refraction node, and using the IOR fix for the fresnel also)

Still, is thin refraction blurriness something that should be requested (since glossy can do it) as a feature?

I think cycles could have some ‘almost PBR’ shaders for allowing us to speed up things a bit more… A Thin Glass with blur/bump, for example, would be great to have, and I think I’m not alone with this thought.

A small test with a bumped thin glass:


I pointed the Disney thread here.
http://blog.selfshadow.com/publications/s2015-shading-course/burley/s2015_pbs_disney_bsdf_notes.pdf
Disney has a separate thin surface BSDF that I guess mimics these effects faster than goes on internally in refraction. Even if he don’t include the BSDF as a separate enclosure for us to use at will, this looks to be a promising (although most likelu slower) workaround to achieve something at least I didn’t find feasible.

Yeah, have fun it is, naturally. I was thinking more in terms of a “proper” way to do it wrt energy conservation.

Is there a trick or procedure to change a normal map affecting surface normal into a normal map affecting incoming normal? I can make a Shader.Transmissive node group to be used in PBR like setups complete with a “thin switch” (0 gives regular glass, 1 gives thin refractive with unification of IOR). Normal glass should use regular surface normal modification from a normal map, but thin should use incoming normal modification.

Although I could separate it into Shader.TransmissiveRegular and Shader.TransmissiveThin, I don’t know how I could parse outside normal map information into the group. Bump map wouldn’t be a problem, normal map however is.

I don’t know how, but there is probably a way to do it.
Must do some calcs in paper to see if there’s some kind of formula that we can apply to normal maps…

As the paper says, this is already an aproximation of an aproximation of an…
(nice paper, by the way :slight_smile: )