Reflection visible, mesh invisible

Hi, I am trying to render an emissive object above a ground plane. I want to keep the reflection that the emissive element causes on the ground plane, but I do not wish the ground plane to be visible.

I checked several threads about this. It did not work for me. For example, in the ray visibility of the plane, I turned off the camera slot. I do not get any reflection from my emissive. I lose everything about the aircraft. I also tried the shader option, using a light path node and Is Camera Ray, but I got the plane invisible again. I do not get the reflective color of my green emission.

Is this possible to achieve?

You can try adding a glossy shader to a transparent shader (in Cycles)… That will make your ground transparent, but all the reflected light will be added to the image. (this will also include world and other lighting in your scene, so be aware).

I think this is a good start, but then I get the reflections of my hdri on the plane.

Maybe this one could help:

That was what I meant with “will also include world and other lighting in your scene”.
Okidoki’s solution is ok most of the times… I personally prefer to use OSL for these kind of effects, in particular this script:

shader IncomingMix(string Prefix = "",
                string Suffix = "",
                color Color1=0.0,
                color Color2=1.0,
                output color Color=0.0)
{
    Color = Color1;
    string geom;
    if (trace(P, I)){
        getmessage("trace", "geom:name", geom);
        if (startswith(geom, Prefix) && endswith(geom, Suffix)){
                Color = Color2;
        }
    }
}

The Prefix and Suffix will filter which objects should be used for filtering the incoming ray (by object’s name).
If the incoming ray comes from any object with a matching Prefix and Suffix, the Color2 will be the output. Else it will output Color1.

You could use this in your world material… Just plug the HDRI into Color1 set Color2 to black and put the name of your Ground Object in the Prefix.
In other words: your World texture will be black if the ray is coming from the ground object.

1 Like

Wow this is really cool. Do you know how to run the script?

Just enable OpenShadingLanguage in the render tab, and use the script node.

Btw, tracing from World position in Cycles is still a bit buggy. The best alternative, is to replace the World texture with a Sphere.

Here’s an example scene:
OSL_FilterIncoming.blend (1.7 MB)

1 Like

Thank you so much