PDA

View Full Version : Gradient help needed



sublimationman
09-26-2009, 05:38 PM
I just can't seem to grasp how to implement gradients properly.

Here is what I am trying to do. I have a glass with ice tea in it, I am using dielectric for the tea and looking at the side of the glass I would like to make the tea darker in the middle (where it would be thickest) and clearer towards the edges of the glass. A absorption value of 24 gives a good darkness to it in the middle but it is then the same at the edges.

So I figured I would add a gradient with incidence angle to the absorption input of the dielectric node. I have tried different values between white and black, used the color then the alpha outputs and everything I try ends up with near clear liquid, like maybe it had an absorption value of 2 or 3.

Not sure what values to use for start and end, tried 0-1 then tried 0-24. Also not sure what the color and alpha settings should be, tried 20 or more variations and every single one looked exactly the same.

I know I am missing some simple step here but can't figure it out.

I would appreciate any insight on this. Thanks!

Hieron
09-26-2009, 08:33 PM
Not sure if you tried already, but when the gradient gives "white" would that not be "1". Thus perhaps you need a multiply function of 24 on the output of the gradient before you feed it into the Dielectric.

Can't test here now, but that's the first I'd do.

Matt
09-26-2009, 09:45 PM
Edit: Read your post again

If you use Alpha output on the Gradient node, only the Alpha settings used on the keys matter, just set the Gradient to Input to Incidence as you have, leave the colours, and use values above 100% on the keys for the Alpha settings.

You could also use the Gradient Keys at 0 and 1, with 0% and 100% respectively, and use a Multiply node to scale the input into the Absorption. It makes it easier to scale all the keys at once, of course you might not want to do this. (Just read Hieron's post, he's suggesting the same thing too!)

Dunno if this is the best way of doing this, but it seems to do something!

sublimationman
09-26-2009, 11:59 PM
OK thanks, will give the multiply a try.

Matt
09-28-2009, 02:43 AM
Let us know how you get on.