6
$\begingroup$

With Blender Internal Renderer I can set the max distance of reflections in the material of the mirror object.

enter image description here

How can I achieve the same with cycles?

$\endgroup$
3
  • 1
    $\begingroup$ I don't think this is possible. Cycles is a physically based renderer and is not really suited for this, especially since it is a 'reverse ray tracer' (so it traces rays from the camera to the scene and on to a light source). It would need to determine the length of a ray to control the mirrored surface before it had actually traced that ray (since the path is reversed to that intuitive to the physical world). There may be a way of emulating this in the compositor after tracing both paths but I do not think this is possible with available Cycles nodes. $\endgroup$ Dec 15, 2017 at 14:34
  • 1
    $\begingroup$ Just to note: the physical situation this effect tries to emulate is that of a rough reflector. That one is very easy to do in Cycles. $\endgroup$ Dec 15, 2017 at 18:59
  • $\begingroup$ I originally discounted just adding Roughness as the result is not as sharp as the BI sample image but on reflection(!) you’re absolutely right, @JohnDvorak - that is the Cycles equivalent. You should add it as an answer. $\endgroup$ Dec 16, 2017 at 7:26

1 Answer 1

11
$\begingroup$

EDIT: As mentioned in a comment above, using a glossy shader for the mirror and simply adding a small amount of roughness will give a similar result, although you will lose some of the definition in the reflection that you can get with blender internal. My solution is a way to get defined reflections that still fade out.

As far as I know, there is no 'proper' way to do this, as in there is no setting that will allow you to make the reflection fade out a certain distance from the material.

However, there are some ways to fake what you are doing, and in the case of replicating the image above they work quite well. However, if you try to scale this up to larger, more complex models or a non planar mirror you may have some issues (I haven't tested this).

The way to fake this in Cycles is to modify the material on the object being reflected, and leave the plane with just a glossy shader with a roughness of 0. Any roughness will work just fine, but 0 will make everything much easier to preview as you set up. In my file I gave it a bit of a blue color as well.

For the cube, we'll use a combination of a gradient texture and the light path node. Using the light path node, we can isolate the reflected cube by using the Is Reflection Ray Output. If you use the node wrangler addon, you can CtrlShift click on a node to preview it. Which will look like this:

enter image description here

We can multiply the reflected cube by a gradient texture, which will produce a gradient on the reflected cube. You will have to rotate the gradient texture by 90 degrees using the mapping node, and I used a color ramp to adjust the falloff. Again previewing this step results in this:

EDIT: If you replace the Texture Coordinates node with a geometry node and use the position output, as well as set the x location value of the mapping node to 0.5, the result behaves more like the blender internal method, with less reflection the further away the cube is (you will also want to adjust the color ramp to get a nicer falloff as well).

enter image description here

Then we simply use this as a factor for a mix node that combines a diffuse shader and a transparent shader. Which gives this result:

enter image description here

Do note that you will want to disable reflective caustics if possible, as leaving that enabled causes a huge amount of noise and fireflies.

Here is the final node setup for the cube:

enter image description here

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .