Create emissive shader without casting light

Create emissive shader without casting light

crowellster
Observer Observer
1,083 Views
2 Replies
Message 1 of 3

Create emissive shader without casting light

crowellster
Observer
Observer

High all. I have a simple setup-- buildings, where the windows should be a solid bright color. I'm using two textures with selection tags on one object: One for the building, one for the lit windows. I don't want the lit windows to cast light on the buildings, but I can't figure out how to make the lights fully bright without doing that.


Any thoughts? Any way to get the effect of an emissive texture without casting light?

0 Likes
1,084 Views
2 Replies
Replies (2)
Message 2 of 3

madsd
Advisor
Advisor

This is fairly straight forward.

I have written a practical node you can use to stop the backfacing emission internally which can slow things down, making the emission directional based on the face you light up, Normal directions.

As seen below, you take the OSL code for the front/back map I made here, and wire it to theSwitch RGBA nodes diffuse component, where the "back" is black" and frontis whatever you want to emit. Then wire that up to the emission color slot and all is working like you want.
You can see I wire up an OSL Candy shader for the primary camera ray, and those does not conflict with the emission.

We now have a split signal ready to be designed.

NOTE:
You can also flip this around, so there is NO emission, and a strong light from the windows, you simply just switch the Switch RGBA inputs around.

I use 3ds max here, but you would do the exact same thing in C4D. UI just looks different, the result will be identical.


qweqwe.gif

Here is the code for the OSL Front Back node.

Make a new OSL node in C4D and insert this code.


shader FrontBack
(
    color Front = color(1,0,0),
    color Back  = color(0,1,0),
    
    output color Out = 0
)
{
    if (backfacing())
    Out = Back;
    else
    Out = Front;
}



And here is the reverse expression.

Full Emission color, and no bleeding, as mentioned you just swap the camera rays and leave the diffuse component untouched, this will stop emission to nearby surfaces.

2021-05-08-14-18-23.gif

0 Likes
Message 3 of 3

lee_griggs
Autodesk
Autodesk

You can also reduce indirect_diffuse to 0 for the non-emissive surfaces if you don't want them to receive the effect of the emission.


1620638264496.png

Lee Griggs
Arnold rendering specialist
AUTODESK
0 Likes