2
$\begingroup$

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:

enter image description here

However, I get this:

enter image description here

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

factor of 1 factor of .5 factor of 0

What is causing this darkening and how can I get the desired result?

$\endgroup$
3
$\begingroup$

Try increasing the bounces under light paths.

enter image description here

The direct light preset with caustices gives a very dark image

enter image description here

while full global preset gives a golden brown finish.

enter image description here

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.

enter image description here

$\endgroup$
  • $\begingroup$ It's still pretty noisy.. Is there a way to use ray length without including the variations caused by scattering etc? E.g. get the ray length as it occurs with a transparent node then use that to mix other shaders? $\endgroup$ – gandalf3 Nov 21 '13 at 22:32
  • $\begingroup$ @gandalf3 the noise would be from the glass or more specifically the caustics - the biggest cause of noise in cycles. Usual noise reduction tricks apply. The material used won't alter the ray length, it is a measurement based off surface locations. I'm not sure that you get much variation in your mix calculations, I only see zero value facing camera. $\endgroup$ – sambler Nov 22 '13 at 12:27
  • $\begingroup$ I thought the ray length referred to the path-traced ray, which bounces/scatters/transmits through an object based on the properties of the material? Anyway I was attempting to make a orange juice shader (again), and I can't figure out how to make it scatter light more based on the distance light has to travel through the juice. E.g like this, where the OJ is "thin", it looks like a glass shader, but there it is thicker, it looks like it needs SSS. $\endgroup$ – gandalf3 Nov 22 '13 at 21:59
0
$\begingroup$

I think that what you want to do is not to use the Ray Length directly, because that can includes many different ray types, but instead multiply the Ray Length with Is Transmission Ray, in order to get the length of the Transmission ray, instead of one which also includes the Camera ray type and others.

$\endgroup$
  • $\begingroup$ I don't want the length between the camera and the object, I want the length between one surface of the object to the other (inside the object the rays are all transmission or reflection, there should be no camera rays in there).. This is easily gotten by multiplying the ray length by the backfacing, but using that to mix shaders is not working as expected.. $\endgroup$ – gandalf3 Oct 13 '14 at 20:24
  • $\begingroup$ There; All fixed $\endgroup$ – someonewithpc Oct 13 '14 at 20:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.