(Cycles) I am making a Car Paint Shader - Absorption is subtracting from reflections

Ok, so i am making a rather advanced car paint group that i intend on sharing. One of the features i plan to have and have (somewhat) successfully added is absorption. Normally, like ior, absorption is a feature directly related to a transparent object… However, one of the many interesting anomalies of car paint is that as you look down the length of the car, it begins to subtract the polar oposite color from the diffuse light, creating a slightly darker crescent around the outer edges of the object, simultaneously making yellows less dingy by subtracting blues, reds more bright by subtracting greens, and blues more vibrent bu subtracting the yellows that make greenish light around the edges…

I DID IT, for the most part, except for the part where when you run up the absorption amount, it ALSO starts taking away from reflections WHY IS IT TAKING AWAY FROM REFLECTIONS! the gloss nodes are AFTER the absorption node tree… so why is this happening? I believe it is because of the mix shader. because it is MIXING the gloss with the color and since the absorption affects the factor, that that is how it is subtracting lamp reflections, etc, but how can i still get the gloss effect without needing to mix them, evidently ruining the effect.

Until i figure this out i am at a loss and will proceed with the rest of the node tree. If someone experienced believes they can help than i would be willing to share my setup thus far over PM, or if i have provided enough information for you to help me out, great. I appreciate it. Hopefully this all makes some sort of sense, it barely made sense to me as i made the absorption effect, and to be honest i just sort of bull shit my way through it till i found something that worked.

don’t really like these Absorption things!LOL

did saw some gems done like that
and i’m still having problem to understand what it is doing !

so wish you good luck

happy cycles

Hard to tell what’s up with a node tree without actually seeing it. Absorption without transmission sounds a bit like fresnel - is that what you are using?

how can i still get the gloss effect without needing to mix them, evidently ruining the effect.

At a guess you could use the add shader but you might have to do some work to modulate the effect of this since there is no factor.

no its not using fresnel. fresnel while angle based isnt quite the gradient harshness im looking for. i used a dot for it, and while im sure there is a way, im not sure how you would subtract a certain outer color. thinking on it more i dont know that gloss is the problem. prehapse if i pm a pic of the node tree you can take a look. i can take a couple pics and explain the problem better but i dont intend to make my node tree public until later or prehapse after my viper is done.

Car paint is metal yeah? Or at least what’s underneath the paint is metal usually - and thus it will have no subsurface component, thus no absorption. I think the effect you’re noticing is due to fresnel, perhaps even if you don’t think so :wink:

Post a picture of this effect you’re observing and we might be able to figure out what it is. Guessing in the dark is hard.

regardless of what is underneith, picture this… prime, prime, matte, matte, candy, candy, candy, flakes, candy, cnady, clear, clear. I understand what you are trying to say, but if what you where saying where true, than the clear coat IOR would ba somewhere from 2.2-2.8 which is not the case… colors often have a candy coat, which is a colored clear coat, that absorbs light. like i said, if you have a yellow car, theoretically a slightly orange candy, creating a dark orange side tone with a bright yellow top tone with a slightly darkening crescent that happens by removing blue anywhere where there is ambient light, often being the back, which is how i faked this effect. Lux render did a great job with this effect and it is much used by me and i believe several others as well. i also know that there are other engines that have dabbled in it. it is a good effect to have. regardless of whether or not the base layer is metal, you cannot forget the 2mm thick shell of candy coats.

I understand this is faked with a facing node to an extent… problem still stands that ambient lighting of the color being absorbed still shows through often making the yellow sortof dingy, the red too cherry colored and the greens too brown… this is why you subtract the color. I might just have to try something else to arm bend this some more.

Hi TS. I am having trouble following your train of thought. Like Greg I think posting a picture or two might help. I too thought of the Lux car paint shader so I guess that’s a start, but it’s not a take apart nodegroup… I am tempted to say a facing into a gradient connected to the glossy color input with a base color connected to another glossy shader and the two shaders blended with fresnel and then a top coat of plain glossy. Diffuse underall with the diffuse turned up to remove the ambient contribution. Who knows if that’s what you want but the Lux CP shader looks a bit like that

With spectral algorithms for the propagation of light, luxrender can render a thin transparent layers of coat with nanometer care.
Therefore, these layers absorb only light with a certain wavelength. It is not surprising that fake this effect in a Cycles is so difficult.

I know it is, here are the images, a picture of what it looks like with no absorption, and a picture of what it looks like with a very dramatic white absorption. Subtracting white would make the outer edges black (which it does)… PROBLEM… Its also taking white from the reflections. It shouldnt be absorbing reflections, only diffuse light.

Here is the node setup, the working version with no absorption, and the problem version with a demonstration of the problem.

With spectral algorithms for the propagation of light, luxrender can render a thin transparent layers of coat with nanometer care. Therefore, these layers absorb only light with a certain wavelength. It is not surprising that fake this effect in a Cycles is so difficult.

Yeah, Lux might be a bit slower but their math is just at such a high level compared to cycles. This isnt to put cycles down, because they both have their share of advantages. Speed is not one of luxes, and there are a great number of things in cycles that have to be drastically arm bent to get even similar results at half the realism that lux gets in 30 seconds… its a toss up. To each their own. I use them both, am proficient in lux and still prefer it over cycles, but hiden lamps and render speeds and easier ability to mix shaders draws me back to cycles most of the time for ease of use.

To anyone else curious. I had intended to share this later, but here is the node setup. If there are any suggestions as to the problem of absorption subtracting from reflections, let me know. https://drive.google.com/folderview?id=0B3XCeK6b2Q3uV29NNmI4T3ROaTA&usp=sharing

Hi TS I have a little better idea of what you are trying to achieve but only from looking at your tree, I think what Greg and I were asking for was a real world photographic reference of what you were aiming for.

I don’t like to use huge node trees unless absolutely necessary so here is a tiny tree that might give you some ideas for your project. No doubt it’s not whatyou want but perhaps it will give you some ideas for trying out. Note that you will have to figure out the absorption bands in the gradient by knowing the complement of the color but that’s not hard for you. A lot of variables to play with here so I hope it works out. The fresnel/facing nodes are not a performance hit AFAICT but the lightpath node surely is so I avoided using that one.

The intention isnt to make the node tree larger, however this does not achieve absorption. this fakes it… i do appreciate this but i feel you might be misunderstanding what im asking. i cant show you because it will likely only cause more confusion.

if you saw in my node tree i was using a mix>subtract. this is subtracting a certain color from the edge. Ading another color will make the color dingy in certain scenarios, which is more similar to a highly polished powder coat, not several mm’s of candy coats which dont just get darker, but get darker because they are removeing another color… resulting in a much more vibrent color that USUALLY looks much more natural.

Understandably the amount of nodes is a bit much but if all i was doing was looking to make a really shiny powder coat that looked neglegebly different to car paint i would have just followed johnathan williamsons tutorial to a T.

just a note here
don’t think we have the color absorption yet in cycles

let me find one with some absorption and dispersion fake i think

here it is

now to fake that it is a very complicated nodes set up!

i got another one which is less transparent !
let me know if you want it !

happy cycles

cannot upload set up here - impossible to read!

so here is file

zab1.blend (658 KB)

hope it gives some ideas may be

i think there is another one like that
have to search for it !

happy bl

found 2 others with some different refractions and caustic

if you need files let me know
but these are not that complicated but gives some nice render

happy bl

You are right, these node setups are very complicated. im not 100% sure how i would impliment it into an opace surface. First thing that pops out at me is that seperate RGB which is why they created the refraction node. Unfortunately one of the features NOT included in this node is a form of color absorption allowing me to specify bias as to which color is absorbed. I didnt expect this to be easy, some how didnt expect this to be this hard either. :spin:

Lux render makes it look so easy. I love you lux. Oh lux gods, give me some pointers as to how i can bring your genius to the world of cycles XD.

as i know of cycles cannot deal with wavelenght yet
but who knows someone might come up with an hack to do it later on!

may be check the OSL thread might find some OSL script dealing with wavelenght and rays!
IMHO until we get more new nodes don’t think it is really worth spending too much time on this
i would suggest that if you have not found it then wait another 6 months and you might find some new nodes which will allow it!

in any case good luck !

happy cycles

cycles will have a new feature
fresnel node will get a new normal input

which might come in next SVN only


I wish I could remember the exact blog I got this nodegroup from (so I could give proper credit - not to mention reference again for later), but it may be of interest. It causes some color shift depending on how far light passes through something (varys on light angle and such.) Its effect also seems to vary depending on whether it’s used with glass, transparent, or SSS. (May be some others too.) Also if I recall you don’t put in the negative, but rather the color you want it to shift to.

Haven’t considered using it as part of a car paint layer, but interesting with stuff like candles or marble-like materials. Might also consider doing it outside of a group and replacing the two mix inputs with a colorramp gradient for finer control.

I’m still quite new at this (but on and off at rendering in some other software) so I’m not sure if this has been covered, but I figure it can’t hurt to chip in 2¢ that might help.