Cycles/Eevee lights sync

Right now the node setup of cycles doesn’t work in Eevee so I made a light that can work both in cycles and eevee with drivers and an empty

STEPS: IMPORTANT!!! :warning:

  1. Append the text file hsv_to_rgb.py of the blend file, as the name says it, it will add an entry (function) to the drivers namespace that will convert hsv colors to rgb, this text file has to be ticked register and you have to set the “auto-run python scripts” in the preferences menu.
  2. Append the collection Lights.sync
  3. There will be an empty and a light, you can only select the emphy, now go to the properties panel, almost always visible in all projects, then go to the object tab, and look for custom properties, grab this subtab and place it at the top of the object tab and expand. there you have hue, saturation, type of light, shadows, power.
  4. now you can work in eevee and cycles without worrying about lights

PD: if it doesn’t work, try saving and reopening the blend file. You also have to take into account that eevee and cycles are different renderers.

Lights sync eevee and cycles.blend (991.4 KB)

2 Likes

What kinda light (spot, point, sun, area, hemi)?
All but hemi work, most need different intensity settings.
Do you mean emission shaders?
What is your goal?

What kinda light (spot, point, sun, area, hemi)?
Do you mean emission shaders?

The most common, and kind of compatible (no emission shaders, no hemi, no areas)

What is your goal?

A way to use Eevee as a fast preview of cycles, or mix parts of the scene with either renderer, but unfortunately, the light settings of one renderer are incompatible with the other so I tried to keep the intensities as close as possible for point, sun, and spotlights, because they are different after all. I found that for lamps and spotlights 1 unit of power in Eevee it’s pretty similar to 100 units of power in cycles, and for sun lights 1 unit of Eevee it’s similar to 1 unit in cycles, then I plugged all into the drivers.

Seems that point lights in EEVEE are about 100 times brighter than in Cycles. Could it be because one is using quadratic falloff and the other linear falloff?

If you set the light.energy (value used by EEVEE only) to cycles “Strength” value divided by 100 you get pretty close to a match.

Here is the result:

EEVEE_PointLight

I made a script that is triggered by an handler on post file open to correct all point lights.

It goes about like this:

import bpy

lights = bpy.data.lights
for light in lights:
    light.use_nodes = True
    if light.node_tree is None:
        continue
    ratio = 1
    light_type = type(light).__name__
    if light_type == "PointLight":
        ratio = 0.01
    cycle_value = light.node_tree.nodes["Emission"].inputs["Strength"].default_value
    light.energy = cycle_value * ratio
1 Like

it’s now implemented