# Custom light falloff in Cycles

I'm trying to create a point light with a stepped falloff. I know that in Blender Render, there is an option to customize falloff, but the falloff node in cycles only allows for linear, quadratic and constant.

Is there a way to make my own falloff curve or manually manipulate the light properties in Blender?

• I believe you can keyframe the strength. – Dontwalk Feb 21 '18 at 22:13
• Wouldn't keyframing the strength change the falloff over time, but not distance? I'm looking for light that has a clear stepped attenuation at any given time. – Sarah Feb 21 '18 at 22:28
• Yes... You could also keyframe the distance (Location) of the light source. – Dontwalk Feb 21 '18 at 22:32

## 1 Answer

You can manipulate the Emission strength of the lamp based on the Ray Length from the Light Path node - this is precisely what the Light Falloff node does (you provide an emission Strength and it determines what the actual emission should be to achieve that result).

You can derive the different Light Falloff values from each other by either multiplying or dividing by the ray length to move up or down the scale. ie,

Quadratic * RayLength = Linear
Linear * RayLength = Constant
Constant / RayLength / RayLength = Quadratic


This allows you to get some interesting effects - for example, you could get Cubic falloff by simply dividing Quadratic by the RayLength.

To get a 'stepped' effect (where the falloff suddenly changes at regular intervals) you can use the Modulo maths function to give a stepped effect to the Ray Length as follows :

Adjusting the Modulo node will affect the size of the banding.

This can produce the following result :

Here's another useful setup for adjusting the falloff using a Color Ramp - this time using Constant falloff so the 'maximum' illumination is not affected by distance (ie, purely based on the color ramp).

The Subtract and Divide maths nodes control the offset and scaling of where the color ramp is applied to the illumination and the color ramp controls the profile. For 'stepped' banding simply use Constant interpolation in the Color Ramp and configure the ramp with the required bands.