reflection roughness control in cycles

Hi all,

is it possible without the compositor to control the reflection roughness only?.

Its possible to control the color and material with the light path node but it seems not possible to get a faded reflection from sharp to soft (only for the reflection not for the hole material).

For example a diffuse material with a glossy reflection faded from sharp to soft.

You can change the roughness value of the glossy shader with fresnel, facing or texture coordinate input or which way you need it to change. If roughness is higher, reflection is softer.

Here the roughness of glossy shader changes left to right, but diffuse checker texture stays the same:


Node setup just to show the effect:


I’m having problem figuring out what you’re really asking here. Kesonmis example should be straightforward, but I can’t figure out why you want to use light path node for anything? A red ball on a checker floor - I can with relative ease assign roughness to the red ball based on camera distance to it (which would be a weird thing to do), but I haven’t found a way to blur the checker floor reflection in the red ball based on its distance to the red ball. Reflected ray = total ray - first hit ray to control the blurriness of the checker floor I don’t think is possible. This would be useful though, and I’ve used it in the past in other sw to fade nearby objects and replace them with environment to speed up rendertimes. In Cycles we don’t have means to manually trace rays for these kinds of weird effects.

kesonmis thanks for your example…will check that set up tomorrow.

CarlG at the moment i only try to check whats possible and more important whats not possible.
If i paint i try to get a focus to a specific area and contrast is the most important part to get a focus…value contrast, color contrast, color-non color contrast… AND sharp-soft contrast …in the example by kesonmis my view is guided by the soft-sharp contrast.

Here is a example where a reflection of the ground plane from sharp to soft would lead to a focal in the middle area of the picture.


I know its not realistic at all but its important for me to have acces to all kind of contrast to guide the viewer where i want.
compositor is another solution to extract the reflection with a inderect pass and blur it.

Okay, here is what I would do:



Using node wrangler, I would preview a greater than node to figure out the distances (minimum should be just outside camera in case result of power curve becomes visible), then plug them in as shown.

Note that I have a stepfunctions node group that makes this easy for me to do without even having to think about the maths involved. But the values, subtract nodes, value driver and divide nodes are exactly what the linstep does; map the range 0.08 to 1.53 to a manageable 0-1 in s linear fashion. Think of it as a normalize but you have to feed it the limits. After divide I just apply a power curve to control the shape of the curve until you get the result you want. From there just assign the roughness values you want into the colors of an RGB mixer (we don’t have a builtin float mixer).

That’s distance based though. I think I would actually prefer facing angle instead to drive the roughness, and would require less mess, and probably produce kind of a similar result depending on how you shape the facing angle after reading it.