Mixing two shaders based on raylength I attempted to mix a Glass shader and an SSS shader based on ray length to simulate a material that has many particles in it, scattering light that travels farther through it.

Node setup:



However, I get this:



Manually setting the Factor of the mix shader anywhere in between 1 and 0 gives this (renders of 1, .5, and 0):

  

What is causing this darkening and how can I get the desired result?
Try increasing the bounces under light paths.



The direct light preset with caustices gives a very dark image 



while full global preset gives a golden brown finish. 



I also think the SSS being used on the backface may be stopping light passing through the object. The calculation for the mix appears to always give a zero value for the visible faces, by replacing the SSS with another glass shader you get a brighter finish.